A Model Context Protocol server that provides knowledge graph management capabilities. This server enables LLMs to create, read, update, and delete entities and relations in a persistent knowledge graph, helping AI assistants maintain memory across conversations. This is a Go implementation of the official TypeScript Memory MCP Server.
- High-Performance Storage: SQLite backend with WAL mode, read/write connection separation for concurrent access
- Knowledge Graph Management: Persistent graph of entities, relationships, and observations
- Advanced Search: FTS5 full-text search with BM25 ranking, synonym expansion, and time-decay scoring
- Graph Traversal: Search results include 1-hop related entities for richer context
- Entity Management: Merge duplicate entities, update types, modify observations, detect conflicts
- Observation Metadata: Track source, confidence, and tags for each observation
- MCP Resources & Prompts: AI clients can passively load graph summaries and use guided memory workflows
- Flexible Transport: Supports stdio, SSE, and Streamable HTTP with optional Bearer authentication
- Seamless Migration: Automatic upgrade from JSONL to SQLite with zero intervention
- Cross-Platform: Pure Go SQLite (no CGO required), works on Linux, macOS, and Windows
| Tool | Description |
|---|---|
create_entities |
Create new entities with name, type, and observations |
create_relations |
Create relations between entities (active voice) |
add_observations |
Add observations to existing entities |
delete_entities |
Delete entities and their associated relations |
delete_relations |
Delete specific relations |
delete_observations |
Delete specific observations from entities |
| Tool | Description |
|---|---|
search_nodes |
Search entities by keyword with FTS5, synonym expansion, and graph traversal. Returns lightweight results with snippets and related entities |
open_nodes |
Get full details of specific entities by exact name |
read_graph |
Get graph overview (summary mode) or full export (full mode) |
| Tool | Description |
|---|---|
merge_entities |
Merge two entities: migrate observations and relations from source to target, then delete source |
update_entities |
Change an entity's type |
update_observations |
Replace an observation's content |
detect_conflicts |
Find potential duplicates and contradictions within an entity's observations |
| URI | Description |
|---|---|
memory://graph/summary |
Graph statistics and entity type distribution |
memory://graph/recent |
Recently accessed entities |
memory://graph/types |
All entity and relation type enumerations |
memory://entities/{name} |
Full details of a specific entity |
| Prompt | Description |
|---|---|
memory-recall |
Recall relevant memories by topic |
memory-save |
Analyze conversation text and suggest what to save |
memory-review |
Generate a comprehensive review of an entity's memories |
brew install okooo5km/tap/mmscurl -fsSL https://raw.githubusercontent.com/okooo5km/memory-mcp-server-go/main/scripts/install.sh | bashOptions: -v v0.2.3 for a specific version, -d /usr/local/bin for a custom directory.
Download from GitHub Releases. Available for macOS (arm64/amd64), Linux (arm64/amd64), and Windows (arm64/amd64).
# Example: macOS Apple Silicon
curl -L https://github.com/okooo5km/memory-mcp-server-go/releases/latest/download/mms_VERSION_darwin_arm64.tar.gz | tar xz
chmod +x mms && mv mms ~/.local/bin/git clone https://github.com/okooo5km/memory-mcp-server-go.git
cd memory-mcp-server-go
make build # binary in .build/Make sure ~/.local/bin (or your chosen directory) is in your PATH.
mms [options]
-t, --transport string Transport type: stdio, sse, or http (default "stdio")
-m, --memory string Memory file path (auto-detected if not specified)
-p, --port int Port for SSE/HTTP transport (default 8080)
-v, --version Show version
Storage:
--storage string Force storage type: sqlite or jsonl (auto-detected)
--auto-migrate Auto-migrate JSONL to SQLite (default true)
Migration:
--migrate string Source JSONL file for manual migration
--migrate-to string Destination SQLite file
--dry-run Dry run migration
--force Overwrite destination
Streamable HTTP:
--http-endpoint string HTTP endpoint path (default "/mcp")
--http-heartbeat string Heartbeat interval (default "30s")
--http-stateless Stateless HTTP mode
Auth:
--auth-bearer string Require Bearer token for SSE/HTTP
CORS:
--cors-origin string Allowed CORS origins: '*' for all, or comma-separated list (default "*")
Examples:
mms # stdio, auto-detect storage
mms --memory /path/to/memory.json # custom path, auto-migrates to SQLite
mms --transport sse --port 9000 # SSE transport
mms --transport http --auth-bearer mytoken # Streamable HTTP with auth
mms --transport http --cors-origin "https://app.example.com,https://admin.example.com" # CORS whitelist"mcpServers": {
"memory": {
"command": "mms",
"env": {
"MEMORY_FILE_PATH": "/path/to/memory.json"
}
}
}Add to Cursor Settings > mcp.json:
{
"mcpServers": {
"memory": {
"command": "mms",
"env": {
"MEMORY_FILE_PATH": "/path/to/memory.json"
}
}
}
}You have access to a Knowledge Graph memory system that persists across conversations.
Saving memories:
- create_entities: Add new people, places, concepts (check search_nodes first to avoid duplicates)
- create_relations: Record how entities relate to each other
- add_observations: Add facts to existing entities
Retrieving memories:
- search_nodes: Find relevant entities by keyword (supports synonyms like JS→JavaScript)
- open_nodes: Get full details of specific entities
- read_graph: Get an overview of all stored knowledge (use "summary" mode first)
Managing memories:
- merge_entities: Combine duplicate entities
- detect_conflicts: Find contradictory observations
- update_entities / update_observations: Fix incorrect data
Always check your memory before answering questions that might require past context.
# 1. Initialize session
curl -i -X POST http://localhost:8080/mcp \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer mytoken' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{}}}'
# 2. Listen for server messages
curl -N http://localhost:8080/mcp \
-H 'Authorization: Bearer mytoken' \
-H 'Mcp-Session-Id: <session-id>'
# 3. Call a tool
curl -s http://localhost:8080/mcp \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer mytoken' \
-H 'Mcp-Session-Id: <session-id>' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_nodes","arguments":{"query":"idea"}}}'
# 4. Terminate session
curl -X DELETE http://localhost:8080/mcp \
-H 'Authorization: Bearer mytoken' \
-H 'Mcp-Session-Id: <session-id>'- Deploy behind TLS (Nginx/Caddy/Traefik), bind server to localhost
- Use
--auth-bearer $(openssl rand -hex 32)in any non-local environment - Forward
Authorizationheader from reverse proxy to backend - Run as non-root, open only required ports, enable rate limiting for untrusted clients
| SQLite (Recommended) | JSONL (Legacy) | |
|---|---|---|
| Read/Search | 1.9x faster | Baseline |
| Memory | 1.9x more efficient | Baseline |
| File Size | Larger | 3x smaller |
| Startup | Slower | 55x faster |
| Features | FTS5, ACID, WAL, concurrent reads | Human-readable |
| Best For | >100 entities | <50 entities |
# Automatic (default): just use your existing JSONL path
mms --memory /path/to/memory.json # auto-migrates to .db
# Manual migration
mms --migrate /path/to/memory.json --migrate-to /path/to/memory.db
# Dry run
mms --migrate /path/to/memory.json --dry-run- Entities: Nodes with a name, type, and list of observations (each with optional metadata: source, confidence, tags)
- Relations: Directed edges between entities with a relation type in active voice
- Observations: Atomic facts associated with entities, supporting time-decay ranking based on access patterns
{
"entities": [
{
"name": "John Smith",
"entityType": "person",
"observations": ["Software engineer", "Lives in San Francisco", "Enjoys hiking"]
},
{
"name": "Acme Corp",
"entityType": "company",
"observations": ["Founded in 2010", "Tech startup"]
}
]
}{
"relations": [
{ "from": "John Smith", "to": "Acme Corp", "relationType": "works at" }
]
}Search for "John" returns:
- Direct hits: Entities matching "John" with observation snippets
- Related entities: Entities connected to "John" via relations (e.g., "Acme Corp" via "works at")
{
"sourceName": "React.js",
"targetName": "React"
}Merges all observations and relations from "React.js" into "React", then deletes "React.js".
{
"entityName": "John Smith"
}Returns potential duplicates (>60% prefix overlap) and contradictions (antonym keyword pairs like "likes/dislikes").
make fmt # Format code
make check # Static analysis (gofmt + go vet)
go test ./... # Run tests
make build # Build binary
# Full verification
make fmt && make check && go test ./... && make build- Go 1.24+
- github.com/mark3labs/mcp-go v0.19.0+
- modernc.org/sqlite (pure Go SQLite, no CGO)
Version is managed via the VERSION file. Override with make build VERSION=1.2.3 or go build -ldflags "-X main.version=1.2.3".
MIT License. See LICENSE for details.