loading…
Search for a command to run...
loading…
A serverless proxy for the Graphiti MCP server, enabling AI agents to maintain memory and context through Neo4j knowledge graphs, deployed on Cloudflare Workers
A serverless proxy for the Graphiti MCP server, enabling AI agents to maintain memory and context through Neo4j knowledge graphs, deployed on Cloudflare Workers.
GitHub Actions Workflow Status License
A Cloudflare Container Worker that serves as a proxy for the Graphiti MCP (Model Context Protocol) server, providing scalable, serverless access to AI agent memory capabilities through Neo4j-backed knowledge graphs.
Graphiti Cloud bridges the gap between AI applications and persistent memory by leveraging Cloudflare's new container service to host and proxy requests to a Graphiti MCP server. This enables AI agents to maintain context and memory across interactions using a powerful knowledge graph backend.

---
config:
theme: neutral
look: handDrawn
layout: dagre
---
flowchart TB
subgraph subGraph0["MCP-Enabled Clients"]
Cursor["Cursor IDE"]
Claude["Claude Desktop"]
MCPClient["Other MCP Clients"]
end
subgraph subGraph1["Cloudflare Edge"]
Worker["Graphiti Cloud Worker"]
Container["Graphiti MCP Container"]
CF["Cloudflare Infrastructure"]
end
subgraph subGraph2["External Services"]
Neo4j[("Neo4j Knowledge Graph")]
OpenAI["OpenAI API"]
end
Cursor --> Worker
Claude --> Worker
MCPClient --> Worker
Worker --> Container
Container --> Neo4j & OpenAI
Worker -.-> CF
Container -.-> CF
Cursor:::Aqua
Cursor:::Ash
Claude:::Pine
Claude:::Peach
Claude:::Ash
MCPClient:::Rose
MCPClient:::Ash
Worker:::Sky
Container:::Sky
CF:::Peach
Neo4j:::Sky
OpenAI:::Aqua
classDef Pine stroke-width:1px, stroke-dasharray:none, stroke:#254336, fill:#27654A, color:#FFFFFF
classDef Ash stroke-width:1px, stroke-dasharray:none, stroke:#999999, fill:#EEEEEE, color:#000000
classDef Rose stroke-width:1px, stroke-dasharray:none, stroke:#FF5978, fill:#FFDFE5, color:#8E2236
classDef Peach stroke-width:1px, stroke-dasharray:none, stroke:#FBB35A, fill:#FFEFDB, color:#8F632D
classDef Sky stroke-width:1px, stroke-dasharray:none, stroke:#374D7C, fill:#E2EBFF, color:#374D7C
classDef Aqua stroke-width:1px, stroke-dasharray:none, stroke:#46EDC8, fill:#DEFFF8, color:#378E7A
You'll need a Neo4j database to store the knowledge graph. Here are your options:
Neo4j AuraDB (Recommended) - Fully managed cloud service
Self-hosted Neo4j
Neo4j Desktop
Learn more about Neo4j: Neo4j is a graph database that stores data as nodes and relationships, making it perfect for knowledge graphs. Check out the Neo4j Graph Database Concepts guide.
git clone https://github.com/adam-paterson/graphiti-cloud.git
cd graphiti-cloud
pnpm install
.dev.vars:NEO4J_URI=neo4j://your-neo4j-instance:7687
NEO4J_USER=your-username
NEO4J_PASSWORD=your-password
OPENAI_API_KEY=your-openai-api-key
BEARER_TOKEN=your-secure-bearer-token
# Add each secret using wrangler
wrangler secret put NEO4J_URI
wrangler secret put NEO4J_USER
wrangler secret put NEO4J_PASSWORD
wrangler secret put OPENAI_API_KEY
wrangler secret put BEARER_TOKEN
Learn more: See the Cloudflare Workers Secrets documentation for detailed instructions on managing secrets.
Start the development server:
pnpm dev
The worker will be available at http://localhost:8787
For debugging the MCP protocol communication, you can use the official MCP Inspector:
# Install the MCP Inspector globally
npm install -g @modelcontextprotocol/inspector
# Start the inspector pointing to your local worker
mcp-inspector http://localhost:8787
This will open a web interface where you can:
Learn more: Check out the MCP Inspector documentation for advanced debugging techniques.
Deploy to Cloudflare:
wrangler deploy
The GraphitiMCPContainer class extends Cloudflare's Container with these configurations:
knowledge-graph-mcp:0.4.0| Variable | Description | Required | Example |
|---|---|---|---|
NEO4J_URI |
Neo4j database connection string | neo4j://localhost:7687 or neo4j+s://xxx.databases.neo4j.io |
|
NEO4J_USER |
Neo4j username | neo4j |
|
NEO4J_PASSWORD |
Neo4j password | your-secure-password |
|
OPENAI_API_KEY |
OpenAI API key for AI functionality | sk-... |
|
BEARER_TOKEN |
Bearer token for authentication | your-secure-bearer-token |
All requests are proxied to the Graphiti MCP container:
// Example client request
const response = await fetch('https://your-worker.your-subdomain.workers.dev/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
// MCP protocol request
})
})
Graphiti Cloud is designed to work with AI applications that support the MCP protocol:
import { MCPClient } from '@modelcontextprotocol/client'
const client = new MCPClient({
serverUrl: 'https://your-worker.your-subdomain.workers.dev/'
})
// Use the client to interact with the knowledge graph
await client.addMemory({
content: 'User prefers dark mode',
context: 'user-preferences'
})
graphiti-cloud/
├── src/
│ └── index.ts # Main worker and container logic
├── test/
│ ├── index.spec.ts # Test specifications
│ └── env.d.ts # Environment type definitions
├── wrangler.jsonc # Cloudflare Worker configuration
├── package.json # Project dependencies
└── README.md # This file
pnpm dev - Start development serverpnpm lint - Run ESLintpnpm types - Generate Wrangler typesCurrently, Cloudflare's test suite doesn't fully support containers. Integration testing is recommended using the deployed worker.
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureMIT License Adam Paterson
Built with using Cloudflare Workers and the power of knowledge graphs
Выполни в терминале:
claude mcp add cloudflare-grafitti-mcp-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.