元分析MCP服务

一个遵循Cochrane方法标准的AI辅助元分析工作流MCP服务器,提供数据导入、验证、统计分析和报告生成功能。

  • by matheus-rech
  • R
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 matheus-rech/meta-mcp

使用说明

Cochrane Meta分析MCP服务器

MCP(模型上下文协议)服务器,提供遵循Cochrane方法标准的人工智能辅助荟萃分析工作流程。

特性

  • RevMan导入:解析RevMan 5(.rm5 XML)和Cochrane CSV导出
  • 数据验证:根据Cochrane标准进行全面验证
  • Meta分析:使用元或元包进行基于R的统计分析
  • 森林图:可发布的可视化
  • 发表性偏倚:漏斗图、艾格试验、修剪和填充
  • 报告:自动化的Cochrane风格HTML/PDF报告

安装

npm install
npm run build

先决条件

  1. Node.js 18+
  2. R 4.0+含套餐:
    • 隐喻
    • 元
    • ggplot2
    • Jsonlite

安装R软件包:

install.packages(c("metafor", "meta", "ggplot2", "jsonlite"))

配置

添加到Claude桌面配置(~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "cochrane-meta": {
      "command": "node",
      "args": ["/Users/YOUR_USERNAME/Documents/cochrane-meta-mcp/dist/index.js"]
    }
  }
}

可用工具

1.导入数据

导入并解析RevMan 5文件或Cochrane CSV导出。

{
  "file_path": "/path/to/review.rm5",
  "format": "rm5"
}

2.验证_ cochrane_data

根据Cochrane标准验证研究数据。

{
  "data": { ... },
  "validation_level": "comprehensive"
}

3.性能元分析

根据Cochrane手册第10章进行荟萃分析。

{
  "data": { ... },
  "effect_measure": "OR",
  "model": "random",
  "heterogeneity_test": true
}

4.生成_森林_地块

创建可发布的森林地块。

{
  "analysis_results": { ... },
  "plot_style": "classic",
  "output_path": "/path/to/forest_plot.png"
}

5.评估公告

进行发表偏倚评估。

{
  "analysis_results": { ... },
  "methods": ["funnel_plot", "egger_test", "trim_fill"],
  "output_path": "/path/to/funnel_plot.png"
}

6.发电机报告

生成全面的Cochrane风格报告。

{
  "analysis_results": { ... },
  "format": "html",
  "output_path": "/path/to/report.html"
}

Claude使用示例

User: I have a Cochrane CSV file with 10 RCTs comparing intervention A vs control.
      Can you help me run a meta-analysis?

Claude: I'll help you analyze this. First, let me import the data using the import_revman_data tool...

[Uses import_revman_data]

Claude: Great! I've imported 10 studies. Let me validate the data...

[Uses validate_cochrane_data]

Claude: Validation passed with 2 warnings about small sample sizes.
        Now I'll perform the meta-analysis using a random-effects model
        with odds ratios as the effect measure...

[Uses perform_meta_analysis]

Claude: The pooled OR is 0.75 (95% CI: 0.62-0.91), p=0.003, with moderate
        heterogeneity (I²=45%). Let me generate a forest plot...

[Uses generate_forest_plot]

Claude: Forest plot created. Now checking for publication bias...

[Uses assess_publication_bias]

Claude: Egger's test p=0.42, no evidence of publication bias.
        Generating final report...

[Uses generate_cochrane_report]

Claude: Complete! Your meta-analysis report is ready at report.html

CSV格式

对于CSV导入,请使用以下格式:

study_id,authors,year,title,intervention,comparison,outcome,events_treatment,n_treatment,events_control,n_control
Study1,Smith 2020,2020,RCT of intervention,Drug A,Placebo,Mortality,10,100,20,100
Study2,Jones 2021,2021,Another RCT,Drug A,Placebo,Mortality,15,150,30,150

对于持续的结果:

study_id,authors,year,title,intervention,comparison,outcome,mean_treatment,sd_treatment,n_treatment,mean_control,sd_control,n_control

发展

# Watch mode
npm run dev

# Build
npm run build

# Test (coming soon)
npm test

建筑

  • TypeScript MCP服务器:处理Claude的工具请求
  • R桥:通过Rscript执行统计分析
  • 验证层:用于数据验证的Zod模式
  • 工具:每个MCP功能的模块化工具实现

与现有工具集成

此MCP服务器与您现有的元分析基础架构集成:

  • 使用你的R元分析脚本(~/meta_analysis_workflow.R)
  • 与医学研究多智能体系统兼容
  • 可以利用AI引文处理器进行文献提取

Cochrane依从性

跟随:

  • Cochrane系统评价手册(第10章)
  • PRISMA报告指南
  • Cochrane偏倚风险(RoB 2)建议
  • GRADE证据确定性框架

许可证

麻省理工学院

版本

0.1.0

作者

Matheus Rech