Skip to content

feat(mcp): add built-in memory server - #126

Open
Grivn wants to merge 4 commits into
masterfrom
codex/mcp-server-124
Open

feat(mcp): add built-in memory server#126
Grivn wants to merge 4 commits into
masterfrom
codex/mcp-server-124

Conversation

@Grivn

@Grivn Grivn commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • share Memory application operations between the CLI and protocol transports
  • add mnemon mcp serve, a JSON-RPC 2.0 stdio server built on the official Go MCP SDK
  • expose bounded recall, search, remember, related, link, and status tools with compact-by-default results and full output support
  • document client configuration, read-only operation, protocol behavior, and MCP contribution scope in English and Chinese

The SDK is pinned to the newest stable release compatible with this repository's Go 1.24 toolchain.

Validation

  • make test
  • make test-integration (167 CLI E2E cases plus timing, race, process, and Docker boundaries)
  • go test -race ./internal/mcp ./internal/memory/service ./cmd/mcp ./cmd/memory -count=1
  • go build -o mnemon .
  • real OpenCode 1.18.3 + DeepSeek V4 Flash agent run over stdio MCP, exercising all six tools; independently verified persisted memories, causal traversal, status totals, and remote audit redaction

Release note

Mnemon can now run as a built-in stdio MCP server for agent runtimes via mnemon mcp serve.

Closes #124

Grivn added 4 commits August 31, 2026 21:19
Move recall, search, remember, related, link, and status into a concurrency-safe application service so command and protocol adapters use one semantic path. Keep remote natural-language content out of the oplog and make bidirectional link writes atomic.

Validation: umask 022 make test; go test -race ./internal/memory/service ./cmd/memory -count=1; go build -o mnemon .
Expose recall, search, remember, related, link, and status through the official MCP Go SDK with bounded schemas, protocol negotiation, and compact-by-default results. Keep the adapter on the shared Memory application service and preserve one mnemon executable.

Validated with make test, targeted process E2E, go vet, and race-enabled MCP and Memory service tests.
Add stdio client configuration, tool contracts, safety limits, read-only behavior, and the shared-engine model to the English and Chinese guides. Expand the contribution scope to include MCP clients.
Keep empty tags, entities, candidate lists, and auto-prune IDs present for successful writes while retaining the compact duplicate response. This preserves the pre-service-refactor CLI wire contract.

Validated with service, Memory CLI, MCP, process E2E, and the 167-case CLI integration suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: mnemon mcp serve — one MCP server instead of N per-harness integrations

1 participant