Skip to content

atlas memory slice 3: MCP query surface over the unified Atlas index (mcpx namespace) (#8567) #8625

Open

Description

@developing-today

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.

Activity

  1. added
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    on Nov 11, 2026
  2. added
    design/atlas-memory-integrationDesign: atlas-memory-integration - all issues of this effort carry it
    epic/atlasEpic: atlas - all issues of this effort carry it
    on Nov 12, 2026
  3. added this to the Atlas program milestone on Nov 12, 2026
  4. dezren39 commented on Nov 17, 2026

    @dezren39
    Member

    🤖 Agent note · blocked (dependency)

  5. removed their assignment
    on Nov 20, 2026
  6. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    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:

    • 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.

  7. added 4 commits that reference this issue on Nov 23, 2026
  8. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    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.

    Code (all merged to main)

    Deployment (fleet Cloudflare account, sanctioned cf binary only)

    • 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).
    • Deployment a1b13a53-12cb-4a54-8b36-c971df528fb3 at 100%. Previous version Bump build/buck/preludes/buck2-prelude from 3a02ea3 to 4371899 #6 (b8682c0b) remains for rollback (redeploy its id, no upload).
    • Endpoint: https://atlas-search.developing-today.workers.dev/mcp.

    Verification (from the laptop, key lines)

    • GET /health → {"status":"ok","service":"atlas-search-worker"}; POST /mcp without 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".
    • 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.

  9. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    Triage verdict — Lane EU (archer), 2026-11-22

    Fresh state verified this pass (gh REST):

    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.

  10. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    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.

  11. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    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:

    Queue task 21122 is therefore complete-by-prior-work; #8625 stays open on the blocked remainder, which unblocks when #8622 (then #8623) land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    design/atlas-memory-integrationDesign: atlas-memory-integration - all issues of this effort carry itepic/atlasEpic: atlas - all issues of this effort carry itepic/atlas-programReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingqueue/blockedQueue or user escalation statestatus/blockedQueue or user escalation state

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions