c2-contact/c2-mcp
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.
create-contact
Create a new contact
get-contact
Get a contact by ID
list-contacts
List all contacts (with pagination)
search-contacts
Search contacts by name, email, or phone
update-contact
Update an existing contact
delete-contact
Delete a contact by ID
semantic-search-contacts
Semantic search using embeddings
bulk-create-contacts
Bulk create contacts
bulk-update-contacts
Bulk update contacts
bulk-delete-contacts
Bulk delete contacts
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_PATH
or--db-path=...
— Path to the database directory (default:./db
in storage dir)AI_BASE_URL
or--ai-base-url=...
— Base URL for the Ollama API (default:http://localhost:11434/v1
)EMBEDDINGS_MODEL
or--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.