ArXivLens MCP
<div align="center">
# ๐ ArXivLens MCP
### Autonomous Real-Time Academic Intelligence, Paper Discovery & Code-Implementation Mapping
[](https://github.com/chan4kum/arxivlens-mcp/actions)
[](https://python.org)
[](https://modelcontextprotocol.io)
[](https://gofastmcp.com)
[](LICENSE)
*An enterprise-grade Model Context Protocol (MCP) server and client built with **FastMCP 2.0**, standardizing how AI agents scout research papers, extract structured insights, and verify open-source GitHub implementations in real time.*
---
[Key Features](#-key-features) โข
[Architecture](#-architecture) โข
[Real-Time Problem Statement](#-real-time-problem-statement) โข
[Quickstart](#-quickstart) โข
[Claude & Cursor Setup](#-claude--cursor-desktop-integration) โข
[Interactive Agent](#-interactive-agent-cli)
</div>
---
## โก Real-Time Problem Statement
Every day, hundreds of cutting-edge AI, Machine Learning, and Computer Science papers are published to arXiv, while corresponding open-source code repositories, benchmarks, and model checkpoints are scattered across GitHub, Hugging Face, and Papers With Code.
Researchers, AI engineers, and technical leads face three critical real-time challenges:
1. **Information Overload & Latency**: Finding newly dropped breakthrough papers in specific niches (e.g., test-time compute, reasoning models, KV-cache compression) before they get buried.
2. **The Implementation Gap**: Locating verified, highly-starred GitHub repositories and code implementations that correspond to an arXiv paper in real time.
3. **Synthesis & Evaluation Friction**: Manually downloading and reading 30-page PDFs just to extract key contributions, methodology gaps, and experimental baselines.
4. **Agent Integration Bottleneck**: LLM agents (Claude Desktop, Cursor, Custom Agents) lack standardized, safe, and live access to academic repositories and code-linkage databases.
**ArXivLens MCP solves this end-to-end** by exposing production-grade MCP Tools, dynamic Resources, and structured Prompts over standard transports (`stdio` and `SSE`).
---
## ๐ฏ Key Features
- **๐ Live arXiv Search**: Real-time querying across arXiv's Atom 1.0 XML API with category filtering (`cs.AI`, `cs.LG`, `cs.CL`, `cs.CV`, `stat.ML`), author matching, and date sorting.
- **๐ป Automated Code Discovery**: Proactively scans GitHub for repositories implementing or referencing the paper, extracting star counts, languages, licenses, and direct URLs.
- **๐ Structured Research Briefs**: Synthesizes paper abstracts into executive 1-page briefs breaking down Problem Statement, Proposed Methodology, Key Contributions, Limitations, and Matching Code.
- **๐ก Dynamic MCP Resources**:
- `arxiv://categories`: Catalog of supported research domains.
- `arxiv://feed/{category}`: Live category paper feed.
- `paper://{arxiv_id}/brief`: Dynamic markdown research brief for any paper ID.
- **๐ง Expert Prompt Templates**: Standardized prompt templates for systematic literature reviews, critical methodology peer-reviews, and reproducibility audits.
- **๐ฅ๏ธ Dual Interface**: Includes both a **FastMCP Server** and a **Rich Terminal Client** with an interactive autonomous agent loop.
- **โก Zero-Cost Local Evaluation**: Built-in mock reasoning fallback allows testing and evaluation immediately without requiring paid API keys!
---
## ๐๏ธ Architecture
```mermaid
flowchart TD
subgraph Clients["MCP Clients & AI Hosts"]
Claude["Claude Desktop"]
Cursor["Cursor AI"]
TerminalCLI["ArXivLens CLI / Agent"]
CustomAgent["LangChain / LlamaIndex / Agent Frameworks"]
end
subgraph Protocol["Model Context Protocol (MCP Transport)"]
StdIO["stdio (Subprocess Pipe)"]
SSE["SSE / HTTP Transport"]
end
subgraph Server["ArXivLens FastMCP 2.0 Server"]
Router["FastMCP Request Dispatcher"]
subgraph Capabilities["Server Primitives"]
Tools["MCP Tools\nโข search_arxiv\nโข get_paper_details\nโข find_code_repositories\nโข generate_research_brief"]
Resources["MCP Resources\nโข arxiv://categories\nโข arxiv://feed/{cat}\nโข paper://{id}/brief"]
Prompts["MCP Prompts\nโข literature_review\nโข paper_critique\nโข reproducibility_audit"]
end
subgraph CoreServices["Internal Services"]
ArxivSvc["ArxivService\n(Atom 1.0 XML Async Client)"]
GitHubSvc["GitHubService\n(REST Search API & Matcher)"]
BriefSvc["BriefService\n(Synthesis & Markdown Engine)"]
end
end
subgraph Upstream["Upstream Real-Time Data Sources"]
ArXivAPI["arXiv Official API\n(export.arxiv.org)"]
GitHubAPI["GitHub Search API\n(api.github.com)"]
end
Clients --> Protocol
Protocol --> Router
Router --> Capabilities
Tools --> CoreServices
Resources --> CoreServices
CoreServices --> ArXivAPI
CoreServices --> GitHubAPI
```
---
## ๐ Quickstart
### 1. Installation
Clone the repository and install dependencies using `uv` (recommended) or `pip`:
```bash
git clone https://github.com/chan4kum/arxivlens-mcp.git
cd arxivlens-mcp
# Using uv (fastest)
uv sync
# Or using standard pip
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
```
### 2. Configure Environment (Optional)
Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```
*Tip: Adding a `GITHUB_TOKEN` increases your GitHub API rate limit from 60 req/hr to 5,000 req/hr.*
---
## ๐ป CLI & Interactive Client
ArXivLens comes out-of-the-box with an interactive CLI built with `rich`:
### Inspect Server Capabilities
Inspect all registered MCP tools, resources, and prompts:
```bash
uv run arxivlens-client inspect
```
### Real-Time Paper Search
```bash
uv run arxivlens-client search "DeepSeek-R1 reasoning" --max 3
```
### Generate Structured Research Brief
```bash
uv run arxivlens-client brief 1706.03762
```
### Find GitHub Code Repositories
```bash
uv run arxivlens-client code 1706.03762
```
### Autonomous Agent Loop
Launch the interactive terminal agent to scout papers and match code conversationally:
```bash
uv run arxivlens-client agent
```
---
## ๐ Claude & Cursor Desktop Integration
### Claude Desktop
Add this to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"arxivlens": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/arxivlens-mcp",
"run",
"arxivlens-server"
],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}
```
### Cursor AI
1. Open **Cursor Settings > Features > MCP Servers**.
2. Click **Add New MCP Server**:
- **Name**: `ArXivLens`
- **Type**: `command`
- **Command**: `uv --directory /absolute/path/to/arxivlens-mcp run arxivlens-server`
---
## ๐งช Testing
Run the comprehensive unit and integration test suite:
```bash
# Run pytest with coverage
uv run pytest -v tests/
# Run linter
uv run ruff check .
```
---
## ๐ Repository Structure
```
arxivlens-mcp/
โโโ .github/workflows/ci.yml # GitHub Actions automated CI
โโโ config/
โ โโโ claude_desktop_config.json # Claude Desktop configuration
โ โโโ cursor_mcp.json # Cursor AI configuration
โโโ docs/
โ โโโ ARCHITECTURE.md # In-depth architectural documentation
โ โโโ SETUP_GUIDE.md # Integration guide for agents & hosts
โโโ src/arxivlens/
โ โโโ __init__.py # Package exports
โ โโโ server.py # FastMCP 2.0 Server (Tools, Resources, Prompts)
โ โโโ client.py # FastMCP Client async wrapper
โ โโโ cli.py # Rich terminal CLI & Agent loop
โ โโโ models.py # Pydantic data models
โ โโโ services/
โ โโโ arxiv_service.py # Async arXiv Atom XML client
โ โโโ github_service.py # GitHub search & code matcher
โ โโโ brief_service.py # Research brief synthesis engine
โโโ tests/
โ โโโ conftest.py # Mock fixtures for offline testing
โ โโโ test_services.py # Unit tests for services
โ โโโ test_server.py # Server endpoints tests
โ โโโ test_client.py # Client integration tests
โโโ .env.example # Environment configuration template
โโโ .gitignore # Git ignore patterns
โโโ LICENSE # MIT License
โโโ pyproject.toml # Packaging & CLI entrypoints
โโโ README.md # Project documentation
```
---
## ๐ค Contributing
Contributions are welcome! Please follow these steps:
1. Fork the repository.
2. Create your feature branch (`git checkout -b feature/amazing-feature`).
3. Run tests and linter (`uv run pytest && uv run ruff check .`).
4. Commit your changes (`git commit -m 'feat: add amazing feature'`).
5. Push to the branch (`git push origin feature/amazing-feature`).
6. Open a Pull Request.
---
## ๐ License
Distributed under the **MIT License**. See [`LICENSE`](LICENSE) for more information.
---
<div align="center">
Built with โค๏ธ using <a href="https://gofastmcp.com">FastMCP 2.0</a> and <a href="https://modelcontextprotocol.io">Model Context Protocol</a>
</div>
TDQS
Scored across 4 tools
Each tool targets a distinct stage of the research workflow: searching, retrieving metadata, finding code, and generating a synthesis. There is no meaningful overlap between tool purposes.
All tool names follow a consistent verb_noun pattern with clear, descriptive verbs: search, get, find, generate. The naming convention is uniform throughout.
Four tools is well-scoped for an arXiv research assistant: search, detail retrieval, code discovery, and brief generation. Each tool earns its place and the set is neither bloated nor too thin.
The surface covers the full research journey from discovery to synthesis, including practical follow-up like finding code repositories. No obvious dead ends or missing lifecycle steps are apparent for this domain.