Skip to main content
Glama

ArXiv-MCP

by kelvingao
MIT License
  • Linux
  • Apple

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:

  1. search_papers: Search for papers on arXiv using keywords and get comprehensive summaries
  2. get_paper_details: Retrieve detailed information about a specific paper by its arXiv ID
  3. extract_paper_content: Download and extract the full text content from a paper's PDF
  4. analyze_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

  1. Install uv if you don't have it:
    pip install uv
  2. Clone this repository:
    git clone https://github.com/kelvingao/arxiv-mcp.git cd arxiv-mcp
  3. Install dependencies:
    uv pip install -e .
  4. Create a .env file based on .env.example:
    cp .env.example .env
  5. Configure your environment variables in the .env file (see Configuration section)
  1. Build the Docker image:
    docker build -t mcp/arxiv --build-arg PORT=8050 .
  2. Create a .env file based on .env.example and configure your environment variables

Configuration

The following environment variables can be configured in your .env file:

VariableDescriptionExample
TRANSPORTTransport protocol (sse or stdio)sse
HOSTHost to bind to when using SSE transport0.0.0.0
PORTPort to listen on when using SSE transport8050

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 serverUrl instead of url in 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:

  1. Add your own tools by creating methods with the @mcp.tool() decorator
  2. Create your own lifespan function to add your own dependencies (clients, database connections, etc.)
  3. Modify the existing tools or add new ones to enhance functionality
  4. Add prompts and resources with @mcp.resource() and @mcp.prompt()

License

MIT License

Acknowledgements

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器,使 AI 代理能够从 arXiv 搜索、检索和分析学术论文,支持关键字搜索、论文详细信息检索、内容提取和论文分析等功能。

  1. 特征
    1. 先决条件
      1. 安装
        1. 使用 uv
        2. 使用 Docker(推荐)
      2. 配置
        1. 运行服务器
          1. 使用 uv
          2. 使用 Docker
        2. 与 MCP 客户端集成
          1. SSE配置
          2. Python 与 Stdio 配置
          3. Docker 与 Stdio 配置
        3. 使用示例
          1. 寻找论文
          2. 获取论文详细信息
          3. 提取纸质内容
          4. 分析论文
        4. 构建您自己的 MCP 服务器
          1. 执照
            1. 致谢

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                Enables AI assistants to search and access arXiv research papers through a simple Message Control Protocol interface, allowing for paper search, download, listing, and reading capabilities.
                Last updated -
                4
                6
                Apache 2.0
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that enables natural language interaction with arXiv.org, allowing users to search, retrieve metadata, download PDFs, and load scholarly articles into LLM context.
                Last updated -
                5
                23
                MIT License
                • Apple
              • -
                security
                F
                license
                -
                quality
                A comprehensive Model Context Protocol server that provides AI assistants with direct access to Semantic Scholar's academic database, enabling advanced paper discovery, citation analysis, author research, and AI-powered recommendations.
                Last updated -
                4
                • Apple
                • Linux
              • A
                security
                F
                license
                A
                quality
                A TypeScript implementation of the Model Context Protocol server that enables searching arXiv papers and extracting paper information through standardized client-server communication.
                Last updated -
                2
                1

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/kelvingao/arxiv-mcp'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server