Token导航 LogoToken导航TokenDH.com
MCP Research Agent logo
运维云端未说明官方级别未说明来源级核验

MCP Research Agent

MCP Server

一个集成了后端API和React前端的模型上下文协议(MCP)服务器,用于研究论文的处理、总结和分类。

工具数

2

提示词数

0

GitHub Stars

0

资源数

0
TypeScriptClaude云端部署Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

amannagarkar

提供方

amannagarkar

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

研究论文MCP试剂

一个全面的模型上下文协议(MCP)服务器,集成了后端API和React前端,用于研究论文处理、摘要和分类。

项目概述

该项目由三个主要部分组成:

  1. MCP服务器 -处理基于LLM的论文分析的模型上下文协议服务器
  2. 后端API -Express.js服务器,协调纸张处理并与MCP集成
  3. 前端用户界面 -React应用程序为论文上传和分析提供用户界面

主要特点

  • 📄 研究论文上传和处理
  • 🤖 使用多个LLM提供商进行人工智能支持的摘要和分类
  • 🔄 无缝集成MCP,实现智能决策
  • 🎨 用于论文管理和分析的现代React UI
  • 📊 实时处理与进度跟踪
  • 🔌 多提供商LLM支持(OpenAI、Claude、Deepseek、Gemini)
  • 💾 没有API密钥的开发模拟响应

建筑

┌─────────────────┐
│   Frontend UI   │  (React 18, TypeScript, Vite)
│   Port: 5173    │
└────────┬────────┘
         │ HTTP API calls
         ↓
┌─────────────────────────┐
│   Backend API Server    │  (Express, TypeScript)
│   Port: 3000            │
└────────┬────────────────┘
         │ HTTP calls
         ↓
┌─────────────────────────────┐
│   MCP Server                │  (Node.js, Model Context Protocol)
│   Port: 3001                │  - Summarization
│   - PDF Processing          │  - Categorization
│   - LLM Integration         │  - JSON Response Parsing
└─────────────────────────────┘
         │
         ↓
   LLM Provider
   (OpenAI / Claude / Deepseek / Gemini)
   or Mock Responses

项目结构

mcp-research-agent/
├── README.md                          # This file
├── ARCHITECTURE.md                    # Detailed architecture documentation
├── SETUP_GUIDE.md                     # Step-by-step setup instructions
├── .env.example                       # Example environment configuration
│
├── mcp-server/                        # MCP Server
│   ├── src/
│   │   ├── index.ts                   # Express server & routes
│   │   ├── mcp/
│   │   │   ├── llmClient.ts           # Multi-provider LLM client
│   │   │   ├── mcpController.ts       # Summarization logic
│   │   │   └── paperAnalyzer.ts       # Paper analysis utilities
│   │   └── paperProcessor.ts          # PDF processing
│   ├── dist/                          # Compiled JavaScript
│   ├── package.json
│   ├── tsconfig.json
│   └── .env                           # Environment variables (API keys)
│
├── backend/                           # Backend API
│   ├── src/
│   │   ├── index.ts                   # Express server setup
│   │   ├── routes/
│   │   │   ├── papers.ts              # Paper endpoints
│   │   │   └── analysis.ts            # Analysis endpoints
│   │   ├── services/
│   │   │   ├── mcpClient.ts           # MCP integration
│   │   │   └── paperService.ts        # Paper business logic
│   │   └── middleware/
│   │       ├── errorHandler.ts        # Error handling
│   │       └── logger.ts              # Request logging
│   ├── dist/                          # Compiled JavaScript
│   ├── package.json
│   ├── tsconfig.json
│   └── .env                           # Environment variables
│
└── frontend/                          # React Frontend
    ├── src/
    │   ├── main.tsx
    │   ├── App.tsx
    │   ├── components/
    │   │   ├── PaperUpload.tsx         # File upload component
    │   │   ├── PaperList.tsx           # Paper display
    │   │   ├── AnalysisResults.tsx     # Results view
    │   │   └── common/                 # Shared components
    │   ├── services/
    │   │   └── api.ts                  # API client
    │   ├── styles/                     # CSS modules
    │   └── types/                      # TypeScript interfaces
    ├── public/
    ├── package.json
    ├── tsconfig.json
    ├── vite.config.ts
    └── .env                            # Environment variables

先决条件

  • Node.js 18.x或更高
  • npm 8.x或更高
  • python 3.8+(用于PDF处理工具)
  • 以下之一(可选,用于真实的LLM响应):

- OpenAI API密钥 - Anthropic(Claude)API密钥 - 深度搜索API密钥 - Google Gemini API密钥

安装

1.克隆和设置项目

cd /path/to/mcp-research-agent
npm install

2.安装服务依赖关系

# MCP Server
cd mcp-server
npm install
npm run build

# Backend
cd ../backend
npm install
npm run build

# Frontend
cd ../frontend
npm install

3.配置环境变量

复制 .env.example.env 在每个服务目录中:

# MCP Server configuration
cp .env.example mcp-server/.env

# Backend configuration
cp .env.example backend/.env

# Frontend configuration
cp .env.example frontend/.env

编辑每个 .env 使用您的配置文件:

mcp服务器/.env:

MCP_PORT=3001

# Choose ONE LLM provider by uncommenting and setting its API key
# The MCP will automatically detect which provider is available

# ===== OpenAI =====
# OPENAI_API_KEY=your-key-here
# OPENAI_MODEL=gpt-3.5-turbo

# ===== Claude (Anthropic) =====
# ANTHROPIC_API_KEY=your-key-here
# CLAUDE_MODEL=claude-3-5-sonnet-20241022

# ===== Deepseek =====
# DEEPSEEK_API_KEY=your-key-here
# DEEPSEEK_MODEL=deepseek-chat

# ===== Gemini =====
# GEMINI_API_KEY=your-key-here
# GEMINI_MODEL=gemini-pro

后端/.env:

PORT=3000
MCP_URL=http://localhost:3001
DATABASE_URL=postgresql://user:password@localhost:5432/research_papers
NODE_ENV=development

前端/.env:

VITE_API_URL=http://localhost:3000/api

运行服务

选项1:在一个命令中运行所有服务

# From the project root
npm start

这将与正确的日志记录并行启动所有三个服务。

选项2:在单独的终端中运行每个服务

终端1-MCP服务器:

cd mcp-server
npm start
# Output: MCP Server listening on port 3001

终端2-后端API:

cd backend
npm start
# Output: Backend Server running on port 3000

3号航站楼-前端:

cd frontend
npm run dev
# Output: Local: http://localhost:5173

选项3:使用Docker运行

# Build Docker images
docker-compose build

# Start all services
docker-compose up

# In separate terminal for logs
docker-compose logs -f

API终点

MCP服务器(端口3001)

端点方法描述
/mcp/infoGET获取MCP服务器信息和可用的LLM提供程序
/mcp/summarizePOST总结和分类论文文本
/mcp/analyzePOST在纸上进行详细分析

POST/mcp/总结

curl -X POST http://localhost:3001/mcp/summarize \
  -H "Content-Type: application/json" \
  -d '{
    "fullText": "Research paper content here...",
    "title": "Paper Title"
  }'

答复:

{
  "title": "Paper Title",
  "summary": "Concise summary of the paper...",
  "categories": ["Machine Learning", "NLP"],
  "confidence": 0.95
}

后端API(端口3000)

端点方法描述
/api/papersGET列出所有论文
/api/papersPOST上传新论文
/api/papers/:id获取获取论文详细信息
/api/papers/:id/analyzePOST纸质触发器分析
/api/analysis/:idGET获取分析结果

前端(端口5173)

  • 上传页面:上传PDF格式的研究论文
  • 论文列表:查看所有上传的论文
  • 分析视图:参见总结和分类结果
  • 实时状态:监控处理进度

开发工作流程

建筑

# MCP Server
cd mcp-server && npm run build

# Backend
cd backend && npm run build

# Frontend
cd frontend && npm run build

测试

# MCP Server tests
cd mcp-server && npm test

# Backend tests
cd backend && npm test

# Frontend tests
cd frontend && npm run test

观看模式(用于开发)

# MCP Server - auto-rebuild on changes
cd mcp-server && npm run dev

# Backend - auto-rebuild and restart
cd backend && npm run dev

# Frontend - hot module replacement
cd frontend && npm run dev

LLM提供程序配置

使用模拟响应(不需要API密钥)

默认情况下,如果没有配置LLM API键,系统将使用模拟响应。这非常适合开发和测试。

使用真正的LLM提供者

系统会自动检测并使用此优先级中的第一个配置的提供程序:

  1. 克劳德(人类学) -可用免费积分:https://console.anthropic.com
  2. 深度求索 -非常便宜(每100万代币约0.14美元):https://platform.deepseek.com
  3. 双子座(谷歌) -免费套餐:https://aistudio.google.com
  4. 开放人工智能 -仅支付:https://platform.openai.com

要启用提供程序,请执行以下操作:

  1. 从提供程序获取API密钥
  2. 将其添加到您的 mcp-server/.env 文件
  3. 重新启动MCP服务器

示例(使用Gemini):

GEMINI_API_KEY=AIzaSyB-xxxxxxxxxxxxx
GEMINI_MODEL=gemini-pro

故障排除

端口已在使用中

# Kill process on port 3001
lsof -ti:3001 | xargs kill -9

# Kill process on port 3000
lsof -ti:3000 | xargs kill -9

# Kill process on port 5173
lsof -ti:5173 | xargs kill -9

CORS错误

确保后端正在运行,并且前端中的VITE_API_URL与后端端口(3000)匹配。

LLM API错误

  • 检查 .env 文件具有有效的API密钥格式
  • 验证API密钥是否具有足够的信用/权限
  • 检查与LLM提供程序的网络连接
  • 查看日志中的特定错误消息

构建错误

# Clean build
rm -rf dist
npm run build

# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
npm run build

环境变量引用

MCP服务器

  • MCP_PORT -服务器端口(默认:3001)
  • OPENAI_API_KEY -OpenAI API密钥
  • OPENAI_MODEL -OpenAI模型名称
  • ANTHROPIC_API_KEY -API密钥
  • CLAUDE_MODEL -克劳德型号名称
  • DEEPSEEK_API_KEY -深度搜索API密钥
  • DEEPSEEK_MODEL -Deepseek模型名称
  • GEMINI_API_KEY -Google Gemini API密钥
  • GEMINI_MODEL -Gemini型号名称

后端

  • PORT -服务器端口(默认值:3000)
  • MCP_URL -MCP服务器URL
  • DATABASE_URL -PostgreSQL连接字符串
  • NODE_ENV -环境(开发/生产)

前端

  • VITE_API_URL -后端API基本URL

性能优化

  • 模拟响应:用于快速开发(即时响应)
  • 双子座免费套餐:适合用真正的LLM进行测试
  • 缓存:后端缓存摘要结果
  • 延迟加载:前端延迟加载纸张列表

贡献

  1. 创建要素分支
  2. 做出改变
  3. 运行测试和构建
  4. 提交拉取请求

许可证

麻省理工学院

支持

有关问题和疑问,请参阅详细文档:

  • ARCHITECTURE.md 技术深潜
  • SETUP_GUIDE.md 有关详细的设置说明
  • 检查 mcp-server/ 有关LLM集成的详细信息

目录标签

目录标签

TypeScriptClaude云端部署论文处理本地部署AI总结多LLM支持研究工具学术分析

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP