Scientific Paper Reading Assistant
Enables local analysis of scientific papers including PDF parsing, mathematical formula extraction with AST generation, PyTorch code generation from methodology, and automated Markdown report generation with visualizations.
README
科研论文辅助阅读 MCP 系统(本地版)
本系统基于 MCP (Model Context Protocol) 构建,提供本地 PDF 解析、结构化提取、数学公式深度解析、代码生成与可视化功能。 所有计算均在本地运行,支持通过 Trae 内置大模型或本地 LLM 进行增强。
✨ 功能亮点
- � 智能摘要与方法论:
summarizer支持智能摘要与方法论提取,可自动连接本地 LLM (Ollama) 进行深度内容理解。 - 🔢 深度数学智能:
math_explainer提取公式、构建 AST(抽象语法树),并存入本地 SQLite 数据库。 - 💻 实验复现辅助:
code_generator自动从论文中提取超参数,生成 PyTorch 模型定义与训练脚本。 - 📊 可视化图表:
visualization生成 Mermaid 流程图与变量依赖图。 - 📑 智能报告生成:
report_generator自动生成 Markdown 格式的论文分析报告,包含摘要、结构、可视化图表与代码配置,并确保数学公式正确渲染。 - 🧠 知识管理:本地数据库
papers.db自动存储论文元数据、符号定义与实验记录。
🛠️ 部署与安装
前置要求
- Node.js (v16+)
- Git
- (可选) Ollama 用于本地大模型加速 (默认端口 11434)
1. 克隆仓库
git clone https://github.com/Lxy-hqu/-mcp-for-paper-read-based-on-AI-IDE.git
cd -mcp-for-paper-read-based-on-AI-IDE
2. 安装依赖
npm install
3. 编译项目
npx tsc
4. 配置 Trae (或 Cursor)
自动配置 (推荐)
本仓库包含一个 trae_mcp_config.json 模板。你需要将其中的 command 路径修改为你本地 Node.js 的绝对路径,args 修改为 server.js 的绝对路径。
Windows 用户示例配置: 打开 Trae 设置 -> MCP Servers -> Edit in settings.json:
{
"mcpServers": {
"local-papers": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": [
"E:\\path\\to\\-mcp-for-paper-read-based-on-AI-IDE\\dist\\server.js"
],
"disabled": false,
"autoApprove": []
}
}
}
💡 提示:在终端运行
where node可获取 Node.js 的安装路径。
5. 验证运行
重启 Trae 后,在 MCP 管理面板中应显示 local-papers 为 Connected 状态。
你可以尝试在对话框中输入:“请使用 pdf_loader 读取这个文件:E:\my_paper.pdf” 来测试。
� 迁移与多机部署
如果你想在另一台机器上运行此服务,有两种方式:
方式一:直接复制目录(便携式)
你可以直接将整个目录(包含 dist 和 node_modules)复制到新机器。
注意事项:
- Node.js 环境:新机器必须安装 Node.js。
- 操作系统一致性:如果你从 Windows 复制到 macOS/Linux,可能会因为
better-sqlite3等原生依赖不兼容而报错。此时需要在新机器运行npm rebuild或删除node_modules重新npm install。 - 路径配置:在 Trae 的
settings.json中,必须修改command(Node 路径) 和args(server.js 路径) 为新机器上的实际绝对路径。
方式二:重新克隆(推荐)
在每台新机器上重新执行 git clone、npm install 和 npx tsc。这是最稳健的方法,能确保所有依赖与当前系统完美兼容。
⚠️ 关于数据隐私:
papers.db文件存储了已解析的论文数据。直接复制目录会带走此数据库。如果在新机器上需要干净的环境,请删除papers.db文件。
�📝 使用指南
数学公式解析
"解析这篇论文的数学公式,并将符号定义存入数据库。"
代码生成
"根据这篇论文的方法部分,生成 PyTorch 模型代码,并提取超参数。"
可视化
"为这篇论文的模型结构生成一个 Mermaid 流程图。"
生成分析报告
"为这篇论文生成一份完整的 Markdown 分析报告。"
📂 项目结构
src/
├── providers/ # 核心功能模块
│ ├── pdf_loader.ts # PDF 读取
│ ├── structure_parser.ts # 结构化切分
│ ├── math_explainer.ts # 数学解析 & AST
│ ├── code_generator.ts # 代码 & Config 生成
│ ├── visualization.ts # Mermaid 图表生成
│ ├── report_generator.ts # 报告生成
│ └── summarizer.ts # 智能摘要与方法论
├── database.ts # SQLite 数据库管理
├── llm_client.ts # 本地 LLM 连接客户端
├── server.ts # MCP 服务器入口
└── types.d.ts # 类型定义
📄 License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.