Integrations
Enables configuration through .env files for setting API keys, database credentials, and other environment variables
Supports deployment through Docker and Docker Compose with preconfigured containers for both the MCP server and Neo4j database
Provides installation instructions via GitHub repo cloning for accessing the Graphiti framework
Graphiti MCP Server
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.
Features
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
- Clone the Graphiti GitHub repo
or
Note the full path to this directory.
- Install the Graphiti prerequisites.
- Configure Claude, Cursor, or other MCP client to use Graphiti with a
stdio
transport. See the client documentation on where to find their MCP configuration files.
Installation
Prerequisites
- 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
Setup
- Clone the repository and navigate to the mcp_server directory
- Use
uv
to create a virtual environment and install dependencies:
Configuration
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 APIMODEL_NAME
: Optional model name to use for LLM inferenceAZURE_OPENAI_ENDPOINT
: Optional Azure OpenAI endpoint URLAZURE_OPENAI_DEPLOYMENT_NAME
: Optional Azure OpenAI deployment nameAZURE_OPENAI_API_VERSION
: Optional Azure OpenAI API versionAZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME
: Optional Azure OpenAI embedding deployment nameAZURE_OPENAI_EMBEDDING_API_VERSION
: Optional Azure OpenAI API versionAZURE_OPENAI_USE_MANAGED_IDENTITY
: Optional use Azure Managed Identities for authentication
You can set these variables in a .env
file in the project directory.
Running the Server
To run the Graphiti MCP server directly using uv
:
With options:
Available arguments:
--model
: Specify the model name to use with the LLM client--transport
: Choose the transport method (sse or stdio, default: sse)--group-id
: Set a namespace for the graph (optional)--destroy-graph
: Destroy all Graphiti graphs (use with caution)--use-custom-entities
: Enable entity extraction using the predefined ENTITY_TYPES
Docker Deployment
The Graphiti MCP server can be deployed using Docker. The Dockerfile uses uv
for package management, ensuring
consistent dependency installation.
Environment Configuration
Before running the Docker Compose setup, you need to configure the environment variables. You have two options:
- Using a .env file (recommended):
- Copy the provided
.env.example
file to create a.env
file:Copy - Edit the
.env
file to set your OpenAI API key and other configuration options:Copy - The Docker Compose setup is configured to use this file if it exists (it's optional)
- Copy the provided
- Using environment variables directly:
- You can also set the environment variables when running the Docker Compose command:Copy
- You can also set the environment variables when running the Docker Compose command:
Neo4j Configuration
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
Running with Docker Compose
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:
- Uses
uv
for package management and running the server - Installs dependencies from the
pyproject.toml
file - 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
Integrating with MCP Clients
Configuration
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, uv
installed. Please refer to the uv
install instructions.
Ensure that you set the full path to the uv
binary and your Graphiti project folder.
For SSE transport (HTTP-based), you can use this configuration:
Available Tools
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 summariessearch_facts
: Search the knowledge graph for relevant facts (edges between entities)delete_entity_edge
: Delete an entity edge from the knowledge graphdelete_episode
: Delete an episode from the knowledge graphget_entity_edge
: Get an entity edge by its UUIDget_episodes
: Get the most recent episodes for a specific groupclear_graph
: Clear all data from the knowledge graph and rebuild indicesget_status
: Get the status of the Graphiti MCP server and Neo4j connection
Working with JSON Data
The Graphiti MCP server can process structured JSON data through the add_episode
tool with source="json"
. This
allows you to automatically extract entities and relationships from structured data:
Integrating with the Cursor IDE
To integrate the Graphiti MCP Server with the Cursor IDE, follow these steps:
- Run the Graphiti MCP server using the SSE transport:
Hint: specify a group_id
to retain prior graph data. If you do not specify a group_id
, the server will create a new
graph
- Configure Cursor to connect to the Graphiti MCP server.
- Add the Graphiti rules to Cursor's User Rules. See cursor_rules.md for details.
- Kick off an agent session in Cursor.
The integration enables AI assistants in Cursor to maintain persistent memory through Graphiti's knowledge graph capabilities.
Requirements
- Python 3.10 or higher
- Neo4j database (version 5.26 or later required)
- OpenAI API key (for LLM operations and embeddings)
- MCP-compatible client
License
This project is licensed under the same license as the Graphiti project.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Graphiti MCP Server
Related MCP Servers
- AsecurityAlicenseAqualityMCP for working with GraphQL servers.Last updated -2536103TypeScriptMIT License
- Python
- JavaScriptMIT License
- PythonMIT License