Palace MCP Quickstart

Source basis: Palace of Truth README.md, docs/mcp-server.md, docs/palace-oauth-scope-catalog.md, docs/palace-oauth-mcp-runtime-rollout.md, third_party_plugins/agent_clients/palaceoftruth-memory/README.md, and the Hermes plugin manifest, reviewed through commit 62b4328 on July 9, 2026.

Palace ships a repo-owned MCP adapter for Codex and other MCP-capable agents. It exposes the same scoped memory, startup context, semantic recall, provenance, and read-only inspection contract as the Palace REST service.

Choose A Transport

RuntimePreferred transportAuth boundary
Local Codex or repo-owned agentstdioTenant key supplied through the local runtime environment
Deployed or shared agent runtimeStreamable HTTPOAuth protected-resource discovery and capability-scoped token
Legacy server-side integrationREST or MCP with API keyExplicit X-MCP-Scope and narrow X-MCP-Scopes headers

Remote OAuth binds clients to the intended Palace resource and tenant. It is the public default for shared runtimes; do not put admin secrets or unrestricted shared keys into agent configuration.

Use Explicit Memory Scopes

Default scope configuration can reduce repeated arguments, but a caller-provided scope still needs to pass server authorization. Delegated cross-agent reads are deny-by-default and require a server-side policy; an agent cannot grant itself wider access in a request.

Start With Wakeup Context

Use get_wakeup_context when an agent begins a session. It returns bounded startup summaries, checkpoint pointers, trust labels, warnings, and safe next probes.

Then use:

See Source-backed wakeup for trust-state behavior.

Semantic Recall

Current Palace semantic recall is exposed through REST, MCP, and the Hermes memory plugin. The contract includes:

Hermes plugin 1.0.24 includes a semantic recall tool and optional pre-turn recall. Mission-steered retention can preserve relevant operational facts. Reflection is separate, opt-in, and review-gated; generated candidates do not enter canonical recall automatically.

Non-Destructive Verification

Run the repo setup verifier before changing local Codex configuration:

uv run python scripts/setup_codex_palace_memory.py \
  --api-base-url https://api.palaceoftruth.test

The default is a non-mutating dry run. Add --check for a read-only installed-state report. Add --live-smoke only when the tenant key is already available and one bounded agent/codex memory write is expected.

Compatibility smoke tooling can verify:

Live write smokes do not authorize cleanup, deletion, restore, admin registration, or hidden cross-agent access.

OAuth And API-Key Boundaries

OAuth discovery routes advertise the protected Palace MCP resource and authorization server metadata for remote clients. Capability scopes are centralized and applied across MCP and REST route families.

Raw API-key clients remain supported where documented, but memory reads must send X-MCP-Scope: read. Writes must send X-MCP-Scope: write plus a narrow grant such as write:agent, write:workspace, or write:session in X-MCP-Scopes.

If auth fails, fix the tenant runtime or MCP client credential. Never work around a 401 or 403 by giving an agent an admin secret.