c2-contact/c2-mcp
3.1
If you are the rightful owner of c2-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server for contact management, utilizing pglite for database operations and Ollama for AI-powered embeddings and semantic search.
Tools
10
Resources
0
Prompts
0
c2-mcp
A Model Context Protocol (MCP) server for contact management, powered by pglite (embedded Postgres/SQLite hybrid) and Ollama for AI-powered embeddings and semantic search.
Features
- MCP server: Implements the Model Context Protocol for tool-based automation and agent integration.
- Contact management: Create, read, update, delete, list, and search contacts.
- Bulk operations: Bulk create, update, and delete contacts.
- Semantic search: Find contacts using vector embeddings and similarity search (via Ollama).
- Configurable: Database location, AI base URL, and embeddings model are all configurable.
Requirements
- Bun (v1.2.18 or later recommended)
- Ollama running locally or accessible via HTTP (default:
http://localhost:11434)
Installation
bun install
Running the Server
bun run index.ts
Configuration
You can configure the server using environment variables or command-line arguments:
DB_PATHor--db-path=...— Path to the database directory (default:./dbin storage dir)AI_BASE_URLor--ai-base-url=...— Base URL for the Ollama API (default:http://localhost:11434/v1)EMBEDDINGS_MODELor--embeddings-model=...— Embeddings model to use (default:mxbai-embed-large)
Example:
DB_PATH=./mydb AI_BASE_URL=http://localhost:11434/v1 EMBEDDINGS_MODEL=mxbai-embed-large bun run index.ts
Main Tools/Endpoints
The MCP server exposes the following tools:
create-contact— Create a new contactget-contact— Get a contact by IDlist-contacts— List all contacts (with pagination)search-contacts— Search contacts by name, email, or phoneupdate-contact— Update an existing contactdelete-contact— Delete a contact by IDsemantic-search-contacts— Semantic search using embeddingsbulk-create-contacts— Bulk create contactsbulk-update-contacts— Bulk update contactsbulk-delete-contacts— Bulk delete contacts
Development
- The project uses drizzle-orm for database access and migrations.
- Database migrations are stored in the
drizzle/directory and run automatically on startup. - Embeddings are generated via the Ollama API and stored in the database for semantic search.
Project Structure
index.ts— Main entrypoint, server setupsrc/contact-service.ts— Contact management logicsrc/database.ts— Database setup (pglite)src/embeddings.ts— Embedding generation (Ollama)src/context.ts— Context and configuration helpersdrizzle/— Database migrationsintegration/,e2e/,src/*.test.ts— Tests
License
MIT
This project was created using bun init in bun v1.2.18. Bun is a fast all-in-one JavaScript runtime.