Build knowledge graphs from any URL using Claude Desktop and Neo4j.
LLM Graph Builder MCP
Build knowledge graphs from any URL using Claude Desktop and Neo4j.
What is this?
This Model Context Protocol (MCP) server enables Claude to automatically extract entities and relationships from unstructured text and build knowledge graphs in Neo4j. Simply give Claude a URL (Wikipedia article, PDF, web page, YouTube video) and ask it to build a knowledge graph - it handles the rest.
Perfect for: Research, Zotero integrations, academic papers, content analysis, and building structured knowledge from unstructured sources.
What's Included
This repository is a complete, ready-to-use package containing:
- llm_graph_builder_mcp/ - The MCP server code
- llm-graph-builder/ - Neo4j's LLM Graph Builder backend (June 24, 2025, commit 4d7bb5e8)
Both are included so you get a tested, working version out of the box. Just clone once and you're ready to go!
Why include the backend?
- Guaranteed compatibility - this MCP is tested with this exact backend version
- Zero configuration headaches - everything just works together
- If Neo4j updates their backend, you still have a working version
Features
- Multi-source support: Wikipedia, PDFs, web pages, YouTube videos
- Academic mode: Extract citations, authors, journals, and bibliographic data
- Custom schemas: Define allowed entity types and relationships
- Community detection: Find clusters and groups in your knowledge graph
- Zero modifications: Works with unmodified llm-graph-builder backend
- Local processing: Your data, your Neo4j instance, your control
Quick Start
Prerequisites
- Neo4j database - Get a free instance at Neo4j AuraDB
- Create an instance and note your connection URI, username, and password
- OpenAI API key - Get one here
- Python 3.10+ with
uv- Install uv - Claude Desktop - Download here
Step 1: Clone This Repository
# Clone the entire project (includes both MCP and backend)
git clone https://github.com/henrardo/llm-graph-builder-mcp.git
cd llm-graph-builder-mcp
Your directory structure will be:
llm-graph-builder-mcp/ # The MCP server
llm-graph-builder/ # The backend (included)
Step 2: Set Up the Backend
# Navigate to backend
cd llm-graph-builder/backend
# Create environment file
cp example.env .env
Edit .env with your credentials:
# Neo4j Connection (from your AuraDB instance)
NEO4J_URI=neo4j+s://your-instance-id.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-auradb-password
NEO4J_DATABASE=neo4j
# OpenAI Configuration
LLM_MODEL_CONFIG_openai_gpt_4.1=gpt-4-turbo-2024-04-09,sk-your-openai-api-key
Install and start the backend:
# Create virtual environment
uv venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
uv pip install -r requirements.txt
# Start the backend server
uvicorn score:app --reload --port 8000
Keep this terminal running. The backend must be running for the MCP to work.
Step 3: Install the MCP
Open a new terminal (keep the backend running in the first one):
# Navigate back to the MCP directory
cd llm-graph-builder-mcp
# Install the MCP
uvx --from . llm-graph-builder-mcp
Step 4: Configure Claude Desktop
Edit your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"llm-graph-builder": {
"command": "uvx",
"args": [
"--from",
"/absolute/path/to/llm-graph-builder-mcp",
"llm-graph-builder-mcp"
],
"env": {
"NEO4J_URI": "neo4j+s://your-instance-id.databases.neo4j.io",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "your-auradb-password",
"NEO4J_DATABASE": "neo4j",
"GRAPH_BUILDER_URL": "http://localhost:8000"
}
}
}
}
Important:
- Replace
/absolute/path/to/with the full path to yourllm-graph-builder-mcpdirectory- Run
pwdin thellm-graph-builder-mcpdirectory to get this path - Example:
/Users/yourname/projects/llm-graph-builder-mcp
- Run
- Use the same credentials as in your backend
.envfile
Step 5: Restart Claude Desktop
Completely quit and restart Claude Desktop for the changes to take effect.
Step 6: Test It
In Claude Desktop, try:
Build a knowledge graph from this Wikipedia article:
https://en.wikipedia.org/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy
Claude should now use the MCP to build a knowledge graph in your Neo4j database!
Usage Examples
Basic Usage
Build a knowledge graph from this Wikipedia
Tools (1)
build_graphExtracts entities and relationships from a provided URL to populate a Neo4j knowledge graph.Environment Variables
NEO4J_URIrequiredThe connection URI for your Neo4j database instance.NEO4J_USERNAMErequiredUsername for Neo4j authentication.NEO4J_PASSWORDrequiredPassword for Neo4j authentication.NEO4J_DATABASErequiredThe specific database name within the Neo4j instance.GRAPH_BUILDER_URLrequiredThe local URL of the running backend server.Configuration
{"mcpServers": {"llm-graph-builder": {"command": "uvx", "args": ["--from", "/absolute/path/to/llm-graph-builder-mcp", "llm-graph-builder-mcp"], "env": {"NEO4J_URI": "neo4j+s://your-instance-id.databases.neo4j.io", "NEO4J_USERNAME": "neo4j", "NEO4J_PASSWORD": "your-auradb-password", "NEO4J_DATABASE": "neo4j", "GRAPH_BUILDER_URL": "http://localhost:8000"}}}}