You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
atlas memory slice 3: MCP query surface over the unified Atlas index (mcpx namespace) (#8567) #8625
Slice 3 of the Atlas memory integration (parent #8567; design record: pkgs/atlas-search/docs/memory-integration-design-8567.md, sections 3–4).
Expose the cross-agent query surface as an MCP server (an mcpx namespace) in front of atlas-core run_search — the design's decided access pattern. The MCP layer stamps the calling agent's identity, enforces its sensitivity ceiling and corpus scoping (filters inside the branch queries, never post-ranking), and audit-logs queries. Native library access stays Atlas-internal only.
Acceptance:
OpenClaw, an OpenCode session, OpenChamber, and a Muse lane can each query the unified index through the namespace with their own identity and ceiling.
A caller cannot retrieve chunks above its sensitivity ceiling or outside its corpus scope (negative tests named).
Every hit carries corpus + source_ref provenance; queries are audit-logged with agent identity.
Re-check: the queue re-checks these dependencies on its own clock; when both close, this task becomes claimable again and the MCP namespace work starts against the landed index.
Labels: queue/blocked + status/blocked added with this note; kind/design, epic/atlas stand.
Taking the hosted-transport slice of this issue under Drew's direct order (2026-11-22 ~20:32 CST): build the Atlas MCP server as a versioned Cloudflare deployment and wire it into the laptop's mcpx as a remote server.
Scope of this slice, precisely:
Extend the existing atlas-search Worker (pkgs/atlas-search/worker, fleet CF account) with an MCP Streamable HTTP endpoint (POST /mcp) exposing one tool, search, over the exact same gated path as POST /v1/search — same GATE_TOKEN gate, same per-query Durable Object cache, same pinned hosted-per-user context (atlas(worker): state the disclosure context on hosted search requests and key the result cache by it #12622) and personal ceiling. No new surface beyond search: cache purge is a write and cache inspect is an operator/audit surface, so both stay off MCP.
Deploy as a NEW Worker version via the sanctioned cf binary (cf workers versions create + deployments create), with the prior version retained for rollback.
Wire mcpx: native remote-server entry in home/common/mcpx-settings.nix with a bearer auth block whose token expands from the daemon environment (${ATLAS_SEARCH_GATE_TOKEN} — no secret in the repo); the daemon gets the variable through services.mcpx.environmentFile, provisioned from the fleet secrets route (atlas.search-worker-gate-token).
What this does NOT close in #8625's acceptance: per-calling-agent identity stamping, per-agent ceilings/corpus scoping inside the branch queries, and the query audit log. Callers through this endpoint share the one hosted identity (hosted-per-user, ceiling personal) — the same identity the existing /v1/search surface already serves. Those acceptance parts remain open and are the next slices.
Hosted MCP transport — landed (Lane BT, Drew's order 2026-11-22)
The hosted half of this issue is built, deployed, and wired. What remains open is listed at the end — this issue stays open on those rows.
Design
Transport: MCP Streamable HTTP, stateless (no session id), added to the existing atlas-search Worker as POST /mcp — not a sibling worker, so the MCP surface inherits the Worker's gate, cache, and context pinning by construction. Non-POST → 405 with Allow: POST; notifications → HTTP 202 empty body; batches supported; protocol versions 2024-11-05 / 2025-03-26 / 2025-06-18 negotiated at initialize.
One tool: search ({query, k?}, read-only/idempotent annotations). Cache purge is a write and cache inspect is an operator/audit surface, so neither became a tool.
One execution path: the search execution moved to src/search.ts (executeSearch); the REST route and the MCP endpoint both call it — same gate, same pinned hosted-per-user context (atlas(worker): state the disclosure context on hosted search requests and key the result cache by it #12622) and personal ceiling, same per-query Durable Object cache. A test pins that an MCP search and a REST repeat of the same query share one cache entry (miss → hit), and that the service request on an MCP-originated call states the pinned context.
Auth: the existing GATE_TOKEN bearer gate, checked before JSON-RPC dispatch — the same credential the REST surface already uses (fleet secret atlas.search-worker-gate-token). No new public surface and no new credential: without the token the endpoint is a 401. Callers share the one hosted identity, exactly as the REST surface serves today.
Version 4e5f9d92-0672-492e-9199-2d0dd7b986aa, tag git-f8e14e0a86a8, uploaded via cf workers versions create --secrets-file … (the four secrets assembled from fleet secrets by name into a throwaway file, deleted after upload; the upload's binding list confirms QUERY_CACHE DO, SERVICE_BASE, and all four secrets present).
Through mcpx (scratch daemon running the exact merged server entry, token expanded from its environment): mcpx ls → atlas 1 tool LIVE 1 running; daemon log warm atlas ok in 592ms; mcpx call atlas.search {"query":"fleet queue broker","k":2} → envelope with cache: miss, effective_ceiling: "personal", filters_applied.max_sensitivity: "personal", real hits.
mcpx wiring
Durable: PR feat(mcpx): wire the atlas MCP server into the laptop daemon (#8625) #12809 — home/common/mcpx-settings.nix gains the atlas remote server (bearer auth as the literal ${ATLAS_SEARCH_GATE_TOKEN}, expanded by the daemon at runtime per pkgs/mcpx internal/mcpauth); home/common/default.nix sets services.mcpx.environmentFile to ~/.config/mcpx/env.
Provisioned: ~/.config/mcpx/env (mode 600) holds ATLAS_SEARCH_GATE_TOKEN from the fleet secret; the module never copies it into the store.
Activation: the live daemon takes the entry on the laptop's normal switch cadence (mcpxDeploy handover) — deliberately not forced from this lane. Until that switch, the endpoint is reachable directly and through any mcpx daemon started with the variable set (as verified above).
Remaining on this issue (unchanged scope)
Per-calling-agent identity stamping (the design's branch + Idempotency-Key slice), per-agent ceilings / corpus scoping inside branch queries, and the query audit log. Callers of the hosted endpoint share the hosted-per-user identity until those land.
Remaining acceptance rows (unchanged, per BT's record): per-calling-agent identity stamping (the design's branch + Idempotency-Key slice), per-agent sensitivity ceilings and corpus scoping inside the branch queries, and the query audit log with agent identity. The four-surface acceptance (OpenClaw, an OpenCode session, OpenChamber, a Muse lane — each with its own identity and ceiling, with named negative tests) presupposes the unified multi-corpus index: the ceilings and corpus scopes are defined over the corpus registry and unified embeddings.
Verdict: issue correctly stays OPEN; status/blocked + queue/blocked labels remain accurate. No live claim conflicts with the remaining scope (BT's claim was scoped to the hosted transport and is complete).
Routing: a scoped follow-on packet for the remaining scope (identity stamping, per-agent ceilings/corpus scoping in branch queries, audit log, four-surface negative tests) is enqueued on repo-health-code-pilot and blocked on issues #8622 and #8623, so it surfaces for work the moment both slices close.
Routing update (Lane EU): the follow-on packet is queue task 21121 on repo-health-code-pilot (dedupe repo-health:v1:slice:developing-today/code:issue:8625:slice-1), now formally blocked on #8622 with a 900s dependency recheck; #8623 is named as the second dependency in the packet body and the block reason (the block verb accepts one formal issue dep). It will surface for work once the slices land.
Reconciliation — Lane FO (archer), queue task 21122
This task asked for a fresh triage verdict on #8625 plus a routed follow-on packet. That acceptance is already satisfied — no duplicate verdict needed:
Activity
dezren39 commentedon Nov 17, 2026
🤖 Agent note · blocked (dependency)
dezren39 commentedon Nov 23, 2026
Claim — Lane BT (archer), 2026-11-22
Taking the hosted-transport slice of this issue under Drew's direct order (2026-11-22 ~20:32 CST): build the Atlas MCP server as a versioned Cloudflare deployment and wire it into the laptop's mcpx as a remote server.
Scope of this slice, precisely:
atlas-searchWorker (pkgs/atlas-search/worker, fleet CF account) with an MCP Streamable HTTP endpoint (POST /mcp) exposing one tool,search, over the exact same gated path asPOST /v1/search— same GATE_TOKEN gate, same per-query Durable Object cache, same pinnedhosted-per-usercontext (atlas(worker): state the disclosure context on hosted search requests and key the result cache by it #12622) andpersonalceiling. No new surface beyond search: cache purge is a write and cache inspect is an operator/audit surface, so both stay off MCP.cfbinary (cf workers versions create+deployments create), with the prior version retained for rollback.home/common/mcpx-settings.nixwith a bearer auth block whose token expands from the daemon environment (${ATLAS_SEARCH_GATE_TOKEN}— no secret in the repo); the daemon gets the variable throughservices.mcpx.environmentFile, provisioned from the fleet secrets route (atlas.search-worker-gate-token).What this does NOT close in #8625's acceptance: per-calling-agent identity stamping, per-agent ceilings/corpus scoping inside the branch queries, and the query audit log. Callers through this endpoint share the one hosted identity (
hosted-per-user, ceilingpersonal) — the same identity the existing /v1/search surface already serves. Those acceptance parts remain open and are the next slices.Merge pull request #12785 from developing-today/archer-lane-bt/atlas-mcp
Merge pull request #12790 from developing-today/archer-lane-bt/atlas-…
Merge pull request #12794 from developing-today/archer-lane-bt/atlas-…
Merge pull request #12809 from developing-today/archer-lane-bt/atlas-…
dezren39 commentedon Nov 23, 2026
Hosted MCP transport — landed (Lane BT, Drew's order 2026-11-22)
The hosted half of this issue is built, deployed, and wired. What remains open is listed at the end — this issue stays open on those rows.
Design
POST /mcp— not a sibling worker, so the MCP surface inherits the Worker's gate, cache, and context pinning by construction. Non-POST → 405 withAllow: POST; notifications → HTTP 202 empty body; batches supported; protocol versions 2024-11-05 / 2025-03-26 / 2025-06-18 negotiated atinitialize.search({query, k?}, read-only/idempotent annotations). Cache purge is a write and cache inspect is an operator/audit surface, so neither became a tool.src/search.ts(executeSearch); the REST route and the MCP endpoint both call it — same gate, same pinnedhosted-per-usercontext (atlas(worker): state the disclosure context on hosted search requests and key the result cache by it #12622) andpersonalceiling, same per-query Durable Object cache. A test pins that an MCP search and a REST repeat of the same query share one cache entry (miss → hit), and that the service request on an MCP-originated call states the pinned context.GATE_TOKENbearer gate, checked before JSON-RPC dispatch — the same credential the REST surface already uses (fleet secretatlas.search-worker-gate-token). No new public surface and no new credential: without the token the endpoint is a 401. Callers share the one hosted identity, exactly as the REST surface serves today.Code (all merged to main)
9d37641a) —src/mcp.ts,src/search.ts,/mcproute,test/mcp.test.ts(7 tests). Full worker suite 31/31, typecheck clean.deeee7c5) —cloudflare.config.ts(cf versions-flow deploy source of truth, mirroring wrangler.toml) + README deploy section.f8e14e0a) — deploy toolchain deps:cf1.0.0-beta.20 devDependency, wrangler pin 4.59.1 → 4.152.0 (the cf delegate floor).30723235) — mcpx wiring (below).Deployment (fleet Cloudflare account, sanctioned
cfbinary only)4e5f9d92-0672-492e-9199-2d0dd7b986aa, taggit-f8e14e0a86a8, uploaded viacf workers versions create --secrets-file …(the four secrets assembled from fleet secrets by name into a throwaway file, deleted after upload; the upload's binding list confirmsQUERY_CACHEDO,SERVICE_BASE, and all four secrets present).a1b13a53-12cb-4a54-8b36-c971df528fb3at 100%. Previous version Bump build/buck/preludes/buck2-prelude from3a02ea3to4371899#6 (b8682c0b) remains for rollback (redeploy its id, no upload).https://atlas-search.developing-today.workers.dev/mcp.Verification (from the laptop, key lines)
GET /health→{"status":"ok","service":"atlas-search-worker"};POST /mcpwithout the gate → 401.initialize→protocolVersion "2025-03-26",serverInfo {name: "atlas-search", version: "0.1.0"}, capabilities{tools:{}}.tools/list→ one tool,search.tools/call search("fleet queue broker", k=3) →isError false,cache: miss,total_results: 3,effective_ceiling: "personal".mcpx ls→atlas 1 tool LIVE 1 running; daemon logwarm atlas ok in 592ms;mcpx call atlas.search {"query":"fleet queue broker","k":2}→ envelope withcache: miss,effective_ceiling: "personal",filters_applied.max_sensitivity: "personal", real hits.mcpx wiring
home/common/mcpx-settings.nixgains theatlasremote server (bearer auth as the literal${ATLAS_SEARCH_GATE_TOKEN}, expanded by the daemon at runtime per pkgs/mcpxinternal/mcpauth);home/common/default.nixsetsservices.mcpx.environmentFileto~/.config/mcpx/env.~/.config/mcpx/env(mode 600) holdsATLAS_SEARCH_GATE_TOKENfrom the fleet secret; the module never copies it into the store.Remaining on this issue (unchanged scope)
Per-calling-agent identity stamping (the design's
branch+Idempotency-Keyslice), per-agent ceilings / corpus scoping inside branch queries, and the query audit log. Callers of the hosted endpoint share thehosted-per-useridentity until those land.dezren39 commentedon Nov 23, 2026
Triage verdict — Lane EU (archer), 2026-11-22
Fresh state verified this pass (gh REST):
POST /mcp(onesearchtool, gate-token auth, same gated path as REST), deployed and verified end-to-end through mcpx — PRs feat(atlas-search): MCP endpoint on the search Worker (#8625) #12785, feat(atlas-search): cf versions-flow deploy config (#8625) #12790, build(atlas-search): cf deploy toolchain deps (#8625) #12794, feat(mcpx): wire the atlas MCP server into the laptop daemon (#8625) #12809. Endpoint:https://atlas-search.developing-today.workers.dev/mcp.branch+Idempotency-Keyslice), per-agent sensitivity ceilings and corpus scoping inside the branch queries, and the query audit log with agent identity. The four-surface acceptance (OpenClaw, an OpenCode session, OpenChamber, a Muse lane — each with its own identity and ceiling, with named negative tests) presupposes the unified multi-corpus index: the ceilings and corpus scopes are defined over the corpus registry and unified embeddings.status/blocked+queue/blockedlabels remain accurate. No live claim conflicts with the remaining scope (BT's claim was scoped to the hosted transport and is complete).Routing: a scoped follow-on packet for the remaining scope (identity stamping, per-agent ceilings/corpus scoping in branch queries, audit log, four-surface negative tests) is enqueued on repo-health-code-pilot and blocked on issues #8622 and #8623, so it surfaces for work the moment both slices close.
dezren39 commentedon Nov 23, 2026
Routing update (Lane EU): the follow-on packet is queue task 21121 on repo-health-code-pilot (dedupe
repo-health:v1:slice:developing-today/code:issue:8625:slice-1), now formally blocked on #8622 with a 900s dependency recheck; #8623 is named as the second dependency in the packet body and the block reason (the block verb accepts one formal issue dep). It will surface for work once the slices land.dezren39 commentedon Nov 23, 2026
Reconciliation — Lane FO (archer), queue task 21122
This task asked for a fresh triage verdict on #8625 plus a routed follow-on packet. That acceptance is already satisfied — no duplicate verdict needed:
blocked, formally blocked on atlas memory slice 1: corpus registry + memory-lancedb connector into Atlas staging (#8567) #8622 with atlas memory slice 2: embedding unification + per-corpus model identity and re-embed job (#8567) #8623 named as the second dependency.Queue task 21122 is therefore complete-by-prior-work; #8625 stays open on the blocked remainder, which unblocks when #8622 (then #8623) land.