MCP cover image
See in Github
2025-04-14

MCP server for retrieving papers from arXiv based on keywords

0

Github Watches

0

Github Forks

0

Github Stars

ArXiv-MCP: Academic Paper Search for AI Agents

arXiv Logo

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)

Using Docker (Recommended)

  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:

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 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

相关推荐

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Aurity Ltd
  • Create and Publish Business Websites in seconds. AI will gather all the details about your website and generate link to your website.

  • Convincible Ltd
  • You're in a stone cell – can you get out? A classic choose-your-adventure interactive fiction game, based on a meticulously-crafted playbook. With a medieval fantasy setting, infinite choices and outcomes, and dice!

  • John Rafferty
  • Text your favorite pet, after answering 10 questions about their everyday lives!

  • Ian O'Connell
  • Provide players' names or enter Quickstart to start the game!

  • analogchat.com
  • Efficient Spotify assistant for personalized music data.

  • seabiscuit.ai
  • Discover A More Robust Business: Craft tailored value proposition statements, develop a comprehensive business model canvas, conduct detailed PESTLE analysis, and gain strategic insights on enhancing business model elements like scalability, cost structure, and market competition strategies. (v1.18)

  • n8n-io
  • Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

  • metorial
  • Containerized versions of hundreds of MCP servers 📡 🧠

  • av
  • Effortlessly run LLM backends, APIs, frontends, and services with one command.

  • langgenius
  • Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.

  • Azure
  • The Azure MCP Server, bringing the power of Azure to your agents.

  • alibaba
  • an easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.

  • 1Panel-dev
  • 🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.

  • superiorlu
  • 🤖 Collect practical AI repos, tools, websites, papers and tutorials on AI. 实用的AI百宝箱 💎

  • Byaidu
  • PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero

  • caio-moliveira
  • This project was created to demonstrate how we can connect with different Model Context Protocols (MCPs).

  • rulego
  • ⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.

    Reviews

    1.5 (2)
    Avatar
    user_guuyMRnx
    2025-04-24

    As a dedicated user of arxiv-mcp, I can confidently say this tool is a game-changer for managing arXiv papers. Created by the talented kelvingao, it streamlines the process of fetching and organizing research, making my academic work much more efficient. Highly recommended for researchers looking for a robust and user-friendly solution!

    Avatar
    user_bvenMy3y
    2025-04-24

    I recently started using arxiv-mcp by kelvingao, and I must say it's fantastic! The functionality and seamless integration with research papers on arXiv greatly enhance my workflow. It's evident that the author put a lot of thought into making this tool both user-friendly and efficient. Highly recommend it to any researcher or academician looking to streamline their study process!