paperqa-mcp-server
Give Claude the ability to read, search, and synthesize across your entire PDF library. Built on PaperQA2.
README
paperqa-mcp-server
Give Claude the ability to read, search, and synthesize across your entire PDF library. Built on PaperQA2.
Point it at your Zotero storage folder (or any folder of PDFs) and ask Claude questions that require deep reading across multiple papers.
Quick start
1. Install uv
uv is a Python package manager. If you don't have it yet:
curl -LsSf https://astral.sh/uv/install.sh | sh
After installing, restart your terminal so uv is on your PATH.
Verify it works:
uv --version
2. Get an OpenAI API key
PaperQA2 uses OpenAI for embeddings and internal reasoning. Get a key at https://platform.openai.com/api-keys
3. Warm the package cache
The first run downloads ~90 Python packages — this is normal and only happens once. Run this so the packages are cached before Claude Desktop tries to start the server:
uvx paperqa-mcp-server index 2>&1 | head -1
You should see output like Building index: .... Press Ctrl+C to stop
(we'll run the real index build in step 6). If you see a Python error
instead, something went wrong with the install.
4. Find your full path to uvx
Claude Desktop can't find uvx on its own — you need to give it the
full path. Run:
which uvx
This prints something like /Users/yourname/.local/bin/uvx. Copy it —
you'll need it in the next step.
5. Add to Claude Desktop
- Open Claude Desktop
- Go to Settings → Developer → Edit Config
- This opens
claude_desktop_config.json. Add apaperqaentry insidemcpServers(createmcpServersif it doesn't exist):
{
"mcpServers": {
"paperqa": {
"command": "/Users/yourname/.local/bin/uvx",
"args": ["paperqa-mcp-server"],
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
}
}
}
Replace the two placeholders:
/Users/yourname/.local/bin/uvx— paste the output ofwhich uvxfrom step 4sk-your-key-here— your OpenAI API key from step 2
If your PDFs are somewhere other than ~/Zotero/storage, add a
PAPER_DIRECTORY entry to env:
"env": {
"OPENAI_API_KEY": "sk-your-key-here",
"PAPER_DIRECTORY": "/full/path/to/your/pdfs"
}
- Quit Claude Desktop completely (Cmd+Q, not just close the window) and reopen it
- You should see a hammer icon — click it and
paper_qashould be listed
6. Pre-build the index
Before Claude can search your papers, the server needs to build a search index. This reads each PDF, splits it into chunks, and sends the chunks to OpenAI's embedding API. With hundreds of papers this takes a while and costs a few dollars in API calls.
If you have more than 10 unindexed papers, the server will refuse to answer queries and tell you to run this step first. A few new papers will be indexed automatically when you query.
export OPENAI_API_KEY=sk-your-key-here
uvx paperqa-mcp-server index
You'll see log lines as each paper is processed. When it finishes, it
prints Done.
If this crashes with a rate limit error, just re-run the same command. It picks up where it left off — each run indexes more files. With a large library (500+ papers) you may need to run it a few times.
After that, the index is cached at ~/.pqa/indexes/. Only new or changed
files get re-processed on subsequent runs.
Troubleshooting
"Server disconnected" in Claude Desktop
Claude Desktop has a short startup timeout. If uv needs to download
packages on first launch, it will time out. Fix: run uvx paperqa-mcp-server
once from the terminal first so packages are cached.
"Index incomplete" when querying
The server checks the index before each query. If too many papers are unindexed, it returns a diagnostic message instead of trying (and failing) to index them all on the fly. Fix: run the index command in step 6.
Hammer icon doesn't appear
Make sure you quit Claude Desktop completely (Cmd+Q) and reopened it.
Check for JSON syntax errors in claude_desktop_config.json — a
missing comma is the most common mistake.
Use a different LLM
By default, PaperQA2 uses gpt-4o-mini for its internal reasoning.
This is separate from Claude — Claude calls the tool, PaperQA2 does
its own LLM calls internally to gather and synthesize evidence.
To use a different model, add env vars to your Claude Desktop config:
"env": {
"OPENAI_API_KEY": "sk-your-key-here",
"PQA_LLM": "gpt-4o",
"PQA_SUMMARY_LLM": "gpt-4o-mini"
}
All environment variables
| Variable | Default | Purpose |
|---|---|---|
PAPER_DIRECTORY |
~/Zotero/storage |
Folder containing your PDFs |
OPENAI_API_KEY |
— | Required for default embeddings |
PQA_LLM |
gpt-4o-mini |
LLM for internal reasoning |
PQA_SUMMARY_LLM |
gpt-4o-mini |
LLM for summarizing chunks |
PQA_EMBEDDING |
text-embedding-3-small |
Embedding model |
ANTHROPIC_API_KEY |
— | Only if using Claude as internal LLM |
Works with zotero-mcp
This pairs well with zotero-mcp:
- paperqa-mcp-server — deep reading and synthesis across full paper text
- zotero-mcp — browse your library, search metadata, read annotations
Claude can cross-reference between them — for example, finding papers
with PaperQA and then pulling up their Zotero metadata and annotations.
PaperQA2's citations include Zotero storage keys (e.g. ABC123DE from
storage/ABC123DE/paper.pdf) that Claude can use to look up items via
zotero-mcp.
Index implementation notes
paperqa-mcp-server index uses the same _settings() function as the MCP
server, so the index it builds is exactly the one the server will look
for. The PaperQA2 index directory name is a hash of the settings
(embedding model, chunk size, paper directory path, etc.). The settings
include:
- Multimodal OFF — skip image extraction from PDFs (avoids a crash on PDFs with CMYK images)
- Doc details OFF — skip Crossref/Semantic Scholar metadata lookups (avoids rate limits; Claude can get metadata from Zotero directly via zotero-mcp)
- Concurrency 1 — index one file at a time to stay under OpenAI's embedding rate limit
Why not
pqa index? ThepqaCLI constructs settings via pydantic'sCliSettingsSource, which produces different defaults than constructingSettings()directly in Python (e.g.chunk_charsof 7000 vs 5000). Different settings = different index hash = server can't find the index. Always usepaperqa-mcp-server indexto build the index.
Install from GitHub (latest)
To use the latest version from the main branch instead of PyPI:
{
"mcpServers": {
"paperqa": {
"command": "/Users/yourname/.local/bin/uvx",
"args": ["--from", "git+https://github.com/menyoung/paperqa-mcp-server", "paperqa-mcp-server"],
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
}
}
}
To build the index from the latest main branch:
OPENAI_API_KEY=sk-your-key-here uvx --from git+https://github.com/menyoung/paperqa-mcp-server paperqa-mcp-server index
Development
If you want to contribute or modify the server locally:
git clone https://github.com/menyoung/paperqa-mcp-server.git
cd paperqa-mcp-server
uv sync
uv run paperqa-mcp-server # run the server
uv run paperqa-mcp-server index # build the index
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。