Skip to main content
The Graphiti MCP server provides Model Context Protocol integration, allowing AI assistants like Claude Desktop and Cursor to interact with Graphiti’s knowledge graph capabilities through a standardized protocol.

Overview

The MCP server exposes Graphiti’s core functionality through two transport modes:
  • HTTP transport (default): Accessible at http://localhost:8000/mcp/ for broad client compatibility
  • stdio transport: For clients that only support standard input/output
Key capabilities:
  • Episode management (add, retrieve, delete)
  • Entity and relationship operations
  • Semantic and hybrid search
  • Group-based data organization
  • Graph maintenance operations

Quick Start

The simplest way to run the MCP server is using Docker with the bundled FalkorDB database:
This starts:
  • MCP server on http://localhost:8000/mcp/
  • FalkorDB on localhost:6379
  • FalkorDB web UI on http://localhost:3000

Local Development

For development or customization:

Configuration

The server supports three configuration methods (in order of precedence):
  1. Command-line arguments
  2. Environment variables
  3. config.yaml file

Database Configuration

FalkorDB (Default)

FalkorDB is a Redis-based graph database bundled in a single container:

Neo4j

For production deployments:
Run with Neo4j:

LLM Provider Configuration

The server supports multiple LLM providers:

Ollama for Local LLM

Run LLMs locally using Ollama:
Ensure Ollama is running:

Environment Variables

The config.yaml supports environment variable expansion:
Key environment variables:
  • OPENAI_API_KEY - OpenAI API key
  • ANTHROPIC_API_KEY - Anthropic API key
  • GOOGLE_API_KEY - Google Gemini API key
  • GROQ_API_KEY - Groq API key
  • AZURE_OPENAI_API_KEY - Azure OpenAI key
  • SEMAPHORE_LIMIT - Concurrency control (see Performance Tuning)

Command-Line Arguments

Entity Types

The MCP server includes built-in entity types for structured knowledge extraction:
  • Preference: User preferences, choices, opinions
  • Requirement: Specific needs or functionality requirements
  • Procedure: Standard operating procedures
  • Location: Physical or virtual places
  • Event: Time-bound activities
  • Organization: Companies, institutions, groups
  • Document: Information content (books, articles, videos)
  • Topic: Subject of conversation (fallback)
  • Object: Physical items, tools, devices (fallback)
Customize in config.yaml:

MCP Client Integration

Cursor IDE

  1. Start the MCP server:
  2. Configure Cursor (.cursor/mcp.json):
  3. Add Graphiti rules to Cursor’s User Rules (see cursor_rules.md)

Claude Desktop (via mcp-remote)

Claude Desktop requires the mcp-remote gateway for HTTP transport:
  1. Start the MCP server:
  2. Install mcp-remote (optional, npx will fetch it):
  3. Configure Claude Desktop (claude_desktop_config.json):
  4. Restart Claude Desktop

stdio Transport

For clients supporting only stdio transport:

Available Tools

The MCP server exposes these tools to AI assistants:

Episode Management

  • add_episode - Add text, JSON, or message episodes to the graph
  • get_episodes - Retrieve recent episodes for a group
  • delete_episode - Remove an episode by UUID

Entity & Relationship Operations

  • get_entity_edge - Get an entity edge by UUID
  • delete_entity_edge - Delete an entity edge
  • search_nodes - Search for relevant node summaries
  • search_facts - Search for relevant facts (entity relationships)

Graph Maintenance

  • clear_graph - Clear all data and rebuild indices
  • get_status - Check server and database connection status

Working with JSON Data

Ingest structured JSON data for entity extraction:

Deployment

Production Deployment with Neo4j

Health Checks

Monitor the MCP server:
Expected response:

Telemetry

The MCP server uses Graphiti core’s telemetry. To disable:
Or in .env:
Telemetry collects:
  • Anonymous usage statistics
  • System information
  • Configuration choices (LLM provider, database type)
Never collected: API keys, personal data, graph content, queries

Troubleshooting

Connection Issues

Problem: MCP client cannot connect to server Solutions:
  • Verify server is running: curl http://localhost:8000/health
  • Check firewall allows port 8000
  • For Docker: ensure containers are on same network

Database Connection Errors

Problem: Cannot connect to Neo4j/FalkorDB Solutions:
  • Verify database is running
  • Check credentials in config or environment
  • For Neo4j: ensure Bolt port 7687 is accessible
  • For FalkorDB: ensure Redis port 6379 is accessible

Rate Limit Errors

Problem: 429 errors from LLM provider Solution: Lower SEMAPHORE_LIMIT (see Performance Tuning)

Next Steps