ArXiv-MCP
A Model Context Protocol server that enables AI agents to search, retrieve, and analyze academic papers from arXiv, supporting features like keyword search, paper details retrieval, content extraction, and paper analysis.
README
<h1 align="center">ArXiv-MCP: Academic Paper Search for AI Agents</h1>
<p align="center"> <img src="https://info.arxiv.org/brand/images/brand-logo-primary.jpg" alt="arXiv Logo" width="400"> </p>
A Model Context Protocol (MCP) server implementation that enables AI agents to search, retrieve, and analyze academic papers from arXiv, the popular open-access repository of electronic preprints.
Overview
This project provides an MCP server that allows AI agents to interact with the arXiv repository, search for papers based on keywords, retrieve detailed information about specific papers, and even extract and analyze the content of papers. It serves as both a practical tool for research assistance and a reference implementation for building MCP servers.
The implementation follows the best practices laid out for building MCP servers, allowing seamless integration with any MCP-compatible client.
Features
The server provides several powerful tools for academic research:
search_papers: Search for papers on arXiv using keywords and get comprehensive summariesget_paper_details: Retrieve detailed information about a specific paper by its arXiv IDextract_paper_content: Download and extract the full text content from a paper's PDFanalyze_paper: Analyze a paper's content and generate a comprehensive summary
Prerequisites
- Python 3.11+
- Docker if running the MCP server as a container (recommended)
Installation
Using uv
-
Install uv if you don't have it:
pip install uv -
Clone this repository:
git clone https://github.com/kelvingao/arxiv-mcp.git cd arxiv-mcp -
Install dependencies:
uv pip install -e . -
Create a
.envfile based on.env.example:cp .env.example .env -
Configure your environment variables in the
.envfile (see Configuration section)
Using Docker (Recommended)
-
Build the Docker image:
docker build -t mcp/arxiv --build-arg PORT=8050 . -
Create a
.envfile based on.env.exampleand configure your environment variables
Configuration
The following environment variables can be configured in your .env file:
| Variable | Description | Example |
|---|---|---|
TRANSPORT |
Transport protocol (sse or stdio) | sse |
HOST |
Host to bind to when using SSE transport | 0.0.0.0 |
PORT |
Port to listen on when using SSE transport | 8050 |
Running the Server
Using uv
SSE Transport
# Set TRANSPORT=sse in .env then:
python src/server.py
The MCP server will run as an API endpoint that you can connect to with the configuration shown below.
Stdio Transport
With stdio, the MCP client itself can spin up the MCP server, so nothing to run at this point.
Using Docker
SSE Transport
docker run --env-file .env -p 8050:8050 mcp/arxiv
The MCP server will run as an API endpoint within the container that you can connect to with the configuration shown below.
Stdio Transport
With stdio, the MCP client itself can spin up the MCP server container, so nothing to run at this point.
Integration with MCP Clients
SSE Configuration
Once you have the server running with SSE transport, you can connect to it using this configuration:
{
"mcpServers": {
"arxiv": {
"transport": "sse",
"url": "http://localhost:8050/sse"
}
}
}
Note for Windsurf users: Use
serverUrlinstead ofurlin your configuration:{ "mcpServers": { "arxiv": { "transport": "sse", "serverUrl": "http://localhost:8050/sse" } } }
Note for n8n users: Use host.docker.internal instead of localhost since n8n has to reach outside of its own container to the host machine:
So the full URL in the MCP node would be: http://host.docker.internal:8050/sse
Make sure to update the port if you are using a value other than the default 8050.
Python with Stdio Configuration
Add this server to your MCP configuration for Claude Desktop, Windsurf, or any other MCP client:
{
"mcpServers": {
"arxiv": {
"command": "your/path/to/arxiv-mcp/.venv/bin/python",
"args": ["your/path/to/arxiv-mcp/src/main.py"],
"env": {
"TRANSPORT": "stdio"
}
}
}
}
Docker with Stdio Configuration
{
"mcpServers": {
"arxiv": {
"command": "docker",
"args": ["run", "--rm", "-i",
"-e", "TRANSPORT",
"mcp/arxiv"],
"env": {
"TRANSPORT": "stdio"
}
}
}
}
Usage Examples
Here are some examples of how to use the arXiv MCP server with an AI agent:
Searching for Papers
Find recent papers about quantum computing published in the last year.
Getting Paper Details
Get details for the paper with arXiv ID 2303.08774
Extracting Paper Content
Extract the full text from the paper with arXiv ID 2303.08774
Analyzing a Paper
Analyze the methodology section of the paper with arXiv ID 2303.08774
Building Your Own MCP Server
This implementation provides a foundation for building more complex MCP servers. To build your own:
- Add your own tools by creating methods with the
@mcp.tool()decorator - Create your own lifespan function to add your own dependencies (clients, database connections, etc.)
- Modify the existing tools or add new ones to enhance functionality
- Add prompts and resources with
@mcp.resource()and@mcp.prompt()
License
Acknowledgements
- arXiv for providing open access to research papers
- The Model Context Protocol team for creating the MCP standard
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。