Skip to content

mcpx opencode v2 plugin: item (1) of #2841 — per-session tool filtering via session context hook (mcp.transform deviation) #5122

Closed

Description

@dezren39

Implementation issue for item (1) of #2841 (SET-REMAINDER of #1858, the set tracker). Filed by queue worker lane code-p, triage task 8566, 2026-11-03.

Decision recorded (worker review, 2026-11-03)

Item (1) as originally worded — register a filtered MCP server set per session via mcp.transform — is not implementable on the pinned opencode v2 surface. Verified across tasks 3997 and 6867 and re-verified at current main by task 8566:

  • The pinned mcp.transform editor (packages/plugin/src/promise/mcp.ts:6-16) is synchronous and location-wide, with no session ID.
  • Host reconciliation changes shared connections (packages/core/src/mcp/index.ts:534-574), so a transform cannot own a per-session server set safely, and a blind implementation risks deleting or duplicating a user's hand-configured servers.

Decision: item (1) is dispositioned as a recorded deviation — the same closest-supported-equivalent treatment #2841 already sanctions for items (3) and (4). The landed equivalent is per-session filtering of model-visible mcpx tool definitions via session.hook("context") (packages/plugin/src/promise/session.ts:25-35; core filtering at packages/core/src/session/model-request.ts:249-275,300,406-407). This is explicitly not access control and not session-scoped registration: connections stay shared, and gateway/shell calls can bypass it. That limitation is part of the acceptance record, not a hidden gap.

Scope

  • In pkgs/mcpx/plugin/opencode/v2/: implement a context-hook filter that, per session, hides model-visible tool definitions for mcpx servers/tools the session's policy marks disabled.
  • Policy source: the plugin's existing per-session state only (ctx.storage remembered daemon choice / session-env) — the filter must close over asynchronously refreshed plugin state (the established pattern from v2/permission.ts), never query the daemon synchronously from the hook.
  • Filter only mcpx-namespaced tool definitions. Never mutate the location-wide MCP registry; never remove or alter user-configured servers.

Out of scope

Acceptance

Activity

  1. added
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/mMedium: expected under 1 day of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  3. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  4. 41 remaining items

  5. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 4, 2026
  6. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  7. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 4, 2026
  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. added a commit that references this issue on Nov 4, 2026
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/queue-workerFiled or worked by the queue/worker pilot

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions