Skip to main content
Glama
FlynnLachendro

methods-mcp

methods-mcp

PyPI Python License: MIT

轻量级、按需调用的 MCP 服务器,用于学术论文的结构化方法提取可复现性启发式评估。为 Worldwide AI Science Fellowship 构建挑战而开发。

⚠️ 状态:alpha(0.1.x)。 工具表面和输出格式可能在小版本之间发生变化。生产环境中请锁定精确版本。 欢迎通过 GitHub Issues 提交错误报告。

快速演示

$ uvx --from methods-mcp methods-mcp --version
methods-mcp 0.1.6

# In a Claude Code session:
> /mcp add methods-mcp methods-mcp
> Run methods_repro_review on https://arxiv.org/abs/2509.06917

  → tool: methods_repro_review({"input_str":"https://arxiv.org/abs/2509.06917"})

# Returns a MethodsReproReview object. Read `narrative` first — it explains
# everything else in plain English, so no tool-learning is required:

{
  "status": "ok",
  "narrative":
    "Resolved the paper: 'Paper2Agent' by Miao et al. (arxiv 2509.06917, "
    "2025-09-08). Extracted 11 methods steps at moderate self-reported "
    "confidence (0.72) — the procedure is clearly described but hyperparameters "
    "and software versions are absent. Detected the associated code repository "
    "https://github.com/jmiao24/Paper2Agent from an inline link in the paper "
    "text (detection confidence 0.94). The repo scored 0.90/1.00 on the "
    "reproducibility heuristic — verdict: likely reproducible. Present signals: "
    "substantive README, dependencies file, notebooks, figure-plotting script, "
    "recent activity, permissive license. Missing: data/fixtures directory. "
    "Suggested entrypoint: `python make_figures.py`.",
  "metadata":          { ... },   # PaperMetadata
  "methods":           { ... },   # MethodsStructured (null if extraction failed)
  "code_repo":         { ... },   # CodeRepo           (null only if input unresolvable)
  "repro_assessment":  { ... },   # ReproAssessment   (null if no repo detected)
  "errors":            []         # [{step, error_type, message, hint}] on partial
}

methods-mcp 是一个小巧、边界清晰的 Model Context Protocol 服务器。它为任何 AI 代理(Claude Code、Claude Desktop、你的 Agent SDK 脚本等)提供八个工具,可将学术论文 URL 转换为:

  • 规范化元数据,

  • 尽力而为的全文 + 章节拆分,

  • 一个经 Pydantic 验证的结构化方法对象(步骤 / 试剂 / 设备 / 分析),

  • 论文关联的代码仓库(尽力而为的发现),

  • 针对该仓库的无需执行的可复现性判定,以及

  • 多模式摘要。

切入点:像 Paper2Agent(斯坦福)这样的重型流水线需要 30 分钟到数小时才能将论文消化为代理可用的工具。methods-mcp代理可调用、按需执行的补充方案——每个工具都在数秒内返回结果,无需克隆、无需执行。


Related MCP server: paperstack

安装

uv add methods-mcp
# or, install globally:
uv tool install methods-mcp
# or, classic pip:
pip install methods-mcp

API 密钥

为获得最佳性能,请同时设置以下两项:

变量

是否必需

不设置时的后果

ANTHROPIC_API_KEY

extract_methodssummarize_papermethods_repro_review 必需

这些工具会抛出 RuntimeError: ANTHROPIC_API_KEY not set。非 LLM 工具(fetch_paper_textfind_code_repoassess_repo_reproducibility)仍可正常工作。

GITHUB_TOKEN

assess_repo_reproducibility / methods_repro_review 可选但推荐

你会受限于 GitHub 未认证速率限制(每 IP 60 次请求/小时)。每次仓库评估约需 3 次调用,因此约 15–20 个仓库/小时后就会触顶。使用令牌后:5,000 次请求/小时(实际上无限制)。

export ANTHROPIC_API_KEY=sk-ant-...
export GITHUB_TOKEN=ghp_...          # optional but recommended

两个密钥均不会被记录或持久化——它们仅分别发送至 api.anthropic.comapi.github.com。参见 SECURITY.md

从 Claude Code 使用

/mcp add methods-mcp methods-mcp

然后在任意 Claude Code 对话中:

获取 https://arxiv.org/abs/2509.06917 并运行 methods_repro_review。总结该论文的内容、方法步骤,以及仓库的可复现性表现。

从 Claude Agent SDK 使用

from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient

options = ClaudeAgentOptions(
    mcp_servers={
        "methods-mcp": {
            "type": "stdio",
            "command": "methods-mcp",
            "args": [],
        }
    },
    allowed_tools=["mcp__methods-mcp__methods_repro_review"],
)

async with ClaudeSDKClient(options=options) as client:
    await client.query(
        "Run methods_repro_review on https://arxiv.org/abs/2509.06917 "
        "and tell me whether the repo looks reproducible."
    )
    async for msg in client.receive_response():
        print(msg)

工具

工具

功能说明

health

服务器存活 + 配置检查。

get_paper_metadata(input_str)

将 URL / arXiv ID / DOI 解析为规范化元数据。arXiv 输入会调用 arXiv 导出 API 获取标题/作者/摘要。

fetch_paper_text(input_str, prefer="auto"|"html"|"pdf")

全文 + 章节拆分。arXiv 论文默认使用 ar5iv HTML(廉价、结构化),否则回退到 PDF。

extract_methods(input_str, model=None)

由 LLM 驱动、经 Pydantic 验证的结构化方法提取。返回 {steps, reagents, equipment, analyses, confidence}

find_code_repo(input_str)

通过论文文本 → 摘要 → Papers With Code 发现论文的代码仓库。

assess_repo_reproducibility(repo_url, paper_id=None)

基于启发式规则、无需克隆的可复现性评估,通过 GitHub REST API 完成。加权信号(README、依赖、测试数据、笔记本、图表脚本、近期维护、许可证)→ {verdict, score, recommended_entrypoint}

summarize_paper(input_str, mode="tldr"|"abstract"|"exec")

三种深度的 LLM 摘要。

methods_repro_review(input_str)

复合工具——一次调用完成元数据 + 方法 + 仓库 + 可复现性评估。

所有工具均返回 Pydantic v2 模型(已验证、可 JSON 序列化)。完整的类型定义参见 src/methods_mcp/schemas.py

设计说明

  • extract_methods 使用 Anthropic 工具调用机制,强制模型输出符合 MethodsStructured Pydantic 模式的实例。 验证失败时,我们会发送一条包含验证错误的修复消息并重试一次,之后才抛出异常。

  • assess_repo_reproducibility 不会克隆或执行任何内容。 它仅根据公开可读的 GitHub 元数据和递归树列表对仓库进行评分。这是与试图实际重跑论文的批处理工具之间的刻意区隔。

  • fetch_paper_text 对 arXiv 论文优先使用 ar5iv HTML 而非 PDF 解析。 对非 arXiv 输入回退到 pypdf

  • 默认模型为 claude-sonnet-4-6 可通过 METHODS_MCP_MODEL 环境变量或每次调用的 model= 参数覆盖。

  • methods_repro_review 返回自描述式响应。 每次调用都会设置顶层 status"ok" / "partial" / "empty")和 narrative 字符串,以通俗英语总结所有检索到的内容——包括每个带上下文的数值评分。只阅读 narrative + status 的读者即可获得完整图景,无需了解子对象的格式。子对象在不可用时可为 null(例如,未检测到仓库的论文返回 repro_assessment: null——status 仍为 "ok",因为"无仓库"并非失败)。失败的子步骤会向 errors 贡献一条结构化条目,包含 {step, error_type, message, hint},其中 hint 是针对已识别模式(缺少 API 密钥、速率限制、404、超时等)的可操作通俗建议,否则为 null

评分与判定说明

工具输出包含三个数值字段,它们看起来相似但含义截然不同。它们是供代理判断论文是否值得深入研究的分类信号,而非经过校准的正确性声明。

字段

范围

计算方式

如何解读

methods.confidence

0–1

LLM 自我报告。 提取模型根据系统提示中的指令自行设定:仅当论文给出明确的试剂/体积/设备时设为 ≥0.8,方法部分稀疏时约为 ~0.3。未经校准。

作为*"这是一篇具有具体流程的湿实验论文,还是一篇内容稀疏的系统论文?"*的软信号。可作为标记使用;不要将其视为可信度百分比。

code_repo.confidence

0–1

detection_method 而异。 papers-with-code:固定 0.95(权威的论文→仓库 API)。paper-text:按 0.6 + 0.2·(strong-phrase-present) + 0.015·score_margin 计算,上限 0.95abstract-link:固定 0.85none0.0

告诉你仓库是如何被发现的以及发现的确定性如何。高分 + paper-text 意味着类似*"代码可在……获取"*的强短语紧邻 URL 出现。

repro_assessment.overall_score

0–1

8 个二值信号的加权和,全部通过 GitHub REST API 计算(不克隆、不执行):has_readme(0.10)、readme_substantial(0.15)、has_dependencies_file(0.20)、has_data_or_fixtures(0.10)、has_notebook(0.10)、has_figure_script(0.20)、actively_maintained(0.10)、permissive_license(0.05)。每个存在的信号贡献其对应权重。

三个分数中唯一完全确定性的分数。仍然是启发式而非证明——高分意味着仓库看起来结构良好、适合复现。如需实际验证,参见 Paper2Agent

判定分桶repro_assessment.verdict)是 overall_score 上的阈值:

Verdict

Score

Meaning

likely-reproducible

≥ 0.70

存在大多数利于复现的信号。值得尝试运行。

partial

≥ 0.45

有一些基础设施,但可能存在缺口。需要自行补齐缺失部分。

unlikely

≥ 0.20

信号极少。可能是没有配套脚手架、无法重新运行的代码转储。

insufficient-info

< 0.20 or repo unreachable

信息不足,无法判断。不要妄下结论。

你在输出中会看到的枚举值:

  • code_repo.detection_method: paper-text | abstract-link | papers-with-code | metadata | none

  • metadata.source: arxiv | biorxiv | doi | url | unknown

安全与限制

安装并运行此服务器时,它实际会做的事情:

  • 仅向以下地址发起网络调用export.arxiv.orgar5iv.labs.arxiv.orgarxiv.org(PDF)、api.github.compaperswithcode.comapi.anthropic.com。无遥测、无分析、无回传。

  • 读取 ANTHROPIC_API_KEY(LLM 工具必需)以及可选的 GITHUB_TOKEN(从环境变量中读取)。这些仅分别发送给 Anthropic / GitHub。从不记录,从不写入磁盘。

  • 不会向你的文件系统写入任何内容。无缓存目录、无下载的 PDF、无临时文件。

  • 不执行任何用户提供的代码。无 evalexecsubprocesspickle.loads 或 shell 调用。可复现性工具刻意克隆或运行仓库——它仅通过 GitHub REST API 进行评分。

需要注意的限制:

  • 对抗性论文可能产生误导性的结构化输出。 extract_methods 工具会将论文文本发送给 Claude。包含提示注入内容的论文可能产生错误(但符合模式)的结构化方法。请将输出视为研究辅助工具,而非事实依据。

  • 可复现性判定是一种启发式方法,而非证明。 高分意味着仓库看起来结构良好、便于复现;但并不保证运行代码就能复现论文。如需完整验证,请参阅 Paper2Agent

  • 面向本地 stdio 使用。 HTTP/SSE 传输方式仅为开发便利而提供,只应在受信任的网络上暴露(除 httpx 提供的保护外,没有额外的 SSRF 防护)。

报告问题:

安全问题:请发送邮件至 flynnlachendro@hotmail.co.uk(另请参阅 SECURITY.md)。功能缺陷:请提交 GitHub issue

paper-mcp 搭配使用

如需更广泛的论文搜索 / 引文图谱工具,可在同一个 Claude Code 会话中并排运行 paper-mcp (Bhvaik)paper-mcp 提供按标题搜索、全文获取、引文和参考文献功能;methods-mcp 在此基础上增加了结构化方法 + 可复现性层。两者在设计上刻意追求可组合性。

本地开发

git clone https://github.com/FlynnLachendro/methods-mcp
cd methods-mcp
uv sync --extra dev --extra agent

uv run pytest                      # 49 tests, offline (respx-mocked httpx + unittest.mock for Anthropic)
uv run ruff format .
uv run ruff check . --fix
uv run mypy src

uv run methods-mcp --help

许可证

MIT — 请参阅 LICENSE

致谢

Worldwide AI Science Fellowship 首届学员而构建。感谢 Michael Raspuzzi 提供的开放式任务简报。

基于以下项目构建:

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
8Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables discovery and analysis of research ecosystems by extracting metadata from paper URLs, GitHub repositories, and research names. Automatically finds related papers, code repositories, models, datasets, and authors across platforms like arXiv, HuggingFace, and GitHub.
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables arXiv paper search, PDF download, text extraction, and context chunking for LLM pipelines, along with advanced features like citation graphs and reproducibility scoring.
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to search and analyze academic papers from multiple sources, fetch metadata and full text, and build structured outputs like literature maps and paper comparisons.
    21
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables agents to search papers across Semantic Scholar and arXiv, read and extract text from arXiv PDFs, align records across sources, and produce structured literature-analysis digests.
    10
    1

View all related MCP servers

Related MCP Connectors

  • Reliable PDF table extraction. Pass a URL, get structured JSON tables with citations.

  • Web scraping for AI agents. Converts URLs to clean, LLM-ready Markdown with anti-bot bypass.

  • Turns any URL into SEO metadata, contacts, tech stack, and AI-ready Markdown, in one call.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/FlynnLachendro/methods-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server