Graphiti MCP Server
About
A framework for building and querying temporally-aware knowledge graphs for AI agents.
Details
- Author
- chen9z
- Categories
- Database, Knowledge Base, AI, Other
Jump to
Quick Start for Claude Desktop, Cursor, and other clients
git clone https://github.com/getzep/graphiti.git
Configure Claude, Cursor, or other MCP client to useGraphiti with astdiotransport. See the client documentation on where to find their MCP configuration files.
- Ensure you have Python 3.10 or higher installed.
- A running Neo4j database (version 5.26 or later required)
- OpenAI API key for LLM operations
- Clone the repository and navigate to the mcp_server directory
- Useuvto create a virtual environment and install dependencies:
# Install uv if you don't have it already curl -LsSf https://astral.sh/uv/install.sh | sh # Create a virtual environment and install dependencies in one step uv sync
The server uses the following environment variables:
- NEO4J_URI: URI for the Neo4j database (default:bolt://localhost:7687)
- NEO4J_USER: Neo4j username (default:neo4j)
- NEO4J_PASSWORD: Neo4j password (default:demodemo)
- OPENAI_API_KEY: OpenAI API key (required for LLM operations)
- OPENAI_BASE_URL: Optional base URL for OpenAI API
- MODEL_NAME: OpenAI model name to use for LLM operations.
- SMALL_MODEL_NAME: OpenAI model name to use for smaller LLM operations.
- LLM_TEMPERATURE: Temperature for LLM responses (0.0-2.0).
- AZURE_OPENAI_ENDPOINT: Optional Azure OpenAI endpoint URL
- AZURE_OPENAI_DEPLOYMENT_NAME: Optional Azure OpenAI deployment name
- AZURE_OPENAI_API_VERSION: Optional Azure OpenAI API version
- AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME: Optional Azure OpenAI embedding deployment name
- AZURE_OPENAI_EMBEDDING_API_VERSION: Optional Azure OpenAI API version
- AZURE_OPENAI_USE_MANAGED_IDENTITY: Optional use Azure Managed Identities for authentication
You can set these variables in a.envfile in the project directory.
To run the Graphiti MCP server directly usinguv:
uv run graphiti_mcp_server.py --model gpt-4.1-mini --transport sse
- --model: Overrides theMODEL_NAMEenvironment variable.
- --small-model: Overrides theSMALL_MODEL_NAMEenvironment variable.
- --temperature: Overrides theLLM_TEMPERATUREenvironment variable.
- --transport: Choose the transport method (sse or stdio, default: sse)
- --group-id: Set a namespace for the graph (optional). If not provided, defaults to "default".
- --destroy-graph: If set, destroys all Graphiti graphs on startup.
- --use-custom-entities: Enable entity extraction using the predefined ENTITY_TYPES
The Graphiti MCP server can be deployed using Docker. The Dockerfile usesuvfor package management, ensuring consistent dependency installation.
Before running the Docker Compose setup, you need to configure the environment variables. You have two options:
- Copy the provided.env.examplefile to create a.envfile:
cp .env.example .env
# Required for LLM operations OPENAI_API_KEY=your_openai_api_key_here MODEL_NAME=gpt-4.1-mini # Optional: OPENAI_BASE_URL only needed for non-standard OpenAI endpoints # OPENAI_BASE_URL=https://api.openai.com/v1
- You can also set the environment variables when running the Docker Compose command:
OPENAI_API_KEY=your_key MODEL_NAME=gpt-4.1-mini docker compose up
The Docker Compose setup includes a Neo4j container with the following default configuration:
- Username:neo4j
- Password:demodemo
- URI:bolt://neo4j:7687(from within the Docker network)
- Memory settings optimized for development use
Start the services using Docker Compose:
Or if you're using an older version of Docker Compose:
This will start both the Neo4j database and the Graphiti MCP server. The Docker setup:
- Usesuvfor package management and running the server
- Installs dependencies from thepyproject.tomlfile
- Connects to the Neo4j container using the environment variables
- Exposes the server on port 8000 for HTTP-based SSE transport
- Includes a healthcheck for Neo4j to ensure it's fully operational before starting the MCP server
To use the Graphiti MCP server with an MCP-compatible client, configure it to connect to the server:
[!IMPORTANT] You will need the Python package manager,uvinstalled. Please refer to theuvinstall instructions.
Ensure that you set the full path to theuvbinary and your Graphiti project folder.
{ "mcpServers": { "graphiti-memory": { "transport": "stdio", "command": "/Users/<user>/.local/bin/uv", "args": [ "run", "--isolated", "--directory", "/Users/<user>>/dev/zep/graphiti/mcp_server", "--project", ".", "graphiti_mcp_server.py", "--transport", "stdio" ], "env": { "NEO4J_URI": "bolt://localhost:7687", "NEO4J_USER": "neo4j", "NEO4J_PASSWORD": "password", "OPENAI_API_KEY": "sk-XXXXXXXX", "MODEL_NAME": "gpt-4.1-mini" } } } }
For SSE transport (HTTP-based), you can use this configuration:
{ "mcpServers": { "graphiti-memory": { "transport": "sse", "url": "http://localhost:8000/sse" } } }
The Graphiti MCP server exposes the following tools:
- add_episode: Add an episode to the knowledge graph (supports text, JSON, and message formats)
- search_nodes: Search the knowledge graph for relevant node summaries
- search_facts: Search the knowledge graph for relevant facts (edges between entities)
- delete_entity_edge: Delete an entity edge from the knowledge graph
- delete_episode: Delete an episode from the knowledge graph
- get_entity_edge: Get an entity edge by its UUID
- get_episodes: Get the most recent episodes for a specific group
- clear_graph: Clear all data from the knowledge graph and rebuild indices
- get_status: Get the status of the Graphiti MCP server and Neo4j connection
The Graphiti MCP server can process structured JSON data through theadd_episodetool withsource="json". This allows you to automatically extract entities and relationships from structured data:
add_episode( name="Customer Profile", episode_body="{\"company\": {\"name\": \"Acme Technologies\"}, \"products\": [{\"id\": \"P001\", \"name\": \"CloudSync\"}, {\"id\": \"P002\", \"name\": \"DataMiner\"}]}", source="json", source_description="CRM data" )
To integrate the Graphiti MCP Server with the Cursor IDE, follow these steps:
- Run the Graphiti MCP server using the SSE transport:
python graphiti_mcp_server.py --transport sse --use-custom-entities --group-id <your_group_id>
Hint: specify agroup_idto namespace graph data. If you do not specify agroup_id, the server will use "default" as the group_id.
- Configure Cursor to connect to the Graphiti MCP server.
{ "mcpServers": { "graphiti-memory": { "url": "http://localhost:8000/sse" } } }
-
Add the Graphiti rules to Cursor's User Rules. See[cursor_rules.mdfor details.
The integration enables AI assistants in Cursor to maintain persistent memory through Graphiti's knowledge graph capabilities.
Graphiti is a framework for building and querying temporally-aware knowledge graphs, specifically tailored for AI agents operating in dynamic environments. Unlike traditional retrieval-augmented generation (RAG) methods, Graphiti continuously integrates user interactions, structured and unstructured enterprise data, and external information into a coherent, queryable graph. The framework supports incremental data updates, efficient retrieval, and precise historical queries without requiring complete graph recomputation, making it suitable for developing interactive, context-aware AI applications.
This is an experimental Model Context Protocol (MCP) server implementation for Graphiti. The MCP server exposes Graphiti's key functionality through the MCP protocol, allowing AI assistants to interact with Graphiti's knowledge graph capabilities.
The Graphiti MCP server exposes the following key high-level functions of Graphiti:
- Episode Management: Add, retrieve, and delete episodes (text, messages, or JSON data)
- Entity Management: Search and manage entity nodes and relationships in the knowledge graph
- Search Capabilities: Search for facts (edges) and node summaries using semantic and hybrid search
- Group Management: Organize and manage groups of related data with group_id filtering
- Graph Maintenance: Clear the graph and rebuild indices
Quick Start for Claude Desktop, Cursor, and other clients
git clone https://github.com/getzep/graphiti.git
Configure Claude, Cursor, or other MCP client to useGraphiti with astdiotransport. See the client documentation on where to find their MCP configuration files.
- Ensure you have Python 3.10 or higher installed.
- A running Neo4j database (version 5.26 or later required)
- OpenAI API key for LLM operations
- Clone the repository and navigate to the mcp_server directory
- Useuvto create a virtual environment and install dependencies:
# Install uv if you don't have it already curl -LsSf https://astral.sh/uv/install.sh | sh # Create a virtual environment and install dependencies in one step uv sync
The server uses the following environment variables:
- NEO4J_URI: URI for the Neo4j database (default:bolt://localhost:7687)
- NEO4J_USER: Neo4j username (default:neo4j)
- NEO4J_PASSWORD: Neo4j password (default:demodemo)
- OPENAI_API_KEY: OpenAI API key (required for LLM operations)
- OPENAI_BASE_URL: Optional base URL for OpenAI API
- MODEL_NAME: OpenAI model name to use for LLM operations.
- SMALL_MODEL_NAME: OpenAI model name to use for smaller LLM operations.
- LLM_TEMPERATURE: Temperature for LLM responses (0.0-2.0).
- AZURE_OPENAI_ENDPOINT: Optional Azure OpenAI endpoint URL
- AZURE_OPENAI_DEPLOYMENT_NAME: Optional Azure OpenAI deployment name
- AZURE_OPENAI_API_VERSION: Optional Azure OpenAI API version
- AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME: Optional Azure OpenAI embedding deployment name
- AZURE_OPENAI_EMBEDDING_API_VERSION: Optional Azure OpenAI API version
- AZURE_OPENAI_USE_MANAGED_IDENTITY: Optional use Azure Managed Identities for authentication
You can set these variables in a.envfile in the project directory.
To run the Graphiti MCP server directly usinguv:
uv run graphiti_mcp_server.py --model gpt-4.1-mini --transport sse
- --model: Overrides theMODEL_NAMEenvironment variable.
- --small-model: Overrides theSMALL_MODEL_NAMEenvironment variable.
- --temperature: Overrides theLLM_TEMPERATUREenvironment variable.
- --transport: Choose the transport method (sse or stdio, default: sse)
- --group-id: Set a namespace for the graph (optional). If not provided, defaults to "default".
- --destroy-graph: If set, destroys all Graphiti graphs on startup.
- --use-custom-entities: Enable entity extraction using the predefined ENTITY_TYPES
The Graphiti MCP server can be deployed using Docker. The Dockerfile usesuvfor package management, ensuring consistent dependency installation.
Before running the Docker Compose setup, you need to configure the environment variables. You have two options:
- Copy the provided.env.examplefile to create a.envfile:
cp .env.example .env
# Required for LLM operations OPENAI_API_KEY=your_openai_api_key_here MODEL_NAME=gpt-4.1-mini # Optional: OPENAI_BASE_URL only needed for non-standard OpenAI endpoints # OPENAI_BASE_URL=https://api.openai.com/v1
- You can also set the environment variables when running the Docker Compose command:
OPENAI_API_KEY=your_key MODEL_NAME=gpt-4.1-mini docker compose up
The Docker Compose setup includes a Neo4j container with the following default configuration:
- Username:neo4j
- Password:demodemo
- URI:bolt://neo4j:7687(from within the Docker network)
- Memory settings optimized for development use
Start the services using Docker Compose:
Or if you're using an older version of Docker Compose:
This will start both the Neo4j database and the Graphiti MCP server. The Docker setup:
- Usesuvfor package management and running the server
- Installs dependencies from thepyproject.tomlfile
- Connects to the Neo4j container using the environment variables
- Exposes the server on port 8000 for HTTP-based SSE transport
- Includes a healthcheck for Neo4j to ensure it's fully operational before starting the MCP server
To use the Graphiti MCP server with an MCP-compatible client, configure it to connect to the server:
[!IMPORTANT] You will need the Python package manager,uvinstalled. Please refer to theuvinstall instructions.
Ensure that you set the full path to theuvbinary and your Graphiti project folder.
{ "mcpServers": { "graphiti-memory": { "transport": "stdio", "command": "/Users/<user>/.local/bin/uv", "args": [ "run", "--isolated", "--directory", "/Users/<user>>/dev/zep/graphiti/mcp_server", "--project", ".", "graphiti_mcp_server.py", "--transport", "stdio" ], "env": { "NEO4J_URI": "bolt://localhost:7687", "NEO4J_USER": "neo4j", "NEO4J_PASSWORD": "password", "OPENAI_API_KEY": "sk-XXXXXXXX", "MODEL_NAME": "gpt-4.1-mini" } } } }
For SSE transport (HTTP-based), you can use this configuration:
{ "mcpServers": { "graphiti-memory": { "transport": "sse", "url": "http://localhost:8000/sse" } } }
The Graphiti MCP server exposes the following tools:
- add_episode: Add an episode to the knowledge graph (supports text, JSON, and message formats)
- search_nodes: Search the knowledge graph for relevant node summaries
- search_facts: Search the knowledge graph for relevant facts (edges between entities)
- delete_entity_edge: Delete an entity edge from the knowledge graph
- delete_episode: Delete an episode from the knowledge graph
- get_entity_edge: Get an entity edge by its UUID
- get_episodes: Get the most recent episodes for a specific group
- clear_graph: Clear all data from the knowledge graph and rebuild indices
- get_status: Get the status of the Graphiti MCP server and Neo4j connection
The Graphiti MCP server can process structured JSON data through theadd_episodetool withsource="json". This allows you to automatically extract entities and relationships from structured data:
add_episode( name="Customer Profile", episode_body="{\"company\": {\"name\": \"Acme Technologies\"}, \"products\": [{\"id\": \"P001\", \"name\": \"CloudSync\"}, {\"id\": \"P002\", \"name\": \"DataMiner\"}]}", source="json", source_description="CRM data" )
To integrate the Graphiti MCP Server with the Cursor IDE, follow these steps:
- Run the Graphiti MCP server using the SSE transport:
python graphiti_mcp_server.py --transport sse --use-custom-entities --group-id <your_group_id>
Hint: specify agroup_idto namespace graph data. If you do not specify agroup_id, the server will use "default" as the group_id.
- Configure Cursor to connect to the Graphiti MCP server.
{ "mcpServers": { "graphiti-memory": { "url": "http://localhost:8000/sse" } } }
-
Add the Graphiti rules to Cursor's User Rules. Seecursor_rules.mdfor details.
The integration enables AI assistants in Cursor to maintain persistent memory through Graphiti's knowledge graph capabilities.
Integrating with Claude Desktop (Docker MCP Server)
The Graphiti MCP Server container uses the SSE MCP transport. Claude Desktop does not natively support SSE, so you'll need to use a gateway likemcp-remote.
-
Run the Graphiti MCP server using SSE transport:
(Optional) Installmcp-remoteglobally: If you prefer to havemcp-remoteinstalled globally, or if you encounter issues withnpxfetching the package, you can install it globally. Otherwise,npx(used in the next step) will handle it for you.
Configure Claude Desktop: Open your Claude Desktop configuration file (usuallyclaude_desktop_config.json) and add or modify themcpServerssection as follows:
{ "mcpServers": { "graphiti-memory": { // You can choose a different name if you prefer "command": "npx", // Or the full path to mcp-remote if npx is not in your PATH "args": [ "mcp-remote", "http://localhost:8000/sse" // Ensure this matches your Graphiti server's SSE endpoint ] } } }
If you already have anmcpServersentry, addgraphiti-memory(or your chosen name) as a new key within it.
Restart Claude Desktopfor the changes to take effect.
- Python 3.10 or higher
- Neo4j database (version 5.26 or later required)
- OpenAI API key (for LLM operations and embeddings)
- MCP-compatible client
This project is licensed under the same license as the parent Graphiti project.
Adaptive MCP memory system for AI applications. Learns which retrieval strategies work for your data, scores results using cognitive science models, builds a knowledge graph automatically, and validates every parameter change against real query history before adopting it. Patent pending.
Self-hosted Rust-based MCP server for AI agent memory — persistent, queryable memory with hybrid search, knowledge graphs, built-in embeddings, and 14 core tools (expandable to 86+ with profile-based tiering).
Self-improving MCP memory server for AI agents. One command, no cloud, no config. Hybrid search, feedback loop quality system, dashboard UI, auto-linking knowledge graph. Gets better the more you use it.
Persistent memory for AI agents using a semantic knowledge graph. Store, retrieve, and connect memories with semantic search — so your AI remembers context across sessions.
🏠 🍎 🪟 🐧 - A self-contained Memory server with single-binary architecture (embedded DB & models, no dependencies). Provides persistent semantic and graph-based memory for AI agents.
Smriti is a Model Context Protocol (MCP) server that provides persistent, graph-based memory for LLM applications. Built on LadybugDB (embedded property graph database), it uses EcphoryRAG-inspired multi-stage retrieval - combining cue extraction, graph traversal, vector similarity, and multi-hop association - to deliver human-like memory recall.
A local, high-performance memory server for AI agents, built with SQLite, vector embeddings, and a knowledge graph. Packaged for npm and Docker.
Persistent memory layer for AI agents with semantic search, consolidation, and cross-session intelligence via MCP.
Query and interact with FalkorDB graph databases using AI models.
MCP memory server with Hebbian learning — concept connections strengthen through co-activation and weaken through disuse.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





