gramps-ez-mcp
Enables natural language queries about family tree data from a Gramps genealogy database.
README
gramps-ez-mcp
An easy-to-use MCP (Model Context Protocol) server to interact with Gramps genealogy family trees. This package provides a bridge between AI assistants and your Gramps database, enabling natural language queries about your family tree.
Installation
Install the package using pip:
pip install gramps-ez-mcp
Overview
gramps-ez-mcp is an MCP server that exposes your Gramps genealogy database through a standardized protocol. It allows AI assistants and chatbots to query and explore your family tree data using natural language.
The server provides tools for:
- Searching for people by name
- Retrieving person details (birth, death, events, etc.)
- Navigating family relationships (parents, children, spouses)
- Accessing family and event information
- Querying the home person
Configuration
Setup
You will need the following:
- An API key from a model provider (such as OpenAI, Anthropic, etc)
- Gramps installed and working with a family tree (may also need
pip install gramps)
For example, you might have in your environment:
export OPENAI_API_KEY="sk-..."
Basic Configuration
The MCP server can be configured using command-line arguments or through MCP client configuration files.
Command-Line Usage
gramps-ez-mcp DBNAME [OPTIONS]
Arguments:
DBNAME: Name of the Gramps database tree to open (required)
Options:
--transport {stdio,sse}: Transport method to use (default:stdio)--host HOST: Host for SSE transport (default:localhost)--port PORT: Port for SSE transport (default:8000)
Examples:
# Use stdio transport with a database
gramps-ez-mcp "Gramps Example"
# Specify a custom database name
gramps-ez-mcp "My Family Tree"
# Use SSE transport on a custom port
gramps-ez-mcp "Gramps Example" --transport sse --port 9000
MCP Client Configuration
For use with MCP-compatible clients (like ez-mcp-chatbot, Cursor, etc), you will need a configuration file.
For example, for ez-mcp-chatbot:
Example: ez-config.json
{
"model": "openai/gpt-4o-mini",
"model_parameters": {
"temperature": 0.0
},
"mcp_servers": [
{
"name": "gramps-ez-mcp",
"description": "Gramps EZ MCP server for genealogy chats",
"command": "gramps-ez-mcp",
"args": ["Gramps Example"]
}
]
}
Replace "Gramps Example" with your actual Gramps database name.
Usage Examples
Using with ez-mcp-chatbot
The ez-mcp-chatbot is a command-line chatbot that can interact with MCP servers. Here's how to use it with gramps-ez-mcp:
-
Install ez-mcp-chatbot (if not already installed):
pip install ez-mcp-toolbox -
Create a configuration file (e.g.,
examples/ez-config.json):{ "model": "openai/gpt-4o-mini", "model_parameters": { "temperature": 0.0 }, "mcp_servers": [ { "name": "gramps-ez-mcp", "description": "Gramps EZ MCP server for genealogy chats", "command": "gramps-ez-mcp", "args": ["Gramps Example"] } ] } -
Run the chatbot:
ez-mcp-chatbot --config examples/ez-config.json -
Example queries you can ask:
- "Who is the home person in my family tree?"
- "Search for people named John Smith"
- "What is his birth date?"
- "Who are the children of John?"
- "Find the mother of Sarah Anderson"
LLM Logging, Debugging, and Observability
If you would like for the ez-mcp-chatbot to create a log of what the MCP server is doing, you can log the interactions
with the LLM by doing the following:
pip install opik
Then you can get an OPIK_API_KEY from https://www.comet.com/docs/opik/quickstart and set it:
export OPIK_API_KEY="..."
<img width="1853" height="1048" alt="image" src="https://github.com/user-attachments/assets/13063484-8544-4464-ae5a-93d750cc67ae" />
Example Conversation
You: Who is the home person in my family tree?
Assistant: I'll look up the home person for you.
[Uses get_home_person tool]
The home person is John Doe (born 1950-01-15).
You: Who are their children?
Assistant: Let me find the children of John Doe.
[Uses get_children_of_person tool]
John Doe has 2 children:
- Jane Doe (handle: abc123)
- Bob Doe (handle: def456)
Available Tools
The following tools are available through the MCP server:
Person Tools
-
get_person(person_handle: str)- Get complete data dictionary for a person by their handle
- Returns: Dictionary with all person data
-
search_people_by_name(name: str, page: int = 1, page_size: int = 10)- Search for people by name (partial match, case-insensitive)
- Supports pagination
- Returns: List of matching person dictionaries
-
get_home_person()- Get the home person data from the database
- Returns: Dictionary with home person data
Relationship Tools
-
get_father_of_person(person_handle: str)- Get the father's data for a person
- Returns: Dictionary with father's data
-
get_mother_of_person(person_handle: str)- Get the mother's data for a person
- Returns: Dictionary with mother's data
-
get_children_of_person(person_handle: str)- Get list of children handles for a person's main family
- Returns: List of child handles (strings)
Date and Place Tools
-
get_person_birth_date(person_handle: str)- Get birth date as a string
- Returns: Birth date string
-
get_person_death_date(person_handle: str)- Get death date as a string
- Returns: Death date string
-
get_person_birth_place(person_handle: str)- Get birth place as a string
- Returns: Birth place string
-
get_person_death_place(person_handle: str)- Get death place as a string
- Returns: Death place string
Family and Event Tools
-
get_family(family_handle: str)- Get family data by family handle
- Note: Family handles are different from person handles
- Returns: Dictionary with family data
-
get_person_event_list(person_handle: str)- Get list of event handles associated with a person
- Returns: List of event handles (strings)
-
get_event(event_handle: str)- Get event data by event handle
- Returns: Dictionary with event data
-
get_event_place(event_handle: str)- Get the place associated with an event
- Returns: Place string
Requirements
- Python 3.8 or higher
- Gramps (genealogy software)
- MCP-compatible client (for using the server)
Troubleshooting
Database Not Found
If you get an error that the database was not found:
- Verify the database name matches exactly (case-sensitive)
- Check that the database exists in your Gramps data directory
- Use the exact name as shown in Gramps
License
This project is licensed under the GNU General Public License version 2 (GPL-2.0). See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Links
- Homepage: https://github.com/dsblank/gramps-ez-mcp
- Repository: https://github.com/dsblank/gramps-ez-mcp
- Bug Tracker: https://github.com/dsblank/gramps-ez-mcp/issues
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。