We are implementing an MCP server and AI agent integration to leverage Zep's Graphiti for persistent memory and context continuity across Cursor and Claude. This will allow AI agents hosted on Cursor and Claude to connect to the MCP for dynamic tool discovery, select the optimal tool for a given query, and formulate responses informed by past interactions, all while Graphiti ensures consistent context across both client platforms.
We use:
- Graphiti by Zep AI as a memory layer for an AI agent
- Cursor and Claude (as MCP Hosts)
Follow these steps to set up the project before running the MCP server.
git clone https://github.com/getzep/graphiti.git
cd graphiti/mcp_serveruv syncBefore running the MCP server, you need to configure the environment variables. Here's a look at the .env file you need to create in the graphiti/mcp_server directory:
# Neo4j Database Configuration
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=demodemo
# OpenAI API Configuration
OPENAI_API_KEY=<your_openai_api_key>
MODEL_NAME=gpt-4.1-miniGraphiti MCP server can be run using Docker or directly with Python. Docker is recommended for use, while direct Python execution is useful for troubleshooting.
Docker deployment will start both the Neo4j database and the Graphiti MCP server.
Start the services using Docker Compose:
docker compose upNote: When running the Docker Compose for both the Neo4j database and the Graphiti MCP server, if you encounter the No server info found error in the MCP logs, try running the server directly using Python to troubleshoot the issue.
uv run graphiti_mcp_server.py --model gpt-4.1-mini --transport sse- Cursor: Here's the configuration of the
mcp.jsonfile to integrate the MCP server with Cursor:
{
"mcpServers": {
"Graphiti": {
"url": "http://localhost:8000/sse"
}
}
}- Claude: Here's the configuration of
claude_desktop_config.jsonfile to integrate the MCP server with Claude:
{
"mcpServers": {
"graphiti": {
"transport": "stdio",
"command": "/Users/avichawla/.local/bin/uv",
"args": [
"run",
"--isolated",
"--directory",
"/Users/avichawla/Desktop/posts/graphiti/mcp_server",
"--project",
".",
"graphiti_mcp_server.py",
"--transport",
"stdio"
]
}
}
}Get a FREE Data Science eBook 📖 with 150+ essential lessons in Data Science when you subscribe to our newsletter! Stay in the loop with the latest tutorials, insights, and exclusive resources. Subscribe now!
Contributions are welcome! Feel free to fork this repository and submit pull requests with your improvements.
