本项目由AI智能体驱动,专为AI智能体提供强大的家谱数据处理能力。它是一个功能强大的MCP服务器,可用于从GEDCOM文件中创建、编辑和查询家谱数据,并且能与qwen-cli和gemini-cli完美配合。
该项目为AI智能体提供了一套全面的工具,用于处理家族历史数据,支持复杂的家谱研究、数据分析以及自动文档生成。
最近,该服务器进行了一系列改进,修复了关键漏洞,增强了错误处理能力,提升了代码质量,同时保持了完全的向后兼容性。
以下是一些复杂示例指令:
Load gedcom "myfamily.ged"
Make a complete, detailled biography of and his fammily. Use as much as you can from this genealogy, including any notes from him or his relatives.
You can try to find some info on Internet to complete the document, add some historical or geographic context, etc. Be as complete as possible to tell us a nice story, easy to read by everyone
或者
Create a new GEDCOM file - save it to "napo.ged"
Fetch the content of Napoleon I's Wikipedia page
1. Extract genealogical information about him and people mentioned on his page
2. Follow links to other people's Wikipedia pages to gather more information
3. Create a comprehensive genealogical record with as much details as possible. Including birth/death dates and place, family relationships (parents, spouses, children...), occupation, etc, and including a note with the person wikipedia page address and important info about his life
4. Repeat the same process with all people added by previous steps
Continuously save the GEDCOM file as new people are added
或者
Load gedcom "myfamily.ged"
What's shortest path from John Doe to Bob Smith ?
And who are their common ancestors ?
git clone https://github.com/airy10/GedcomMCP.git
cd GedcomMCP
pip install -r requirements.txt
使用默认的HTTP传输启动服务器:
python src/gedcom_mcp/fastmcp_server.py
使用标准输入输出(stdio)传输启动服务器:
python src/gedcom_mcp/fastmcp_server.py --transport stdio
指定HTTP传输的不同主机或端口:
python src/gedcom_mcp/fastmcp_server.py --host 0.0.0.0 --port 8080
运行所有测试:
python -m pytest tests/
运行带有详细输出的测试:
python -m pytest tests/ -v
运行特定的测试文件:
python -m pytest tests/test_gedcom_data_access.py
运行特定的测试:
python -m pytest tests/test_gedcom_data_access.py::TestGedcomDataAccess::test_load_gedcom_file
src/gedcom_mcp/:主要源代码
fastmcp_server.py:主服务器应用程序和工具定义gedcom_context.py:GEDCOM解析上下文和缓存管理gedcom_data_access.py:数据检索和提取函数gedcom_data_management.py:数据修改和管理函数gedcom_analysis.py:统计分析和报告函数gedcom_search.py:关系查找和路径分析gedcom_utils.py:数据处理实用函数gedcom_constants.py:GEDCOM事件和属性定义gedcom_date_utils.py:高级日期解析和验证gedcom_name_utils.py:姓名解析和规范化gedcom_place_utils.py:地名规范化和地理层次结构gedcom_models.py:数据模型和结构tests/:全面的单元和集成测试requirements.txt:项目依赖pyproject.toml:构建配置prompts/:用于大语言模型(LLM)提示生成的模板文件本项目进行了重大改进,包括:
本项目采用MIT许可证。