Labsco
kelvingao logo

ArXiv-MCP

โ˜… 4

from kelvingao

Search and retrieve academic papers from arXiv based on keywords.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

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

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

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