Paperlib MCP

Paperlib MCP

Enables academic literature management through PDF import, hybrid search, knowledge graph construction, and automated literature review generation. Combines full-text search with semantic vector search for comprehensive paper analysis.

Category
Visit Server

README

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

Feature Description
PDF Import Auto-extract text, chunk by page, generate vector embeddings
Hybrid Search FTS full-text search + pgvector semantic search
Knowledge Graph LLM-driven entity/relation/claim extraction, Leiden community detection
Review Generation Structured 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/your-org/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.

<details> <summary>πŸ’‘ Quick Start Local Services (Optional)</summary>

docker-compose up -d postgres minio minio-init

</details>

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

Tool Description
health_check System health check
import_pdf Import PDF documents
download_pdf Download PDF by title to local directory
search_hybrid Hybrid search (recommended)
get_document Get document metadata
list_documents List all documents

Graph Tools

Tool Description
extract_graph_v1 Extract knowledge graph
build_communities_v1 Build topic communities
summarize_community_v1 Generate community summaries

Writing Tools

Tool Description
build_evidence_pack Build evidence pack
draft_lit_review_v1 Generate 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

Document Description
DEPLOYMENT.md Deployment Guide
ARCHITECTURE.md System Architecture
EMBEDDING_SYSTEM.md Embedding & Retrieval
KNOWLEDGE_GRAPH.md Knowledge Graph
DATABASE_SCHEMA.md Database Schema
MCP_TOOLS_REFERENCE.md Tools API Reference

πŸ› οΈ Tech Stack

Component Technology
MCP Protocol FastMCP
Database PostgreSQL 16 + pgvector
Object Storage MinIO (S3 Compatible)
PDF Processing PyMuPDF4LLM
Embedding Model OpenRouter (text-embedding-3-small)
Graph Clustering igraph + Leiden

Environment Variables

Variable Required Default Description
OPENROUTER_API_KEY βœ… - OpenRouter API key
POSTGRES_HOST ❌ localhost Database host
POSTGRES_USER ❌ paper Database user
POSTGRES_PASSWORD ❌ paper Database password
POSTGRES_DB ❌ paperlib Database name
S3_ENDPOINT ❌ http://localhost:9000 MinIO endpoint
MINIO_ROOT_USER ❌ minio MinIO user
MINIO_ROOT_PASSWORD ❌ minio123 MinIO password

πŸ“„ License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured