Memory MCP Server (Go)

Memory MCP Server (Go)

memory-mcp-server-go•byokooo5km

A Model Context Protocol server implemented in Go that provides persistent knowledge graph memory management for AI assistants.

License: MIT•Runtime: Awaiting documentation review•Category: ai agents-models

WHAT IT DOES

  • •Creates and manages entities, relations, and observations in a persistent knowledge graph via MCP tools.
  • •Provides advanced search using FTS5 full-text search with BM25 ranking, synonym expansion, and 1-hop graph traversal of related entities.
  • •Exposes MCP resources such as graph summaries and type enumerations, along with guided memory prompts.
  • •Supports stdio, SSE, and Streamable HTTP transports with optional Bearer or OAuth 2.1 authentication.

BEST FOR

  • •Giving AI assistants persistent memory across conversations through a knowledge graph.
  • •Deploying a remote, self-hosted memory server with OAuth 2.1 authentication for browser-based MCP clients.
  • •Deduplicating and maintaining memory data by merging duplicate entities and detecting conflicting observations.

ABOUT MEMORY-MCP-SERVER-GO

Memory MCP Server (Go) is cataloged as an MCP server attributed to okooo5km. A Model Context Protocol server implemented in Go that provides persistent knowledge graph memory management for AI assistants. It is categorized under ai agents-models. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Memory MCP Server (Go) are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What persistent storage does the server use?

It uses a SQLite backend with WAL mode and read/write connection separation, and can automatically migrate from legacy JSONL storage to SQLite.

Can observations track extra metadata?

Yes, each observation can record metadata such as source, confidence, and tags.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 2b4ea4c57a28 · 采集于 2026-11-13 09:29:17 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Memory MCP Server (Go)

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

ToolDescription
create_entitiesCreate new entities with name, type, and observations
create_relationsCreate relations between entities (active voice)
add_observationsAdd observations to existing entities
delete_entitiesDelete entities and their associated relations
delete_relationsDelete specific relations
delete_observationsDelete specific observations from entities

Query

ToolDescription
search_nodesSearch entities by keyword with FTS5, synonym expansion, and graph traversal. Returns lightweight results with snippets and related entities
open_nodesGet full details of specific entities by exact name
read_graphGet graph overview (summary mode) or full export (full mode)

Entity Management

ToolDescription
merge_entitiesMerge two entities: migrate observations and relations from source to target, then delete source
update_entitiesChange an entity's type
update_observationsReplace an observation's content
detect_conflictsFind potential duplicates and contradictions within an entity's observations

MCP Resources

URIDescription
memory://graph/summaryGraph statistics and entity type distribution
memory://graph/typesAll entity and relation type enumerations
memory://entities/{name}Full details of a specific entity

MCP Prompts

PromptDescription
memory-recallRecall relevant memories by topic
memory-saveAnalyze conversation text and suggest what to save
memory-reviewGenerate 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).

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

Build from Source

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.

Command Line Arguments

mms [options]
  -t, --transport string   Transport: stdio, http (alias streamable-http) or sse
                           (env: MMS_TRANSPORT; default stdio, or http when a public URL is set)
  -m, --memory string      Memory file path (auto-detected if not specified)
  -p, --port int           Port for http/sse transports (env: MMS_PORT, default 8080)
  --host string            Host/IP to bind for http/sse (env: MMS_HOST; default all interfaces,
                           or 127.0.0.1 when a public URL is set)
  -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

  Deployment:
  --public-url string      Public base URL, e.g. https://mcp.example.com (env: MMS_PUBLIC_URL).
                           Becomes the OAuth issuer/resource and the only accepted Host (besides
                           loopback). When set, defaults to: http transport, host 127.0.0.1 and the
                           OAuth store at oauth.db next to the memory database

  Streamable HTTP:
  --http-endpoint string   HTTP endpoint path (env: MMS_HTTP_ENDPOINT, default "/mcp")
  --http-heartbeat string  Server-to-client keepalive ping interval, e.g. 30s; 0 disables (default "0")
  --http-stateless         Stateless HTTP mode

  Auth:
  --auth-bearer string     Require Bearer token for http/sse (env: MMS_AUTH_BEARER)

  OAuth 2.1 (mutually exclusive with --auth-bearer):
  --oauth-user string      OAuth login username (env: OAUTH_USER)
  --oauth-pass string      OAuth login password (env: OAUTH_PASS; prefer the env var, argv is visible)
  --oauth-issuer string    Legacy: set only the OAuth issuer, with no other --public-url effects (env: OAUTH_ISSUER)
  --oauth-store string     SQLite path for durable OAuth clients and tokens (env: OAUTH_STORE_PATH)
  --oauth-refresh-replay-grace string
                           Duration to accept replay of a rotated refresh token (env: OAUTH_REFRESH_REPLAY_GRACE, default 75m)

  Reverse proxy:
  --trusted-proxies string Comma-separated CIDRs or IPs of reverse proxies whose X-Real-IP header is
                           trusted for login rate limiting (env: MMS_TRUSTED_PROXIES). Loopback is
                           always trusted. Needed when the proxy is in another container or host

  CORS:
  --cors-origin string     Allowed CORS origins: '*' for all, or comma-separated list (env: MMS_CORS_ORIGIN, default "*")

Flags win over environment variables. The server also serves GET /healthz (returns ok, no auth) on the http and sse transports.

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 (endpoint /sse)
mms --transport http --auth-bearer mytoken   # Streamable HTTP with Bearer auth
MMS_PUBLIC_URL=https://mcp.example.com OAUTH_USER=admin OAUTH_PASS='a-long-password' mms  # OAuth 2.1 behind a reverse proxy
mms --transport http --cors-origin "https://app.example.com,https://admin.example.com"  # CORS whitelist

Configuration

Claude Desktop / Claude.app

"mcpServers": {
  "memory": {
    "command": "mms",
    "env": {
      "MEMORY_FILE_PATH": "/path/to/memory.json"
    }
  }
}

Claude Desktop Connectors (OAuth)

For remote deployment with OAuth 2.1 authentication, compatible with Claude Desktop's Custom Connectors:

# Behind a reverse proxy: the public URL implies --transport http --host 127.0.0.1 and an OAuth store next to the memory database
MMS_PUBLIC_URL=https://mcp.example.com MMS_PORT=8080 
OAUTH_USER=admin OAUTH_PASS='a-long-password' MEMORY_FILE_PATH=/var/lib/mms/memory.db 
  mms

# Local trial without TLS
mms --transport http --host 127.0.0.1 --oauth-user admin --oauth-pass secret --oauth-store ./oauth.db

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.

Cursor

Add to Cursor Settings > mcp.json:

{
  "mcpServers": {
    "memory": {
      "command": "mms",
      "env": {
        "MEMORY_FILE_PATH": "/path/to/memory.json"
      }
    }
  }
}

Example System Prompt

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.

Streamable HTTP Usage

The Streamable HTTP endpoint is served by the official MCP Go SDK. It 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.

With --transport sse the legacy HTTP+SSE transport is served instead: connect to GET /sse; the server announces a session-specific message URL (/sse?sessionid=...) to POST to. The separate /message path of earlier releases no longer exists.

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

Security & Deployment

For AI agents: to deploy without the script (Docker, Caddy, Traefik, an existing nginx, Cloudflare Tunnel, bearer-only), follow doc/deploy-custom.md: runtime contract, recipes and an acceptance script (scripts/verify-deploy.sh).

One-line VPS deployment (nginx + Let's Encrypt + systemd, OAuth 2.1 login); see doc/deploy.md:

curl -fsSL https://raw.githubusercontent.com/okooo5km/memory-mcp-server-go/main/scripts/deploy-vps.sh | sudo bash -s -- --domain mcp.example.com --email me@example.com
  • Deploy behind TLS (Nginx/Caddy/Traefik), bind server to localhost
  • Public URL: set --public-url / MMS_PUBLIC_URL (for example https://mcp.example.com) when behind a proxy. It selects the http transport on 127.0.0.1, becomes the OAuth issuer and resource, and restricts /mcp, /sse and the OAuth routes to that Host (plus loopback); other hosts get 403. GET /healthz is exempt. Keep proxy_set_header Host $host in the proxy
  • DNS-rebinding protection: on a loopback listener without auth and without a public URL, requests with a non-loopback Host are rejected with 403; it is relaxed only when a token is required or a public URL is configured
  • Simple auth: Use --auth-bearer $(openssl rand -hex 32) (or MMS_AUTH_BEARER) for programmatic clients; the token is compared in constant time
  • OAuth 2.1: Use OAUTH_USER/OAUTH_PASS (preferred over --oauth-pass, argv is visible in the process list) for browser-based login (Claude Desktop Connectors). With a public URL the OAuth store defaults to oauth.db next to the memory database; otherwise set --oauth-store 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, required), resource indicators, dynamic client registration and Client ID Metadata Documents, durable token storage, token revocation, and refresh token rotation with a replay grace window for concurrent or multi-worker clients. See doc/oauth.md
  • Proxy in another container or host: the login rate limiter keys on the client address. It believes X-Real-IP only from loopback and from peers listed in --trusted-proxies / MMS_TRUSTED_PROXIES (CIDRs or IPs, e.g. 172.20.0.0/16); otherwise every user shares the proxy's address and five bad logins lock everybody out. X-Forwarded-For is never used. An invalid value is a startup error
  • Run as non-root, open only required ports, enable rate limiting for untrusted clients

Storage System

Storage Types

SQLite (Recommended)JSONL (Legacy)
Read/Search1.9x fasterBaseline
Memory1.9x more efficientBaseline
File SizeLarger3x smaller
StartupSlower55x faster
FeaturesFTS5, ACID, WAL, concurrent readsHuman-readable
Best For>100 entities<50 entities

Migration

# 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

Knowledge Graph Structure

  • 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

Usage Examples

Creating Entities

{
  "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"]
    }
  ]
}

Creating Relations

{
  "relations": [
    { "from": "John Smith", "to": "Acme Corp", "relationType": "works at" }
  ]
}

Searching with Graph Traversal

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

Merging Duplicate Entities

{
  "sourceName": "React.js",
  "targetName": "React"
}

Merges all observations and relations from "React.js" into "React", then deletes "React.js".

Detecting Conflicts

{
  "entityName": "John Smith"
}

Returns potential duplicates (>60% prefix overlap) and contradictions (antonym keyword pairs like "likes/dislikes").

Development

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

Requirements

  • Go 1.25+
  • github.com/modelcontextprotocol/go-sdk v1.8.0 (official MCP Go SDK)
  • modernc.org/sqlite (pure Go SQLite, no CGO)

Versioning

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

License

MIT License. See LICENSE for details.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Memory MCP Server (Go) from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/memory-mcp-server-go)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related ai agents-models MCP Servers

Alternative and complementary servers in the same category

View all in ai agents-models →
Knowledge Graph Memory
@modelcontextprotocol/server-memory•Model Context Protocol

Store and retrieve entities, relations and observations in a persistent local knowledge graph.

create_entitiescreate_relationsadd_observations+6 more
92K
AI & Multi-Agent
Sequential Thinking
@modelcontextprotocol/server-sequential-thinking•Model Context Protocol

Organize problem solving into revisable, branching thought steps through an MCP tool.

sequential_thinking
92K
AI & Multi-Agent

Query-aware context compression with an MCP plugin for coding agents, plus Python and HTTP interfaces for reducing the context sent to a language model.

146
AI & Multi-Agent