Memory MCP Worker
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.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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
Related MCP server: SkyBrain
Quick Start
1. Install Dependencies
npm install2. Create D1 Database
# Create the database
wrangler d1 create memory-graph
# Copy the database_id from output to wrangler.toml3. Run Migrations
# Local development
npm run db:migrate:local
# Production
npm run db:migrate4. Deploy
npm run deploy5. Set API Key Secret
# Generate an API key
openssl rand -base64 32 | tr -d '/+=' | head -c 32
# Add as secret
echo "YOUR_API_KEY" | npx wrangler secret put API_KEY6. Configure Claude Code
Add to your ~/.claude/settings.json or .mcp.json:
{
"mcpServers": {
"memory-remote": {
"type": "http",
"url": "https://memory-mcp.45black-limited.workers.dev/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}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:
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://memory-mcp.45black-limited.workers.dev';
const headers = {
'Content-Type': 'application/json',
'X-API-Key': API_KEY,
};
// Search for a project
const response = await fetch(`${BASE_URL}/api/search?q=Household%20Planner`, { headers });
const data = await response.json();
// Add an observation
await fetch(`${BASE_URL}/api/entities/Household%20Planner/observations`, {
method: 'POST',
headers,
body: JSON.stringify({
contents: ['Added new budget category feature']
})
});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:
curl -X POST https://your-n8n-instance/webhook/memory-search \
-H "Content-Type: application/json" \
-d '{"query": "Household Planner"}'Get Entity - POST to /webhook/memory-entity:
curl -X POST https://your-n8n-instance/webhook/memory-entity \
-H "Content-Type: application/json" \
-d '{"name": "Household Planner"}'Get Full Graph - POST to /webhook/memory-graph:
curl -X POST https://your-n8n-instance/webhook/memory-graph \
-H "Content-Type: application/json" \
-d '{}'Create Entity - POST to /webhook/memory-create:
curl -X POST https://your-n8n-instance/webhook/memory-create \
-H "Content-Type: application/json" \
-d '{"name": "My Project", "entityType": "Project", "observations": ["First observation"]}'Add Observations - POST to /webhook/memory-observations:
curl -X POST https://your-n8n-instance/webhook/memory-observations \
-H "Content-Type: application/json" \
-d '{"name": "My Project", "contents": ["New observation 1", "New observation 2"]}'Create Relation - POST to /webhook/memory-relations:
curl -X POST https://your-n8n-instance/webhook/memory-relations \
-H "Content-Type: application/json" \
-d '{"from": "Project A", "to": "Project B", "relationType": "depends_on"}'Delete Entity - POST to /webhook/memory-delete:
curl -X POST https://your-n8n-instance/webhook/memory-delete \
-H "Content-Type: application/json" \
-d '{"name": "Entity Name"}'Delete Relation - POST to /webhook/memory-delete-relation:
curl -X POST https://your-n8n-instance/webhook/memory-delete-relation \
-H "Content-Type: application/json" \
-d '{"from": "Entity A", "to": "Entity B", "relationType": "relation_type"}'Development
# Start local dev server
npm run dev
# Typecheck
npm run typecheckArchitecture
┌─────────────────────────────────────────┐
│ Cloudflare Worker │
│ memory-mcp.45black.workers.dev │
├─────────────────────────────────────────┤
│ Hono Framework │
│ ├── /api/* → REST API │
│ └── /mcp → MCP Protocol │
├─────────────────────────────────────────┤
│ Cloudflare D1 (SQLite) │
│ ├── entities │
│ ├── observations │
│ ├── relations │
│ └── observations_fts (full-text) │
└─────────────────────────────────────────┘Related MCP Connectors
Persistent, portable memory for AI assistants — your private memory graph, from any MCP client.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Personal knowledge graph as an AI memory layer over MCP - read, save, and link your memories.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA personal second brain on Cloudflare Workers that stores knowledge as a semantic graph with auto-linking, deduplication, and MCP tools for AI agents to save, search, and connect information.13 npm2MIT
- AlicenseNot gradedqualityDmaintenanceProvides a shared MCP memory layer for AI clients, backed by Cloudflare Workers and D1, enabling personal Markdown notes management.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceProvides persistent memory for MCP clients, enabling them to remember user preferences and behaviors across conversations using vector search and Cloudflare's infrastructure.9 npmMIT
- AlicenseAqualityAmaintenanceSelf-hosted long-term memory gateway for AI clients, deployed to your own Cloudflare account (Workers + D1 + Vectorize). It captures conversations, consolidates them overnight, and exposes MCP tools to search, recall and write memories from any MCP client.10144AGPL 3.0