Contact Book MCP Server
Contact Book MCP Server
一个简单的 Model Context Protocol (MCP) 服务器,用于管理内存通讯录。使用 mcp Python SDK 中的 FastMCP 构建。
功能
该服务器提供四个工具:
工具 | 说明 |
| 向通讯录添加新联系人。 |
| 根据名称精确匹配获取联系人。 |
| 根据部分(不区分大小写)名称匹配搜索联系人。 |
| 更新已有联系人的电话和电子邮件。 |
联系人以如下形式存储在内存中:
contacts: dict[str, dict] # name -> {"phone": ..., "email": ...}注意: 数据仅存储在内存中。服务器重启后,所有联系人都会丢失。
Related MCP server: mcp-outlook-contacts
环境要求
Python 3.10+
uv(推荐用于运行服务器)
安装
克隆此仓库:
git clone <your-repo-url> cd contact_book_server_mcp安装依赖:
pip install -r requirements.txt或者,如果使用
uv(推荐,无需手动安装——参见下文)。
运行服务器
使用 MCP Inspector(用于测试/开发)
uv run --with mcp mcp dev server.py这将启动服务器,并在浏览器中打开 MCP Inspector,你可以在此交互式地测试每个工具。
独立运行
python server.py示例用法
添加联系人
add_contact(name="Humna Fahad", phone="03001234567", email="humna@test.com") → "Contact 'Humna Fahad' added successfully."获取联系人
get_contact(name="Humna Fahad") → {"name": "Humna Fahad", "phone": "03001234567", "email": "humna@test.com"}搜索联系人
search_contacts(query="Hum") → [{"name": "Humna Fahad", "phone": "03001234567", "email": "humna@test.com"}]更新联系人
update_contact(name="Humna Fahad", phone="03009998888", email="humna@updated.com") → "Contact 'Humna Fahad' updated successfully."
项目状态
✅ 所有四个工具均已实现,并已通过 MCP Inspector 测试。
可能的改进
添加
delete_contact工具。添加
list_all_contacts工具。将联系人持久化到 JSON 文件或数据库中,而不是存储在内存中。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Manage contacts, organizations and their recorded relationships in your workspace. Setup: In a remote MCP client that supports Streamable HTTP and OAuth, add https://platform.samuelz.com/api/v1/mcp/operator?toolset=crm. Sign in to Samuelz and select your authorized workspace. An active workspace membership and the relevant module permissions are required. Review the requested permissions before authorizing. Existing approval requirements continue to apply.
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.
Search and manage your team's knowledge from MCP clients.
Related MCP Servers
- AlicenseBqualityBmaintenanceMCP server for the Infomaniak Contacts API, enabling listing and searching contacts across address books.293 npm3MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for accessing and managing Microsoft 365 Outlook Contacts, enabling AI agents to retrieve and interact with contact data through natural language.117 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Google Contacts - list, search, and manage contacts.101 npm6MIT
- FlicenseAqualityDmaintenanceA local MCP server that maintains a persona profile (contact library) for AI assistants, allowing them to create, search, retrieve, supplement, and correct information about people mentioned in conversations via tools like search_profiles, get_profile, create_profile, update_profile, add_facts, update_fact, and delete_fact.8-