arxiv-personalized
Transforms Chinese queries into ranked arXiv paper recommendations, with translation and semantic reranking, exposed as an MCP endpoint for AI agent integration.
README
Personalized arXiv Research Paper MCP Service
A full-pipeline service that transforms Chinese queries into ranked arXiv paper recommendations, exposed as an MCP (Model Context Protocol) endpoint for AI agent integration.
Chinese Query → EN Translation → Keyword Extraction → arXiv Search → Semantic Reranking → MCP Endpoint
Project Structure
arxiv_mcp/
├── big_model.py # Talker class: translation + keyword extraction (DeepSeek API)
├── arxiv_server.py # FastAPI service (/score + /query, port 5216)
├── mcp_wrapper.py # fastapi-mcp wrapper exposing API as MCP SSE endpoint (port 8000)
├── quick_test.py # Quick functional test (no GPU / reranker required)
├── requirements.txt
└── README.md
Quick Start
1. Install Dependencies
pip install -r requirements.txt
GPU users: install a CUDA-compatible PyTorch from pytorch.org for faster reranking.
2. Configure API Key
This project uses the DeepSeek API (OpenAI-compatible) for translation and keyword extraction. Set your API key via environment variable:
export DEEPSEEK_API_KEY="sk-xxxxxxxxxxxxxxxx"
Alternatively, you can pass the key directly when creating a Talker instance:
from big_model import Talker
talker = Talker(api_key="sk-xxxxxxxxxxxxxxxx")
3. Quick Functional Test (No GPU)
python quick_test.py
Validates translation and arXiv search without loading the reranker model.
4. Start the API Service
python arxiv_server.py
# or
uvicorn arxiv_server:app --host 127.0.0.1 --port 5216
Swagger docs: http://127.0.0.1:5216/docs
5. Start the MCP Service
python mcp_wrapper.py
MCP SSE endpoint: http://127.0.0.1:8000/mcp
API Reference
POST /score — Relevance Scoring
Computes normalized relevance scores (0–1) for a query against multiple passages using BAAI/bge-reranker-v2-m3.
Request:
{
"query": "position embedding in transformer",
"passages": [
"We propose a novel rotary position embedding...",
"This paper introduces a new attention mechanism..."
]
}
Response:
{
"scores": [0.9821, 0.6712]
}
POST /query — Personalized Paper Search
End-to-end pipeline: Chinese query → translation → keyword extraction → arXiv search → reranking.
Request:
{
"query": "注意力机制中的旋转位置编码",
"max_results": 5
}
Response:
{
"query_original": "注意力机制中的旋转位置编码",
"query_english": "Rotary Position Embedding in Attention Mechanisms",
"query_terms": "Rotary Position Embedding, Attention Mechanism, Transformer",
"papers_sorted": [
{
"paper_id": "2410.12345",
"title": "RoPE: Rotary Position Embedding for Transformers",
"summary_english": "We propose a novel method...",
"summary_chinese": "我们提出了一种新颖的方法...",
"authors": ["Author A", "Author B"],
"pdf_url": "https://arxiv.org/pdf/2410.12345",
"links": ["https://arxiv.org/abs/2410.12345"],
"relevance_score": 0.9821
}
]
}
Claude Desktop Integration
Add to ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"arxiv-personalized": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}
Restart Claude Desktop to use query_papers and compute_similarity tools directly in conversations.
Architecture
User Chinese Query
│
▼
[big_model.Talker]
├─ trans_cn2en() CN → EN translation
└─ extract_key_word() Academic keyword extraction (JSON)
│
▼
[arxiv.Client] arXiv paper search
│
▼
[big_model.Talker]
└─ trans_en2cn() Abstract EN → CN translation
│
▼
[FlagReranker] bge-reranker-v2-m3 semantic reranking
│
▼
[FastAPI /query] Returns ranked paper list
│
▼
[fastapi-mcp /mcp] MCP SSE endpoint for AI agent consumption
Dependencies
| Package | Purpose |
|---|---|
openai |
DeepSeek API client (OpenAI-compatible) |
arxiv |
arXiv API Python client |
FlagEmbedding |
BGE reranker model for semantic scoring |
fastapi + uvicorn |
REST API server |
fastapi-mcp |
MCP protocol adapter |
torch |
Deep learning runtime for reranker |
numpy |
Numerical computation |
Notes
- The reranker model
BAAI/bge-reranker-v2-m3(~1.1 GB) is auto-downloaded from HuggingFace on first run. SetHF_TOKENor configure a mirror for faster downloads. - Without a GPU, the reranker falls back to CPU (3–10 seconds per scoring batch).
- arXiv API imposes rate limits; keep
max_results≤ 10 for reliable operation.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。