Gedcommcp

Gedcommcp

🚀 GEDCOM MCP Server

本项目由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 ?

✨ 主要特性

  • 数据管理:加载和解析GEDCOM文件,添加/编辑人物、家庭、事件和地点。
  • 强大的查询功能:可以根据灵活的条件在人物、家庭、事件和地点中进行搜索。
  • 关系分析:查找个人之间的关系、共同祖先和家庭联系。
  • 家谱生成:生成包含详细信息的多代祖先和后代家谱。
  • 时间线生成:创建按时间顺序排列的生活事件时间线。
  • 数据分析:通过全面的统计、重复检测和姓氏分析来分析家谱数据。
  • 历史背景关联:提取日期范围和历史时期信息。
  • 元数据处理:对备注、来源和详细事件信息提供丰富的支持。
  • 数据验证:验证日期一致性和数据完整性。
  • 批量操作:具备高效的批量处理能力。

📦 安装指南

  1. 克隆仓库:
git clone https://github.com/airy10/GedcomMCP.git
cd GedcomMCP
  1. 安装所需依赖:
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)提示生成的模板文件

近期改进

本项目进行了重大改进,包括:

  • 修复了备注处理和属性处理中的关键漏洞。
  • 解决了语法错误,提高了代码质量。
  • 增强了错误处理能力,提供更好的错误信息。
  • 从生产代码中移除了调试语句。
  • 提高了文档的一致性。
  • 保持了完全的向后兼容性。
  • 所有99个自动化测试均通过。

贡献代码

  1. 分叉(Fork)仓库。
  2. 为你的功能或错误修复创建一个新分支。
  3. 进行更改并使用描述性消息提交。
  4. 将更改推送到你的分叉仓库。
  5. 向主仓库创建拉取请求。

📄 许可证

本项目采用MIT许可证。

  • 0 关注
  • 0 收藏,28 浏览
  • system 提出于 2025-10-02 08:18

相似服务问题

相关AI产品