paper-intelligence

paper-intelligence

A local MCP server for intelligent PDF management that converts papers to markdown and enables hybrid grep and semantic search, allowing token-efficient exploration of academic documents.

Category
访问服务器

README

Paper Intelligence

Python MCP License uv ChromaDB LlamaIndex

A local MCP server for intelligent paper/PDF management. Convert PDFs to markdown, then search them with hybrid grep + semantic search. Designed for token efficiency: search first, read only what you need.

🚀 Quick Start

1. Install UV (one-time setup)

curl -LsSf https://astral.sh/uv/install.sh | sh

2. Add to Your MCP Client

Claude Code CLI:

claude mcp add paper-intelligence -- uvx paper-intelligence@latest

VS Code:

code --add-mcp '{"name":"paper-intelligence","command":"uvx","args":["paper-intelligence@latest"]}'

That's it! uvx handles everything automatically. Using @latest ensures you always get the newest version.

🔌 MCP Client Integration

<details> <summary><strong>Claude Desktop</strong></summary>

Add to your Claude Desktop config:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "paper-intelligence": {
      "command": "uvx",
      "args": ["paper-intelligence@latest"]
    }
  }
}

</details>

<details> <summary><strong>Cursor</strong></summary>

  1. Go to Settings → MCP → Add new MCP Server
  2. Select command type
  3. Enter: uvx paper-intelligence@latest

Or add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "paper-intelligence": {
      "command": "uvx",
      "args": ["paper-intelligence@latest"]
    }
  }
}

</details>

<details> <summary><strong>Windsurf / Other MCP Clients</strong></summary>

Any MCP-compatible client can use paper-intelligence:

{
  "mcpServers": {
    "paper-intelligence": {
      "command": "uvx",
      "args": ["paper-intelligence@latest"]
    }
  }
}

</details>

✨ Features

  • PDF to Markdown — High-accuracy conversion using Marker
  • Hybrid Search — Combined grep (exact/regex) + semantic RAG search
  • Token Efficient — Search papers instead of reading entire documents
  • GPU Acceleration — MPS (Apple Silicon) and CUDA support
  • Self-Contained — Each paper gets its own directory with all data
  • Header Context — Search results show document structure (e.g., "Methods > Data Collection")

📖 MCP Tools

process_paper

<details> <summary>Full pipeline: Convert PDF → Index headers → Create embeddings</summary>

Parameters:

  • pdf_path (string): Path to PDF file
  • use_llm (boolean, optional): Enhanced accuracy mode (default: false)
  • chunk_size (integer, optional): Text chunk size for embedding (default: 512)
  • chunk_overlap (integer, optional): Overlap between chunks (default: 50)

Example:

Process the paper at ~/Downloads/attention-is-all-you-need.pdf

Output Structure:

attention-is-all-you-need/
├── attention-is-all-you-need.md   # Converted markdown
├── metadata.json                   # Processing version info
├── index.json                      # Header hierarchy
├── chroma/                         # Embeddings database
└── images/                         # Extracted figures

</details>

search

<details> <summary>Unified search with grep and/or semantic RAG</summary>

Parameters:

  • query (string): Search query (text, regex, or semantic)
  • paper_dirs (array): List of paper directories to search
  • mode (string, optional): "grep", "rag", or "hybrid" (default: hybrid)
  • top_k (integer, optional): Number of results (default: 5)
  • regex (boolean, optional): Treat query as regex (default: false)

Example Queries:

# Semantic search across papers
Search for "attention mechanism implementation" in my processed papers

# Exact text search
Search for "transformer" using grep mode

# Regex search
Search for "BERT|GPT|T5" with regex enabled

Returns: Results with line numbers, surrounding context, and header location.

</details>

convert_pdf

<details> <summary>Convert PDF to Markdown (without embeddings)</summary>

Parameters:

  • pdf_path (string): Path to PDF file
  • output_dir (string, optional): Custom output directory
  • use_llm (boolean, optional): Enhanced accuracy mode

Returns: markdown_path, images_dir, image_count

</details>

get_paper_info

<details> <summary>Check processing status of a paper</summary>

Parameters:

  • paper_dir (string): Path to paper directory

Example Response:

{
  "has_markdown": true,
  "has_index": true,
  "has_embeddings": true,
  "has_images": true,
  "image_count": 12,
  "version": "0.2.0",
  "processed_at": "2025-01-15T10:30:00Z"
}

</details>

index_markdown / embed_document

<details> <summary>Individual pipeline steps (for advanced use)</summary>

index_markdown — Extract header hierarchy into searchable JSON

index_markdown(markdown_path="~/Downloads/paper/paper.md")

embed_document — Create embeddings for semantic search

embed_document(
    markdown_path="~/Downloads/paper/paper.md",
    chunk_size=512,
    chunk_overlap=50
)

</details>

📊 Example Output

Search Result

{
  "source": "attention-is-all-you-need.md",
  "line_number": 142,
  "header_path": "Model Architecture > Attention",
  "content": "An attention function can be described as mapping a query and a set of key-value pairs to an output...",
  "score": 0.89
}

🎯 Typical Workflow

  1. Process a paper:

    Process the PDF at ~/Downloads/transformer-paper.pdf

  2. Search across papers:

    Search for "positional encoding" in my papers

  3. Read specific sections:

    Show me the Methods section from the transformer paper

The agent reads search results (a few hundred tokens) instead of entire papers (tens of thousands of tokens).

🛠️ Installation Options

<details> <summary><strong>Install from PyPI</strong></summary>

# Install with pip
pip install paper-intelligence

# Or run directly with uvx (no install needed)
uvx paper-intelligence@latest

</details>

<details> <summary><strong>Install from GitHub</strong></summary>

pip install "paper-intelligence @ git+https://github.com/Strand-AI/paper-intelligence.git"

</details>

<details> <summary><strong>Local Development</strong></summary>

git clone https://github.com/Strand-AI/paper-intelligence.git
cd paper-intelligence

# Create virtual environment
python3.11 -m venv .venv
source .venv/bin/activate

# Install in development mode
pip install -e ".[dev]"

# Run the server
python -m paper_intelligence.server

Development MCP config:

{
  "mcpServers": {
    "paper-intelligence": {
      "command": "python",
      "args": ["-m", "paper_intelligence.server"],
      "cwd": "/path/to/paper-intelligence"
    }
  }
}

Run tests:

# Unit tests (fast)
pytest tests/test_markdown_parser.py

# Integration tests (slow, requires ML models)
pytest tests/test_integration.py -v

</details>

🔧 Debugging

Use the MCP Inspector to debug the server:

npx @modelcontextprotocol/inspector uvx paper-intelligence@latest

🆘 Troubleshooting

<details> <summary><strong>Server not starting?</strong></summary>

  • Ensure Python 3.11+ is installed
  • Try uvx paper-intelligence@latest directly to see error messages
  • Check that all dependencies installed correctly

</details>

<details> <summary><strong>Windows encoding issues?</strong></summary>

Add to your MCP config:

"env": {
  "PYTHONIOENCODING": "utf-8"
}

</details>

<details> <summary><strong>Claude Desktop not detecting changes?</strong></summary>

Claude Desktop only reads configuration on startup. Fully restart the app after config changes.

</details>

🏗️ Technical Stack

Component Technology
MCP Server Official Python SDK with FastMCP
PDF Conversion marker-pdf
Embeddings LlamaIndex + HuggingFace (BAAI/bge-small-en-v1.5)
Vector Store ChromaDB (persistent, local per-paper)
GPU Support PyTorch with MPS (Apple) or CUDA

🙏 Acknowledgments

📄 License

MIT — see LICENSE for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选