家谱MCP服务器
An MCP (Model Context Protocol) server for generating family pedigree tree diagrams as PNG images using standard genetic notation per Bennett 2008/2022 NSGC guidelines.
BRCA1 hereditary breast/ovarian cancer family history demonstrating: 3 generations, affected individuals with combined conditions, MZ identical twins, carrier status, deceased indicators, proband + consultand markers, and gene test results (BRCA1+/BRCA1-)
安装
添加到您的MCP客户端配置中(例如,Claude Desktop):
{
"mcpServers": {
"pedigree": {
"command": "npx",
"args": ["pedigree-mcp"],
"env": {}
}
}
}从源代码构建
如果您更喜欢从源代码构建:
git clone https://github.com/zzgael/pedigree-mcp.git
cd pedigree-mcp
npm install
npm run build然后在MCP客户端配置中使用:
{
"mcpServers": {
"pedigree": {
"command": "node",
"args": ["/absolute/path/to/pedigree-mcp/dist/index.js"],
"env": {}
}
}
}特性
Bennett 2008标准合规性
此实施遵循 NSGC标准化人类谱系命名法:
| 符号 | 描述 | 属性 |
|---|---|---|
| 方形 | 男性 | sex: "M" |
| 圆圈 | 女性 | sex: "F" |
| 钻石 | 未知性别 | sex: "U" |
| 填充形状 | 受影响个体 | conditions: [...] |
| 对角线 | 已故 | status: 1 |
| 箭头(左下) | Proband | proband: true |
| 双箭头(左下) | 咨询台(寻求咨询的人) | consultand: true |
| 括号\[\] | 已采用 | noparents: true |
| 双线 | 血缘关系 | 自动检测到共享祖先 |
| 双线文字 | 血缘关系 | consanguinity_degree: "1st cousins" |
| 横杆 | MZ(同卵)双胞胎 | mztwin: "group_id" |
| 对角线 | DZ(异卵)双胞胎 | dztwin: "group_id" |
| 中心点 | 承运商状态 | carrier: true |
| 轮廓点 | 斜载体(推断) | obligate_carrier: true |
| 内部符号“P” | 怀孕 | pregnant: true |
| “P”+周标签 | 妊娠期 | pregnant: true, terminated_age: 12 |
| 小三角 | 早期流产(\; |
// Genetic tests (pattern: {gene}_gene_test) brca1_gene_test?: { type: "-"|"S"|"T", result: "-"|"P"|"N" }; brca2_gene_test?: { type: "-"|"S"|"T", result: "-"|"P"|"N" }; // ... any gene test }
## 例子
**📸 [查看全部21个场景示例→](EXAMPLES.md)**
查看展示Bennett 2008/2022合规性的标准化谱系场景的完整图库,包括性别多样性、双胞胎、血缘关系、ART指标和复杂的多代家庭。
### 基本三代谱系
[ {"name": "MGF", "sex": "M", "top_level": true}, {"name": "MGM", "sex": "F", "top_level": true, "conditions": [{"name": "Breast cancer", "age": 55}]}, {"name": "Mother", "sex": "F", "mother": "MGM", "father": "MGF", "conditions": [{"name": "Breast cancer", "age": 42}]}, {"name": "Father", "sex": "M", "top_level": true}, {"name": "Proband", "display_name": "Sarah", "sex": "F", "mother": "Mother", "father": "Father", "proband": true, "age": 25, "brca1_gene_test": {"type": "T", "result": "P"}} ]
### 神经系统疾病谱系
[ {"name": "GF", "sex": "M", "top_level": true, "status": 1, "conditions": [{"name": "Huntington's disease", "age": 52}]}, {"name": "GM", "sex": "F", "top_level": true}, {"name": "Father", "sex": "M", "mother": "GM", "father": "GF", "conditions": [{"name": "Huntington's disease", "age": 48}]}, {"name": "Mother", "sex": "F", "top_level": true}, {"name": "Proband", "sex": "M", "mother": "Mother", "father": "Father", "proband": true, "age": 25, "carrier": true} ]
### 双胞胎示例
[ {"name": "Dad", "sex": "M", "top_level": true}, {"name": "Mom", "sex": "F", "top_level": true}, {"name": "Twin1", "sex": "M", "mother": "Mom", "father": "Dad", "mztwin": "mz1"}, {"name": "Twin2", "sex": "M", "mother": "Mom", "father": "Dad", "mztwin": "mz1"}, {"name": "DZTwin1", "sex": "M", "mother": "Mom", "father": "Dad", "dztwin": "dz1"}, {"name": "DZTwin2", "sex": "F", "mother": "Mom", "father": "Dad", "dztwin": "dz1"} ]
### 具有贝内特特色的复杂家庭
[ {"name": "GF", "sex": "M", "top_level": true, "status": 1}, {"name": "GM", "sex": "F", "top_level": true, "carrier": true}, {"name": "Father", "sex": "M", "mother": "GM", "father": "GF", "divorced": true}, {"name": "Mother", "sex": "F", "top_level": true}, {"name": "Child1", "sex": "F", "mother": "Mother", "father": "Father", "proband": true, "noparents": true}, {"name": "Loss", "sex": "U", "mother": "Mother", "father": "Father", "terminated": true} ]
## 发展
Install dependencies
npm install
Run in development mode (watch)
npm run dev
Run all tests
npm test
Build for production
npm run build
Type check
npx tsc --noEmit
## 测试
- **总共159次测试** 涵盖:
- 验证(父母推荐信、性别限制)
- SVG渲染(所有符号类型、指示器)
- 条件标记和多条件饼图
- 基因检测格式
- 双渲染(MZ带条形,DZ不带条形)
- 血缘关系检测
- Bennett 2008合规性(携带者、怀孕、终止妊娠、离婚)
- 边缘病例(家族深厚、世代广泛、同父异母兄弟姐妹)
## 参考文献
- [Bennett等人,2008年-标准化人类谱系命名法](https://pubmed.ncbi.nlm.nih.gov/18792771/)
- [Bennett等人,2022年-性别和性别包容性更新](https://pubmed.ncbi.nlm.nih.gov/36106433/)
- [爱荷华州人类遗传学-如何绘制家谱](https://humangenetics.medicine.uiowa.edu/resources/how-draw-pedigree)
## 许可证
MIT许可证-请参阅 [许可证](LICENSE)