mempalace/website/guide
Igor Lins e Silva afd0428823
feat(serve): turnkey secure remote MCP server (#1877) (#1900)
* feat(serve): turnkey secure remote MCP server (#1877)

Add `mempalace serve`: a secure-by-default wrapper over the HTTP MCP
transport so a team can stand up a shared central palace with one
command.

Server capabilities (mempalace/mcp_server.py):
- Native TLS via --tls-cert/--tls-key (env MEMPALACE_MCP_TLS_CERT/_KEY):
  wraps the socket in a TLS 1.2+ context, validated before bind. Token
  is still required on a non-loopback bind (TLS != auth).
- Read-only mode via --read-only (env MEMPALACE_MCP_READ_ONLY): the 24
  mutating tools are hidden from tools/list and refused at dispatch
  (-32003), enforced before arg handling — not merely hidden.

Turnkey command (mempalace/cli.py):
- Auto-generates a strong bearer token for non-loopback binds, stored
  0600 under ~/.mempalace/server/ and printed once; reused across
  restarts. Token rides in the child env, never argv, so it can't leak
  via ps.
- Prints a ready-to-paste client config (scheme reflects TLS), then
  foreground-execs the real server so Docker/systemd own the lifecycle.

Deployment (deploy/):
- docker-compose.server.yml wires the server + Qdrant with a /healthz
  healthcheck and persistent volumes.
- server.env.example documents the env surface.
- mempalace-server.service is a hardened systemd unit template.

Tests: TLS handshake (openssl-gated), read-only enforcement, token
autogen/0600/reuse, token-not-in-argv, secure-by-default gates.

Docs: remote-server guide now leads with `mempalace serve` plus Compose
and systemd subsections.

* test(serve): fix Windows — don't patch os.name; gate 0600 asserts to POSIX

Patching os.name to 'posix' broke Path.home() on Windows (pathlib mixed
POSIX home resolution with Windows drive parsing). Capture both exec
branches (os.execve + subprocess.run) instead, and guard the POSIX
permission-bit assertions behind os.name == 'posix' (Windows files
report 0o666).
2026-06-29 03:28:06 -03:00
..
antigravity.md fix(antigravity): resolve interpreter from console-script shebang 2026-05-31 10:41:09 +10:00
claude-code-retention.md docs: add Claude Code retention setup checklist 2026-05-08 13:05:34 -07:00
claude-code.md feat: add mempalace_checkpoint batch save tool 2026-06-22 13:41:15 +10:00
configuration.md fix(backups): add max_backups retention to bound backup disk usage 2026-06-05 14:52:06 -04:00
cursor-hooks.md feat: add mempalace-recall skill and optional Cursor recall rule 2026-06-10 15:40:35 +10:00
gemini-cli.md docs(install): recommend uv as the package manager 2026-05-08 01:38:00 -03:00
getting-started.md docs: make Codex MCP setup discoverable 2026-05-10 17:06:36 +04:00
hooks.md docs: add VitePress documentation site 2026-04-09 19:41:08 -03:00
local-models.md docs: add VitePress documentation site 2026-04-09 19:41:08 -03:00
mcp-integration.md feat: add mempalace_checkpoint batch save tool 2026-06-22 13:41:15 +10:00
mining.md docs: add VitePress documentation site 2026-04-09 19:41:08 -03:00
openclaw.md feat: add mempalace_checkpoint batch save tool 2026-06-22 13:41:15 +10:00
remote-server.md feat(serve): turnkey secure remote MCP server (#1877) (#1900) 2026-06-29 03:28:06 -03:00
searching.md docs(website): align mempalaceofficial.com with honest benchmarks 2026-04-14 21:37:45 -03:00