Contact Book MCP Server

Contact Book MCP Server

Enables an in-memory contact book to be managed by adding, retrieving, searching, and updating contacts through MCP tools.

Category
Visit Server

README

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
add_contact(name, phone, email) Adds a new contact to the contact book.
get_contact(name) Retrieves a contact by exact name match.
search_contacts(query) Searches contacts by partial (case-insensitive) name match.
update_contact(name, phone, email) 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.

Requirements

  • Python 3.10+
  • uv (recommended for running the server)

Installation

  1. Clone this repository:

    git clone <your-repo-url>
    cd contact_book_server_mcp
    
  2. Install dependencies:

    pip install -r requirements.txt
    

    Or, 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.py

This starts the server and opens the MCP Inspector in your browser, where you can test each tool interactively.

Standalone

python server.py

Example Usage

  1. Add a contact

    add_contact(name="Humna Fahad", phone="03001234567", email="humna@test.com")
    → "Contact 'Humna Fahad' added successfully."
    
  2. Get a contact

    get_contact(name="Humna Fahad")
    → {"name": "Humna Fahad", "phone": "03001234567", "email": "humna@test.com"}
    
  3. Search contacts

    search_contacts(query="Hum")
    → [{"name": "Humna Fahad", "phone": "03001234567", "email": "humna@test.com"}]
    
  4. 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_contact tool.
  • Add a list_all_contacts tool.
  • Persist contacts to a JSON file or database instead of in-memory storage.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured