科學 AI 與代理工具
Paper2Agent Compiles Research Code into Tested MCP Tools, Successfully Converting 74 of 100 Biomedical Papers
Published in Nature, Paper2Agent parses papers, code, and tutorials to automatically build MCP servers containing tools, resources, and workflow prompts, then uses executable tests to eliminate failed functions. It makes research methods easier for agents to reuse than simply providing PDFs or source code, although its success rate remains constrained by missing data, dependency environments, and the quality of the original tutorials.

Paper2Agent treats scientific papers as agent interfaces that can be compiled, rather than merely as text for models to retrieve. A central orchestration agent first locates the software repositories and data associated with a paper and sets up an execution environment. Specialized subagents then extract generalizable functions and generate MCP tools, static resources, and workflow prompts. A testing agent creates numerical, file, and image validations based on the original tutorials, repeatedly executing, diagnosing, and repairing the generated functions. Each function receives up to six attempts; if it still fails, its MCP decorator is removed so that it is not exposed externally. This allows downstream agents to invoke research methods with typed interfaces and test records instead of reading a README and improvising code on the fly.
The team conducted end-to-end tests on 100 computational biology papers that had not been preselected for documentation quality. Paper2Agent successfully converted 74 of them, and 593 of the 599 candidate tools it generated passed automated validation. On a benchmark of 300 tutorial-derived questions from these papers, Sonnet 4 with Paper2Agent achieved 91.2% accuracy, compared with 80.3% when the same model was given direct access to the papers and repositories, and 86.3% when the newer Sonnet 4.6 operated directly on the repositories. Across 42 execution tasks drawn from ten papers outside biology, the average accuracy over five independent runs was 98.1%, suggesting that the approach is not entirely limited to single-cell or genomics tools.
The real technical shift is the conversion of code accompanying publications into standardized interfaces that are discoverable, remotely deployable, and composable by other agents. The research team has also released the code and example servers for AlphaGenome, Scanpy, and TISSUE. However, 26% of the papers still failed because they lacked executable code, data, model files, or a workable dependency environment. Passing tutorial-derived tests proves only that predefined outputs can be reproduced; it does not establish that a method is correct or suitable for new data. The main pipeline uses Claude Code and specific Sonnet versions, while cross-model compatibility, isolation of malicious repositories, credential management, and long-term environment maintenance remain engineering boundaries that must be addressed before practical adoption.