Contact Book MCP Server
Contact Book MCP Server
A simple Model Context Protocol (MCP) server that manages an in-memory contact book. Built with FastMCP from the mcp Python SDK.
Features
This server exposes four tools:
Tool | Description |
| Adds a new contact to the contact book. |
| Retrieves a contact by exact name match. |
| Searches contacts by partial (case-insensitive) name match. |
| Updates an existing contact's phone and email. |
Contacts are stored in memory as:
contacts: dict[str, dict] # name -> {"phone": ..., "email": ...}Note: Data is stored in memory only. All contacts are lost when the server restarts.
Related MCP server: notes-box
Requirements
Python 3.10+
uv(recommended for running the server)
Installation
Clone this repository:
git clone <your-repo-url> cd contact_book_server_mcpInstall dependencies:
pip install -r requirements.txtOr, if using
uv(recommended, no manual install needed — see below).
Running the Server
With MCP Inspector (for testing/development)
uv run --with mcp mcp dev server.pyThis starts the server and opens the MCP Inspector in your browser, where you can test each tool interactively.
Standalone
python server.pyExample Usage
Add a contact
add_contact(name="Humna Fahad", phone="03001234567", email="humna@test.com") → "Contact 'Humna Fahad' added successfully."Get a contact
get_contact(name="Humna Fahad") → {"name": "Humna Fahad", "phone": "03001234567", "email": "humna@test.com"}Search contacts
search_contacts(query="Hum") → [{"name": "Humna Fahad", "phone": "03001234567", "email": "humna@test.com"}]Update a contact
update_contact(name="Humna Fahad", phone="03009998888", email="humna@updated.com") → "Contact 'Humna Fahad' updated successfully."
Project Status
✅ All four tools implemented and tested via MCP Inspector.
Possible Improvements
Add a
delete_contacttool.Add a
list_all_contactstool.Persist contacts to a JSON file or database instead of in-memory storage.
This server cannot be deployed
Maintenance
Related MCP Connectors
- KogniteOAuthdev.kognite
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Hosted MCP memory and agent control plane for durable conversations, jobs, and operations.
MCP server for OnceAsk, the AI-native current-address layer for people and agents.
API-first CRM for LLMs - contacts, companies, deals and activities over a native MCP server.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables adding, getting, and listing notes through MCP, with state persisted to a JSON file in the home directory.MIT
- AlicenseNot gradedqualityCmaintenanceEnables creating, retrieving, updating, deleting, and listing notes through a simple MCP interface, with configurable note storage.MIT
- FlicenseNot gradedqualityCmaintenanceEnables managing notes through add, get, update, delete, and list tools via MCP.-
- AlicenseNot gradedqualityCmaintenanceEnables managing a local notes file through add, get, update, delete, and list operations via MCP.MIT