Skip to content

feat: add MemPalace MCP integration as optional Docker overlay#752

Open
thucpru wants to merge 1 commit intonextlevelbuilder:devfrom
thucpru:feat/mempalace-mcp-integration
Open

feat: add MemPalace MCP integration as optional Docker overlay#752
thucpru wants to merge 1 commit intonextlevelbuilder:devfrom
thucpru:feat/mempalace-mcp-integration

Conversation

@thucpru
Copy link
Copy Markdown

@thucpru thucpru commented Apr 8, 2026

Summary

  • Add MemPalace as an optional MCP server integration via Docker Compose overlay
  • MemPalace provides AI memory with palace architecture (wings/rooms/halls), semantic search via ChromaDB, temporal knowledge graph, and AAAK compression — 96.6% R@5 on LongMemEval, local-only, zero API calls
  • Runs as a Debian-slim sidecar container connected via streamable-http MCP transport
  • DB-backed MCP server registration (visible in admin dashboard) with auto-grants to all agents
  • 19 MCP tools available to agents with mempalace__ prefix

Changes

File Change
docker/Dockerfile.mempalace Sidecar Dockerfile (Python 3.12-slim + mempalace + supergateway)
docker-compose.mempalace.yml Compose overlay with sidecar, volume, init script
scripts/mempalace-init.sh DB registration, palace init, auto-grant agents
Makefile WITH_MEMPALACE flag
docker-compose.yml Comment documenting the overlay
docs/25-mempalace-integration.md Full integration documentation
internal/tools/policy.go Register mempalace as known MCP prefix
internal/agent/resolver.go Fix: include config-based MCP tools in agent tool list

Usage

make up WITH_MEMPALACE=1

Architecture

GoClaw Container          MemPalace Sidecar
┌──────────────┐          ┌────────────────┐
│ GoClaw       │◄── MCP ──► supergateway   │
│ Gateway      │  (HTTP)  │  (stdio→HTTP)  │
└──────┬───────┘          └──────┬─────────┘
       │ pgvector                │ stdio
       ▼                         ▼
┌──────────────┐          ┌────────────────┐
│ PostgreSQL   │          │ MemPalace MCP  │
└──────────────┘          │ ChromaDB+SQLite│
                          └────────────────┘

Non-breaking

  • Additive only: no existing behavior changed (resolver fix is backward-compatible)
  • All changes gated behind WITH_MEMPALACE=1 / docker-compose.mempalace.yml
  • Existing agents, memory, and config unaffected when overlay is not active

Test plan

  • Docker build succeeds (docker-compose.mempalace.yml)
  • All 3 containers healthy (goclaw, mempalace, postgres)
  • MemPalace registered in mcp_servers table
  • Agent grants created automatically
  • 19 MCP tools discovered via API (/v1/mcp/servers/{id}/tools)
  • Palace data persists across container restarts (mempalace-data volume)
  • No impact when overlay is not active

🤖 Generated with Claude Code

Add MemPalace (https://github.com/milla-jovovich/mempalace) as an optional
sidecar service providing 19 MCP tools for structured AI memory with palace
architecture (wings/rooms/halls), ChromaDB semantic search, temporal knowledge
graph, and AAAK compression. All local, zero API calls.

Changes:
- docker-compose.mempalace.yml: sidecar overlay with Debian-slim container
- docker/Dockerfile.mempalace: mempalace + supergateway (stdio→streamable-http)
- scripts/mempalace-init.sh: auto-registers MCP server in DB + grants to agents
- Makefile: WITH_MEMPALACE flag
- docker-compose.yml: added overlay comment
- internal/tools/policy.go: HasMCPGroup() for config-based MCP tool detection
- internal/agent/resolver.go: ensure config-based MCP tools are accessible
- docs/25-mempalace-integration.md: full documentation

Usage: make up WITH_MEMPALACE=1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@thucpru thucpru force-pushed the feat/mempalace-mcp-integration branch from 14717fe to 575d774 Compare April 8, 2026 07:46
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.

1 participant