MCP Hub
Back to servers

Paperlib

MCP (Model Context Protocol) Server. Research paper management with semantic search and knowledge graphs.

pulsemcp
Tools
11
Validated
Jan 11, 2026

Paperlib MCP

Academic literature management and retrieval MCP server - supporting PDF import, hybrid search, knowledge graph construction, and literature review generation.

Python 3.11+ License: MIT

中文 README

✨ Features

FeatureDescription
PDF ImportAuto-extract text, chunk by page, generate vector embeddings
Hybrid SearchFTS full-text search + pgvector semantic search
Knowledge GraphLLM-driven entity/relation/claim extraction, Leiden community detection
Review GenerationStructured literature review auto-generation based on evidence packs

📋 Prerequisites

  • PostgreSQL 16+ with pgvector extension
  • MinIO or S3-compatible storage
  • OpenRouter API Key

🚀 Installation & Usage

Method 1: Docker Compose (Recommended for Beginners)

One-click launch of complete environment (PostgreSQL + MinIO + MCP):

git clone https://github.com/h-lu/paperlib-mcp.git
cd paperlib-mcp

# Configure API Key
cp .env.example .env
# Edit .env and fill in OPENROUTER_API_KEY

# Start services
docker-compose up -d

Configure in Cursor

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "paperlib-docker": {
      "command": "docker",
      "args": [
        "exec",
        "-i",
        "paperlib-mcp",
        "python",
        "-m",
        "paperlib_mcp.server"
      ]
    }
  }
}

Method 2: uvx Install (Recommended)

Prerequisites: Requires available PostgreSQL (with pgvector) and MinIO/S3-compatible storage service.

💡 Quick Start Local Services (Optional)
docker-compose up -d postgres minio minio-init

Configure in Cursor/Claude Desktop, modify environment variables according to your actual service addresses:

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

Method 3: pip Install

Prerequisites: Same as Method 2, requires available PostgreSQL and MinIO/S3 services.

pip install paperlib-mcp

Configure MCP client (modify according to your actual service addresses):

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

Method 4: Local Development

git clone https://github.com/your-org/paperlib-mcp.git
cd paperlib-mcp

uv sync
cp .env.example .env
# Edit .env

uv run python -m paperlib_mcp.server

📖 Available Tools

Basic Tools

ToolDescription
health_checkSystem health check
import_pdfImport PDF documents
download_pdfDownload PDF by title to local directory
search_hybridHybrid search (recommended)
get_documentGet document metadata
list_documentsList all documents

Graph Tools

ToolDescription
extract_graph_v1Extract knowledge graph
build_communities_v1Build topic communities
summarize_community_v1Generate community summaries

Writing Tools

ToolDescription
build_evidence_packBuild evidence pack
draft_lit_review_v1Generate review draft

Full tool list (48+) available at docs/MCP_TOOLS_REFERENCE.md


💡 Usage Examples

# Import PDF
> import_pdf file_path="/papers/study.pdf" title="Study Title"

# Search literature
> search_hybrid query="monetary policy" k=10

# Build knowledge graph
> extract_graph_v1 doc_id="abc123"
> build_communities_v1 level="macro"

# Generate review
> build_evidence_pack query="CBDC" k=40
> draft_lit_review_v1 pack_id=1

📚 Documentation

DocumentDescription
DEPLOYMENT.mdDeployment Guide
ARCHITECTURE.mdSystem Architecture
EMBEDDING_SYSTEM.mdEmbedding & Retrieval
KNOWLEDGE_GRAPH.mdKnowledge Graph
DATABASE_SCHEMA.mdDatabase Schema
MCP_TOOLS_REFERENCE.mdTools API Reference

🛠️ Tech Stack

ComponentTechnology
MCP ProtocolFastMCP
DatabasePostgreSQL 16 + pgvector
Object StorageMinIO (S3 Compatible)
PDF ProcessingPyMuPDF4LLM
Embedding ModelOpenRouter (text-embedding-3-small)
Graph Clusteringigraph + Leiden

Environment Variables

VariableRequiredDefaultDescription
OPENROUTER_API_KEY-OpenRouter API key
POSTGRES_HOSTlocalhostDatabase host
POSTGRES_USERpaperDatabase user
POSTGRES_PASSWORDpaperDatabase password
POSTGRES_DBpaperlibDatabase name
S3_ENDPOINThttp://localhost:9000MinIO endpoint
MINIO_ROOT_USERminioMinIO user
MINIO_ROOT_PASSWORDminio123MinIO password

📄 License

MIT

Reviews

No reviews yet

Sign in to write a review