- Home
- MCP servers
- Paperlib
Paperlib
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"h-lu-paperlib-mcp": {
"command": "docker",
"args": [
"exec",
"-i",
"paperlib-mcp",
"python",
"-m",
"paperlib_mcp.server"
],
"env": {
"POSTGRES_DB": "paperlib",
"S3_ENDPOINT": "http://localhost:9000",
"POSTGRES_HOST": "localhost",
"POSTGRES_USER": "paper",
"MINIO_ROOT_USER": "minio",
"POSTGRES_PASSWORD": "paper",
"OPENROUTER_API_KEY": "your-api-key",
"MINIO_ROOT_PASSWORD": "minio123"
}
}
}
}Pap erlib MCP Server provides an end-to-end platform for academic literature management and retrieval. It enables PDF import with text extraction, powerful hybrid search, a knowledge graph built from entities and relations, and automated generation of literature reviews from evidence packs. This makes it easier to organize papers, discover connections, and produce structured reviews.
How to use
You interact with the Paperlib MCP Server through an MCP client. Start the server using one of the available deployment methods, then issue operations such as importing PDFs, performing hybrid searches, extracting and visualizing knowledge graphs, and generating literature reviews. Typical workflows include importing a set of PDFs, running a hybrid search for your topic of interest, extracting a knowledge graph from a document, clustering topics, and drafting a review from evidence packs.
Example usage patterns include: importing a PDF to index its text and embeddings, performing a comprehensive search combining full-text and semantic results, building topic communities from a document set, and generating a draft literature review from a focused evidence pack.
How to install
Prerequisites you need before starting are PostgreSQL 16+ with pgvector, an S3-compatible object storage (MinIO or similar), and an OpenRouter API key.
Choose one of the deployment methods below and follow the exact commands shown.
{
"mcpServers": {
"paperlib-docker": {
"command": "docker",
"args": [
"exec",
"-i",
"paperlib-mcp",
"python",
"-m",
"paperlib_mcp.server"
]
}
}
}
Configure in your MCP client to point at the local docker-based server. The exact invocation shown here starts the MCP server inside the running container and exposes its API to the client.
{
"mcpServers": {
"paperlib": {
"command": "uvx",
"args": ["paperlib-mcp"],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_USER": "paper",
"POSTGRES_PASSWORD": "paper",
"POSTGRES_DB": "paperlib",
"S3_ENDPOINT": "http://localhost:9000",
"MINIO_ROOT_USER": "minio",
"MINIO_ROOT_PASSWORD": "minio123",
"OPENROUTER_API_KEY": "your-api-key"
}
}
}
}
For local development or quick trials, you can install the MCP client as a Python package and run the server directly, using environment variables to configure connections to PostgreSQL and MinIO.
{
"mcpServers": {
"paperlib": {
"command": "paperlib-mcp",
"args": [],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_USER": "paper",
"POSTGRES_PASSWORD": "paper",
"POSTGRES_DB": "paperlib",
"S3_ENDPOINT": "http://localhost:9000",
"MINIO_ROOT_USER": "minio",
"MINIO_ROOT_PASSWORD": "minio123",
"OPENROUTER_API_KEY": "your-api-key"
}
}
}
}
If you prefer local development with a quick start, you can clone the project, sync the environment, and run the server directly with Python.
uv sync
cp .env.example .env
# Edit .env
uv run python -m paperlib_mcp.server
Additional configuration and notes
The server expects several environment variables to control access to the database and storage services. The primary required key is OPENROUTER_API_KEY. Other variables configure the PostgreSQL connection and MinIO storage.
{
"env": {
"OPENROUTER_API_KEY": "<your-key>",
"POSTGRES_HOST": "localhost",
"POSTGRES_USER": "paper",
"POSTGRES_PASSWORD": "paper",
"POSTGRES_DB": "paperlib",
"S3_ENDPOINT": "http://localhost:9000",
"MINIO_ROOT_USER": "minio",
"MINIO_ROOT_PASSWORD": "minio123"
}
}
Usage examples
# Import a PDF into the system
> import_pdf file_path="/papers/study.pdf" title="Study Title"
# Perform a hybrid search across documents
> search_hybrid query="monetary policy" k=10
# Build a knowledge graph from a document
> extract_graph_v1 doc_id="abc123"
> build_communities_v1 level="macro"
# Create a literature review draft from an evidence pack
> build_evidence_pack query="CBDC" k=40
> draft_lit_review_v1 pack_id=1
Available tools
health_check
System health check
import_pdf
Import PDF documents
download_pdf
Download PDF by title to local directory
search_hybrid
Hybrid search (full-text + semantic)
get_document
Get document metadata
list_documents
List all documents
extract_graph_v1
Extract knowledge graph from a document
build_communities_v1
Build topic communities within the knowledge graph
summarize_community_v1
Generate summaries for topic communities
build_evidence_pack
Build evidence packs for reviews
draft_lit_review_v1
Generate a literature review draft