Deploys as a Cloudflare Worker with D1 database backend, providing MCP protocol access and REST API endpoints for managing a knowledge graph with entities, observations, and relations.
Provides workflow integration for querying the memory API, supporting search, entity retrieval, and graph operations through HTTP Request nodes with webhook and manual triggers.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Memory MCP Workersearch for my project notes about the budget planning tool"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Memory MCP Worker
Cloudflare Worker implementing MCP protocol for cross-device memory/knowledge graph access.
Features
MCP Protocol Support: Works with Claude Code via HTTP transport
REST API: Access from mobile apps, desktop apps, n8n workflows
D1 Database: SQLite-based persistent storage
Full-text Search: Search across all observations
Quick Start
1. Install Dependencies
2. Create D1 Database
3. Run Migrations
4. Deploy
5. Set API Key Secret
6. Configure Claude Code
Add to your ~/.claude/settings.json or .mcp.json:
Migrating from Local Memory
Export your local memory:
claude -p "Use mcp__memory__read_graph and output the raw JSON result" > scripts/local-memory.jsonRun migration:
npx ts-node scripts/migrate-local-memory.ts
API Endpoints
REST API (for apps)
Endpoint | Method | Description |
| GET | List all entities |
| GET | Get entity with observations |
| POST | Create entity |
| POST | Add observations |
| GET | List all relations |
| POST | Create relation |
| GET | Search entities and observations |
| GET | Get full graph |
| POST | Bulk import |
MCP Protocol
Endpoint | Method | Description |
| POST | MCP JSON-RPC requests |
| GET | SSE connection for MCP |
MCP Tools Available
create_entities- Create new entitiescreate_relations- Create relations between entitiesadd_observations- Add observations to entitiesread_graph- Read entire knowledge graphsearch_nodes- Search by queryopen_nodes- Get specific nodes by namedelete_entities- Delete entitiesdelete_relations- Delete relations
Authentication
All /api/* and /mcp/* endpoints require authentication via API key.
Headers supported:
X-API-Key: YOUR_API_KEYAuthorization: Bearer YOUR_API_KEY
The health check endpoint (/) is public.
Mobile App Integration
Example fetch from a mobile app:
n8n Integration
An n8n workflow is included for querying the Memory API via webhooks.
Setup
Import
n8n-workflow-memory-api.jsoninto n8nCreate a "Header Auth" credential:
Name:
Memory MCP API KeyHeader Name:
X-API-KeyHeader Value:
YOUR_API_KEY
Assign the credential to all three HTTP Request nodes
Activate the workflow
Endpoints
Search - POST to /webhook/memory-search:
Get Entity - POST to /webhook/memory-entity:
Get Full Graph - POST to /webhook/memory-graph:
Create Entity - POST to /webhook/memory-create:
Add Observations - POST to /webhook/memory-observations:
Create Relation - POST to /webhook/memory-relations:
Delete Entity - POST to /webhook/memory-delete:
Delete Relation - POST to /webhook/memory-delete-relation: