Memory MCP Server (Go)

by okooo5km

93 582 downloads Not rated yet

About

A Model Context Protocol server that provides knowledge graph management capabilities.

Explore

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 or OAuth 2.1 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

Go 1.24+
github.com/mark3labs/mcp-go v0.19.0+

  • modernc.org/sqlite (pure Go SQLite, no CGO)


curl -fsSL https://raw.githubusercontent.com/okooo5km/memory-mcp-server-go/main/scripts/install.sh | bash

Options: -v v0.2.3 for a specific version, -d /usr/local/bin for a custom directory.

OAUTH_USER=admin OAUTH_PASS=secret OAUTH_STORE_PATH=/var/lib/mms/oauth.db \
OAUTH_REFRESH_REPLAY_GRACE=24h \
mms --transport http --oauth-issuer https://mcp.example.com


Then in Claude Desktop: Settings → Connectors → Add Custom Connector → enter your server URL (e.g., https://mcp.example.com/mcp). Claude will automatically discover the OAuth endpoints and prompt you to log in.

The Streamable HTTP endpoint accepts JSON-RPC requests, notifications, and
responses. Client responses such as replies to server ping messages are
acknowledged with 202 Accepted and no body, per the MCP transport spec.

bash

- Deploy behind TLS (Nginx/Caddy/Traefik), bind server to localhost
- Simple auth: Use --auth-bearer $(openssl rand -hex 32) for programmatic clients
- OAuth 2.1: Use --oauth-user/--oauth-pass for browser-based login (Claude Desktop Connectors). Set --oauth-store in production so registered clients and tokens survive restarts, and run the service with a restrictive umask such as systemd UMask=0077 to protect SQLite WAL/SHM files. Supports PKCE (S256), dynamic client registration, durable token storage, and refresh token rotation with a replay grace window for concurrent or multi-worker clients. Use --oauth-refresh-replay-grace for clients that keep stale refresh tokens in multiple processes
- Forward Authorization header from reverse proxy to backend; set --oauth-issuer to the public URL when behind a proxy
- Run as non-root, open only required ports, enable rate limiting for untrusted clients

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"}}}'

> 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.

Go Platform
License

Features

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 or OAuth 2.1 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

Available Tools

Core CRUD

| 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 |

Query

| 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) |

Entity Management

| 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 |

MCP Resources

| 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 |

MCP Prompts

| 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 |

Installation

Homebrew (macOS/Linux)

brew install okooo5km/tap/mms

Quick Install Script (macOS/Linux)

curl -fsSL https://raw.githubusercontent.com/okooo5km/memory-mcp-server-go/main/scripts/install.sh | bash

Options: -v v0.2.3 for a specific version, -d /usr/local/bin for a custom directory.

Pre-built Binaries

Download from GitHub Releases. Available for macOS (arm64/amd64), Linux (arm64/amd64), and Windows (arm64/amd64).

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about Memory MCP Server (Go)

Relevant YouTube tutorials, setups, and demos