This document describes the setup and usage of the Graphiti MCP (Model Context Protocol) server for the SonicJS AI project.
Graphiti is a temporal knowledge graph system designed for AI agents. It enables:
- Temporal Knowledge Graphs: Build per-project temporal knowledge graphs that your AI agents can query
- Dynamic Graph Management: Automatically extracts entities & relationships from unstructured text and records every change as time-stamped episodes
- Persistent Memory: AI assistants can maintain context and memory across sessions
- Neo4j Database: Required for graph storage
- OpenAI API Key: Required for LLM operations and embeddings
- Python 3.10+: Required for running the MCP server
- uv Package Manager: Required for dependency management
Start Neo4j using Docker:
cd .graphiti-mcp
docker-compose -f docker-compose.neo4j-only.yml up -dThis will start Neo4j with:
- Web interface: http://localhost:7474
- Bolt connection: bolt://localhost:7687
- Username:
neo4j - Password:
demodemo
Edit .graphiti-mcp/.env and set your OpenAI API key:
OPENAI_API_KEY=your_actual_openai_api_key_hereThe Claude Desktop configuration is already set up in ~/.config/claude-desktop/claude_desktop_config.json. Update the OPENAI_API_KEY in the configuration:
{
"mcpServers": {
"graphiti": {
"env": {
"OPENAI_API_KEY": "your_actual_openai_api_key_here"
}
}
}
}After updating the configuration, restart Claude Desktop to load the new MCP server.
Once configured, the Graphiti MCP server provides these tools to Claude:
- add_episode: Add information to the knowledge graph
- search_nodes: Search for entities in the graph
- search_facts: Search for relationships between entities
- get_episodes: Retrieve recent episodes
- clear_graph: Clear all graph data
The knowledge graph is namespaced to sonicjs-ai to keep project data separate.
You can test if the integration is working by asking Claude to:
- Remember project information: "Please remember that this project uses Hono.js framework"
- Search for information: "What do you remember about this project's technology stack?"
- Check status: "What's the status of the Graphiti knowledge graph?"
- Ensure Neo4j is running:
docker ps - Check Neo4j logs:
docker-compose -f .graphiti-mcp/docker-compose.neo4j-only.yml logs neo4j - Verify connection: Open http://localhost:7474 in browser
- Verify your API key is valid
- Check you have sufficient API credits
- Ensure the key is set in both
.envand Claude Desktop config
- Check Claude Desktop logs for MCP connection errors
- Test the server manually:
cd .graphiti-mcp && uv run graphiti_mcp_server.py --transport stdio - Verify
uvis installed and accessible at/Users/lane/.local/bin/uv
.graphiti-mcp/: Graphiti MCP server installation.graphiti-mcp/.env: Environment configuration.graphiti-mcp/docker-compose.neo4j-only.yml: Neo4j Docker setup~/.config/claude-desktop/claude_desktop_config.json: Claude Desktop MCP configuration
With Graphiti MCP server integrated:
- Project Memory: Claude remembers project details across sessions
- Relationship Mapping: Automatically connects related concepts and entities
- Temporal Context: Tracks when information was added and how it evolves
- Enhanced Reasoning: Can traverse knowledge graph for better context-aware responses