Skip to content

2026 11 25 delivery inputs

kubed-io[bot] edited this page Nov 25, 2026 · 6 revisions

kubed-mcp's Resource Tools Plan

History. Drafted 2026-11-25 for #190 (PR #205). The upstream rows are quick-mcp#21's (quick-mcp PR #41, wiki pin fa309c5: DLV-1 to DLV-8 and DLV-16) and #22's (DLV-9 to DLV-15: X-MCP-Via, per-request instructions, delivery_default, the known-clients table). kubed-mcp 0.2.0rc2 carries #21 only. 0.2.0rc3 is cut from quick-mcp's issue-16 right after #22, and this PR pins it. Dr K's rulings (2026-11-24, 2026-11-25):

  • One PR: the pin bump and the deletion of mcp/mirror.py. From rc2 on, DLV-7 refuses a server tool named list_resources or read_resource, so no commit has to boot on the new pin with the mirror.
  • Pin 0.2.0rc3, not rc2 and not the final (04:02). On rc2, VS Code with no header would become resources-on, a visible regression for those clients. The instructions would also have to lean on a private kubed-mcp name (_resolved()). rc3 has DLV-15's table and DLV-11's public mcp.instructions(fn), so neither happens. An earlier draft also planned a landing on rc2; it is dropped.
  • The VS Code sniffing moves into kubed-mcp (DLV-15). selenium-flow registers no delivery_default and checks that VS Code gets today's delivery.
  • InstructionsFor moves onto DLV-11. The text stays byte-identical for VS Code and for every other client.
  • The goldens' mirror-tool cells are this PR's named changes. Every other cell of every golden stays byte-identical. They are regenerated in a commit of their own.
  • Binary content and ui:// are handled upstream. selenium-flow registers only the link pointer, with _where_to_read's logic.
  • These are named in the PR, not kept: the template rows, and a miss that names every template.
  • plan approved comes when rc3 is on PyPI. Dr K posts the version on #190.

quick-mcp#16's agent approved this plan as written (05:34). It pins exactly kubed-mcp[tasks]==0.2.0rc3, uses public names only, and names six golden cells and five differences. It leaves Explained and the cause-less ToolError (Review Focus 1) to selenium-flow's review. A mismatch that Task 2's check of the installed rc3 finds against the DLV rows is an upstream finding: report it on quick-mcp#16 as well as on this PR.

rc3 is published (2026-11-25 05:19; tag v0.2.0-rc.3, pip 0.2.0rc3, on PyPI). Read at the tag, in kubed/mcp/_tools.py, delivery.py and app.py:

  • The tools are _ResourceTools, a provider. _list_tools lists them only when _resolved().resources == "off", and _get_tool always answers. Both are annotated with a title ("List resources", "Read a resource"), read-only, not destructive, idempotent and closed-world.

  • _read reads through get_context().read_resource(uri), so the server's middleware runs.

    • An MCPError becomes ToolError(exc.message);
    • a NotFoundError becomes ToolError(f"Resource not found: {uri!r}"), with no cause.

    _list takes get_context().list_resources() through the middleware, drops ui://, and returns {"resources": rows}.

  • mcp.binary_pointer(fn: BinaryPointer), mcp.instructions(fn: Instructions) and mcp.delivery_default(fn) each return fn.

    • Instructions = Callable[[Resolved], str | None]. It is called per initialize and server/discover, its string written with the gateway prefix. None, a raise or a non-string gives the built instructions.
    • Resolved is public in kubed.mcp.delivery, with resources, listed, via, prefix and extensions.
  • DLV-15 is _KNOWN_CLIENTS = {"Visual Studio Code": resources="off"}, matched by the longest prefix of clientInfo.name. The name is read from initialize's params, otherwise from _meta["io.modelcontextprotocol/clientInfo"], then from the session's initialize. The levels run: the server header, X-MCP-*, the query, delivery_default, the config, the known clients, the built-in.

  • DLV-7's refusal: "the server has its own tool {name}, but a server with a plugin serves {name} itself, over every resource, the plugins' and its own (DLV-6): remove the server's {name} (DLV-7)".

Shipped. On kubed-mcp[tasks]==0.2.0rc3, as installed, in four commits:

  • 8766728, Task 1: the goldens and the annotation tests choose resources by a real X-MCP-Resources header over HTTP. No golden moved.
  • 8ad5d3b, Task 2: the pin, mcp/mirror.py deleted, apps.HideApps, resources.where_linked as the binary pointer, and instructions.for_delivery on mcp.instructions. Explained.on_call_tool raises read_resource's cause-less ToolError again through nameless and without_userinfo, because the message quotes the URI as sent (Review Focus 1). test_scrub_coverage reads through the tool every URI the client reads, templates filled, since the tool's listing has none (DLV-6).
  • 0c3cc5b, Task 3: the six named cells, and no other.
  • This commit, Task 4: the spec, the docs and the changelog.

Task 2, step 2 found the installed rc3 as recorded above, with one addition: _read also turns any other FastMCPError into a cause-less ToolError(str(exc)). Step 8 found no selenium-flow code that writes an x-mcp-* header: the only hits are the OpenAPI extension keys x-mcp-tool and x-mcp-resource in spec/builder.py. The change is held by SURF-13, SURF-15, SURF-17, SURF-18, PROT-9, PROT-29, PROT-30, PROT-36, PROT-37, PROT-41, PLG-55, PLG-59 and PLG-69, and beyond the plan by SURF-16 (X-MCP-Listed and X-MCP-Via, which ride on the bump), PLG-57 and SURF-16 (the prompt and agent files read as prompts:// and agents:// resources, which ride on it too), PLG-74 (list_resources writes the gateway prefix into its rows, DLV-6) and ERR-13 (the tool's failure is the read's own message).

For agentic workers: REQUIRED SUB-SKILL: Use skill://superpowers/subagent-driven-development/SKILL.md (recommended) or skill://superpowers/executing-plans/SKILL.md to implement this plan task by task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: selenium-flow runs on kubed-mcp[tasks]==0.2.0rc3 and serves kubed-mcp's list_resources and read_resource in place of its own. VS Code keeps today's delivery through kubed-mcp's table of known clients. Everything else it serves stays the same, and every difference is named.

Architecture: four tasks.

  1. A test-only change on rc1. The goldens and the annotation tests choose resources on or off with a real X-MCP-Resources header over HTTP, and no golden moves. This is needed because rc3 reads the header itself, and the old patch of clients.request_values no longer reaches it.
  2. The bump and the deletion, in one commit:
    • mirror.py is deleted;
    • the app-tools half of HideMirrors survives as apps.HideApps;
    • the link pointer is registered with mcp.binary_pointer;
    • the client sniffing goes;
    • InstructionsFor gives way to mcp.instructions(instructions.for_delivery).
  3. The goldens. Exactly the named cells are regenerated.
  4. The spec, the docs and the changelog.

Tech Stack: Python 3.11+, kubed-mcp 0.2.0rc3 (FastMCP 4.2.x), pytest, ruff.

Spec: this plan. The why is #190 and its notes (.issue/issues.md on the agent runner). The upstream rows are quick-mcp's delivery.md: DLV-2 to DLV-8, DLV-11 and DLV-15.

The design

What kubed-mcp does, and selenium-flow stops doing:

Behaviour Today (selenium-flow) On rc3 (kubed-mcp)
Reading X-MCP-Resources / ?resources= Caller.flags via workspaces.FLAGS, clients.reads_resources the resolver (DLV-2, DLV-3): header, then query, then the defaults
An unrecognised value anything outside off, false, 0, no, none is on ignored with one warning, and the next source answers (DLV-5)
VS Code with neither sent off (NO_RESOURCES, by clientInfo.name prefix) off, by DLV-15's table
The two tools mirror.register, hidden by HideMirrors kubed-mcp's (DLV-6): listed only when off, always callable
A server tool named either allowed refused at boot (DLV-7)
The instructions per request InstructionsFor, from reads_resources mcp.instructions(fn), from the request's resolved inputs (DLV-11)

What selenium-flow keeps:

  • apps.HideApps(app_tools, apps_enabled): HideMirrors without the mirror half. It hides app_tools unless apps are on and apps.supported(). It is registered where HideMirrors was.

  • resources.where_linked(uri) -> str | None: the binary pointer, registered with DLV-6's mcp.binary_pointer. It keeps _where_to_read's mapping:

    • workspace://files/… → workspace://files;
    • session://downloads/… → session://downloads;
    • session://<name>/downloads/<file> → session://<name>/downloads.

    It returns f"Read {listing} for this file's link, which any HTTP client can download." and None otherwise. kubed-mcp prefixes Not returned: binary content is not text. and a space, so the read string is byte-identical to today's.

  • instructions.for_delivery(delivery: Resolved) -> str (Resolved from kubed.mcp.delivery): returns instructions(delivery.resources != "off"). It is registered with self.mcp.instructions(instructions.for_delivery) (DLV-11), which calls it on every initialize and server/discover with that request's resolution. QuickMCP(..., instructions=instructions.instructions()) keeps the built text, the one DLV-11 falls back to. Nothing reads a private kubed-mcp name.

  • The instruction strings (INSTRUCTIONS, READING_POINTER, SKILL_POINTER, instructions()) stay unchanged. A request resolved off reads today's off text byte for byte, and a request resolved on reads today's on text.

What goes:

  • mcp/mirror.py, whole;
  • in clients.py: _OFF, NO_RESOURCES, reads_resources, named_in (InstructionsFor was its only reader) and the docstring's three-step order;
  • in instructions.py: InstructionsFor and first_instructions;
  • workspaces.FLAGS, its two set unions in CLIENT_PARAMS and CLIENT_HEADERS, and Caller.flags, which nothing else reads.

Named differences (the PR body lists each, and Task 3's goldens show them):

  1. An unrecognised X-MCP-Resources value is ignored with one warning, and the query or the next default answers. Before, it meant on.
  2. list_resources returns one text content, the JSON {"resources": [...]}. It holds resources/list's rows as sent, without ui://. It has no template rows and no output schema. Before, it returned structured ResourceRows and TemplateRows.
  3. read_resource:
    • a miss is resources/read's message: Resource not found: '<uri>' for a URI nothing serves, or the resource's own refusal, such as no flow called 'nope'. No template list;
    • a folder is resources/read's answer for a folder, not FolderNotFound.miss (the 20 folder texts in the -off plugin goldens);
    • ui:// is refused as <uri> is an app for a host to draw, not to read.;
    • it is annotated closed-world (DLV-6). Before, it was open-world.
  4. Both tools' names, descriptions and annotations are kubed-mcp's (tools-off.json).
  5. Behind a gateway prefix (X-MCP-Resource-Prefix), the instructions are written with the prefix, as served text is (DLV-11). Their skill:// pointer then reads <prefix>skill://…. Before, the instructions were the server's own text and stayed plain (GW-10). No golden sets a prefix, so none shows it.

VS Code's delivery is not a difference: DLV-15's table answers as NO_RESOURCES did.

Global Constraints

  • The pin: "kubed-mcp[tasks]==0.2.0rc3", or the exact string Dr K posts on #190. Keep the comment above the line in pyproject.toml.

  • The code turn starts only when rc3 is on PyPI. If pip install -e ".[test]" cannot find it, stop and say so on the PR.

  • No golden moves in Task 1. In Task 3, only these cells move:

    • tools-off.json's keys list_resources and read_resource;
    • plugin-auto-off.json's and plugin-legacy-off.json's keys tools/list_resources and tools/read_resource.

    If any other cell moves, stop: put the file, the key and the first diff in the PR for Dr K, and do not regenerate. A moved cell is a finding, not a fix. #22's other rows, X-MCP-Via (DLV-9, DLV-10) and the _meta["io.kubed/delivery"] self-description (DLV-12), ride on this bump. With no header, via is mcp, which lists as today. The golden's initialize cell records only the extensions and the instructions. So none of them should move a cell.

  • Never change an assertion of test_surfaces, test_boundaries, test_scrub_coverage or a golden to pass (AGENTS.md). Replacing mirror.MIRROR_TOOLS with the shared RESOURCE_TOOLS set is a rename, not a weakened assertion. If kubed-mcp's tools fail a rule, a missing display title for example, stop and report it for quick-mcp.

  • mcp/instructions.py: its strings and instructions()'s signature stay. for_delivery is added, InstructionsFor and first_instructions are deleted, and the module docstring changes.

  • No delivery_default. The server registers none (DLV-14). No selenium-flow route injects a delivery header: its only header writes are clients.Carry's sf-carried-*. Confirm that in Task 2 and change nothing.

  • No .github/ edits. Spec rules (Specification.md, "Ids"): statements only, present tense, code cited by symbol, and a removed requirement leaves a gap.

  • Checks, every task: ruff check . and pytest, as test.yml runs them. No ui/ change, so the UI's checks don't apply. The integration suite runs in CI only.

  • Commits: stage exact paths, never -a.

Review Focus

  1. A sub-session's name in a read_resource error. Today the mirror's failure is a cause, so Explained.on_call_tool passes it through nameless. rc3's _read raises ToolError(...) from None, and Explained passes a cause-less ToolError through as written. This is pinned by test_session_pointers' existing "7f3a" not in str(refused.value) loop (Task 2). If it fails, Task 2 step 7's fix applies.
  2. The reads through the middleware (#21's re-entry hazard). rc3's _read reads through get_context().read_resource, so selenium-flow's on_read_resource hooks run once, inside the tool call. For a retired URI (session://current), Explained.on_read_resource raises an MCPError naming the new URI, and _read turns it into a ToolError with that message. Refused.on_call_tool refuses before the tool runs. This is pinned by test_read_resource_refuses_an_old_uri_naming_the_new_one, test_a_refused_workspace_is_refused_once_through_read_resource and test_scrub_coverage's read-through-the-tool cases (Task 2).
  3. VS Code identified on only one path. DLV-15 must match initialize's clientInfo (legacy) and the _meta key io.modelcontextprotocol/clientInfo (2026-07-28), by prefix, so that "Visual Studio Code - Insiders" counts. This is pinned by test_vs_code_with_no_header_gets_todays_delivery, over both modes and both names (Task 2).
  4. The instructions and the listing disagreeing, for example when a bad header falls through to ?resources=off. This is pinned by test_the_instructions_agree_with_the_listing, over six inputs (Task 2).
  5. A binary read whose read string drifts from today's, by a space or a period, for any of the three prefixes. This is pinned by exact-string assertions in test_resources.py and test_session_pointers.py (Task 2).

Two more risks are held outside the Review Focus tests:

  • The HTTP harness moving a golden by itself (Task 1). It is held by running Task 1 on rc1, where no golden may move.
  • Instructions behind a gateway prefix (named difference 5). These are pinned by test_the_instructions_carry_the_gateway_prefix (Task 2).

Task 1: The goldens choose resources by the real header (on rc1)

Files:

  • Modify: tests/conftest.py (add over_http beside http)
  • Modify: tests/test_golden.py (published, plugin_surface)
  • Modify: tests/test_surfaces.py (test_every_tool_declares_its_safety_hints, test_only_reading_the_page_is_marked_read_only)

Interfaces:

  • Consumes: TOKEN (tests/conftest.py). httpx2.ASGITransport and StreamableHttpTransport, as tests/test_oidc_http.py::current uses them.

  • Produces: over_http(server, headers: dict | None = None, params: dict | None = None, *, mode: str | None = None, client_info: Implementation | None = None) -> AsyncContextManager[Client] in tests/conftest.py. It always sends Authorization: Bearer {TOKEN} and enters the app's lifespan. params go on the URL's query, and mode is passed to Client only when given. Task 2 uses it.

  • Step 1: Check the installed kubed-mcp is 0.2.0rc1

Run: python -c "import kubed.mcp; print(kubed.mcp.__version__)" Expected: 0.2.0rc1.

  • Step 2: Write over_http

Build the client factory as test_oidc_http.current does. Then build StreamableHttpTransport(f"http://test/mcp?{urlencode(params)}" if params else "http://test/mcp", headers=..., httpx_client_factory=factory), and yield the Client inside app.router.lifespan_context(app).

  • Step 3: Send the header instead of patching

  • published(server, resources) and plugin_surface(server, mode, resources) drop the monkeypatch of clients_module.request_values. Instead they open over_http(server, {"X-MCP-Resources": resources}, mode=mode, client_info=info). published passes no mode.

  • In the two test_surfaces tests, the same header goes through over_http, and the tools come from client.list_tools(). The annotations are read as the client's models hold them: annotations.title, annotations.readOnlyHint.

  • Drop the parameters and imports that become unused.

  • Step 4: Run the goldens and the surfaces

Run: pytest tests/test_golden.py tests/test_surfaces.py -p no:randomly Expected: PASS, and git status tests/golden shows nothing. If a golden moves, stop (Global Constraints): the harness changed it, not kubed-mcp.

  • Step 5: Run the checks

Run: ruff check . and pytest Expected: both clean.

  • Step 6: Commit
git add tests/conftest.py tests/test_golden.py tests/test_surfaces.py
git commit -m "Tests: the goldens choose resources by a real X-MCP-Resources header, over HTTP (#190)"

Task 2: kubed-mcp 0.2.0rc3, and its resource tools in place of the mirror

Files:

  • Modify: pyproject.toml (the kubed-mcp[tasks] line)
  • Delete: kubed/selenium_flow/mcp/mirror.py
  • Modify: kubed/selenium_flow/mcp/apps.py (add HideApps)
  • Modify: kubed/selenium_flow/mcp/resources.py (add where_linked, LINKED_FROM and NAMED_DOWNLOAD; the module docstring)
  • Modify: kubed/selenium_flow/mcp/clients.py, kubed/selenium_flow/mcp/instructions.py, kubed/selenium_flow/workspace/workspaces.py, kubed/selenium_flow/server.py
  • Modify (comments and docstrings that name the mirror): mcp/scrubbed.py, mcp/failures.py (Explained), mcp/apps.py, flows/api.py, core/guidance.py
  • Test: tests/conftest.py (RESOURCE_TOOLS), tests/test_resources.py, tests/test_scrub_coverage.py, tests/test_surfaces.py, tests/test_skill.py, tests/test_oidc_http.py, tests/test_session_pointers.py, tests/test_workspaces.py

Interfaces:

  • Consumes: over_http (Task 1). From kubed-mcp rc3:

    • mcp.binary_pointer(fn: BinaryPointer) (DLV-6), where BinaryPointer = Callable[[str], str | None];
    • mcp.instructions(fn: Instructions) (DLV-11), where Instructions = Callable[[Resolved], str | None];
    • kubed.mcp.delivery.Resolved, whose .resources is "on" or "off".
  • Produces:

    • RESOURCE_TOOLS = frozenset({"list_resources", "read_resource"}) in tests/conftest.py;
    • apps.HideApps(app_tools=(), apps_enabled: bool = True), a Middleware with on_list_tools;
    • resources.where_linked(uri: str) -> str | None;
    • instructions.for_delivery(delivery: Resolved) -> str.
  • Step 1: Move the pin and reinstall

"kubed-mcp[tasks]==0.2.0rc1" becomes "kubed-mcp[tasks]==0.2.0rc3". Run: pip install -e ".[test]", then python -c "import kubed.mcp; print(kubed.mcp.__version__)" Expected: 0.2.0rc3.

  • Step 2: Check the installed rc3 against the History header

The header records what the plan agent read at the tag. Open the installed copies of kubed/mcp/_tools.py (_ResourceTools, _read, _contents, NOT_TEXT), kubed/mcp/delivery.py (Resolved, _KNOWN_CLIENTS, _Resolver.__init__'s levels) and kubed/mcp/app.py (QuickMCP.instructions, QuickMCP.binary_pointer). Check that each matches the header. If one does not, stop. Report it on the PR, and on quick-mcp#16 as an upstream finding.

  • Step 3: Write the failing tests in tests/test_resources.py

Replace the section # ---- who reads resources ----, from test_resources_are_assumed_supported through test_the_old_per_resource_tools_are_gone. Every test there goes through over_http. listed(client) is {t.name for t in await client.list_tools()}.

VS_CODE = ["Visual Studio Code", "Visual Studio Code - Insiders"]

@pytest.mark.parametrize("mode", ["auto", "legacy"])
@pytest.mark.parametrize("name", VS_CODE)
async def test_vs_code_with_no_header_gets_todays_delivery(reader, name, mode):  # Review Focus 3
    async with over_http(reader, mode=mode, client_info=Implementation(name=name, version="1")) as c:
        assert RESOURCE_TOOLS <= await listed(c)
        assert c.instructions == instructions.instructions(False)

@pytest.mark.parametrize("info", [Implementation(name="a spec-complete client", version="1"), None])
async def test_any_other_client_with_no_header_is_on(reader, info):
    async with over_http(reader, client_info=info) as c:
        assert not RESOURCE_TOOLS & await listed(c)
        assert c.instructions == instructions.instructions(True)

@pytest.mark.parametrize("name", VS_CODE)
async def test_vs_code_saying_on_is_taken_at_its_word(reader, name):
    """The request's value beats the table (DLV-3)."""
    info = Implementation(name=name, version="1")
    async with over_http(reader, {"X-MCP-Resources": "on"}, client_info=info) as c:
        assert not RESOURCE_TOOLS & await listed(c)
        assert c.instructions == instructions.instructions(True)

@pytest.mark.parametrize("mode", ["auto", "legacy"])
@pytest.mark.parametrize("given", [{"headers": {"X-MCP-Resources": "off"}}, {"params": {"resources": "off"}}])
async def test_off_by_header_or_query_lists_the_tools_and_points_at_them(reader, mode, given):
    async with over_http(reader, mode=mode, **given) as c:
        assert RESOURCE_TOOLS <= await listed(c)
        assert c.instructions == instructions.instructions(False)

async def test_the_header_beats_the_query(reader):
    async with over_http(reader, {"X-MCP-Resources": "on"}, {"resources": "off"}) as c:
        assert not RESOURCE_TOOLS & await listed(c)
    async with over_http(reader, {"X-MCP-Resources": "off"}, {"resources": "on"}) as c:
        assert RESOURCE_TOOLS <= await listed(c)

async def test_an_unrecognised_value_is_ignored_with_one_warning(reader, caplog):  # named difference 1
    caplog.set_level(logging.WARNING, logger="kubed.mcp.delivery")
    # Legacy: one session id for the connection. On 2026-07-28 each request is its own (DLV-5).
    async with over_http(reader, {"X-MCP-Resources": "bogus-190"}, {"resources": "off"}, mode="legacy") as c:
        assert RESOURCE_TOOLS <= await listed(c)
        await listed(c)
    said = [r for r in caplog.records if "bogus-190" in r.getMessage()]
    assert len(said) == 1 and "header X-MCP-Resources" in said[0].getMessage()

@pytest.mark.parametrize("given", [
    {}, {"headers": {"X-MCP-Resources": "off"}}, {"headers": {"X-MCP-Resources": "on"}},
    {"headers": {"X-MCP-Resources": "bogus-190"}, "params": {"resources": "off"}},
    {"params": {"resources": "none"}},
    {"client_info": Implementation(name="Visual Studio Code", version="1")},
])
async def test_the_instructions_agree_with_the_listing(reader, given):  # Review Focus 4
    async with over_http(reader, **given) as c:
        tools_shown = "read_resource" in await listed(c)
        assert ("read_resource(uri)" in c.instructions) is tools_shown

async def test_the_instructions_carry_the_gateway_prefix(reader):  # named difference 5
    async with over_http(reader, {"X-MCP-Resource-Prefix": "sf+"}) as c:
        assert "sf+skill://selenium-flow/driving-a-browser/SKILL.md" in c.instructions
    async with over_http(reader) as c:
        assert c.instructions == instructions.instructions(True)

Keep test_the_old_per_resource_tools_are_gone, with the header sent through over_http. In the rest of the file:

  • read() calls "read_resource";
  • test_both_tools_only_read lists through over_http with the header off, and loops over RESOURCE_TOOLS;
  • test_the_listing_is_every_uri_to_read_and_nothing_to_draw reads json.loads(result.content[0].text)["resources"] and drops its flow://flows/{name} line;
  • delete test_a_uri_that_is_not_there_is_told_the_templates and test_the_listing_publishes_both_row_shapes (named differences 2 and 3);
  • rename test_the_mirror_refuses_an_old_uri_naming_the_new_one to test_read_resource_refuses_an_old_uri_naming_the_new_one, with its assertion unchanged;
  • rename test_a_part_is_the_wholes_value_through_the_mirror_too to test_a_part_is_the_wholes_value_through_read_resource_too.

Add:

def test_where_linked_names_the_listing_that_holds_the_link():
    said = "Read {} for this file's link, which any HTTP client can download."
    assert where_linked("workspace://files/report.pdf") == said.format("workspace://files")
    assert where_linked("session://downloads/report.pdf") == said.format("session://downloads")
    assert where_linked("session://tester/downloads/g.pdf") == said.format("session://tester/downloads")
    assert where_linked("flow://flows/login") is None

In test_any_other_binary_is_described_not_dumped, assert the whole sentence: said["read"] == "Not returned: binary content is not text. Read session://downloads for this file's link, which any HTTP client can download."

Add test_a_refused_workspace_is_refused_once_through_read_resource beside the existing Refused read test, which grep -n "Refused\|refusal" tests/test_workspace_config*.py finds. Use that test's setup and call read_resource on the refused workspace's workspace://current. Assert that the tool error's text holds the refusal sentence exactly once: str(refused.value).count(sentence) == 1.

  • Step 4: Run them to see them fail

Run: pytest tests/test_resources.py -p no:randomly Expected: FAIL. selenium-flow's own list_resources and read_resource make rc3 refuse the server at construction (DLV-7), naming the tool.

  • Step 5: Delete the mirror; add HideApps and where_linked

  • Delete mcp/mirror.py.

  • In server.py:

    • drop mirror from the imports, and the mirror.register(self.mcp) call with its comment;
    • after resources.register(...), add self.mcp.binary_pointer(resources.where_linked);
    • self.mcp.add_middleware(apps.HideApps(app_tools, apps_enabled)) takes HideMirrors' place.
  • apps.HideApps is HideMirrors.on_list_tools with the reads_resources half removed. Its docstring keeps "Hidden tools stay callable."

  • resources.where_linked: LINKED_FROM, NAMED_DOWNLOAD and _where_to_read's matching move here unchanged. It returns the sentence after said, or None.

  • Step 6: Drop the sniffing; the instructions through DLV-11

  • clients.py:

    • delete _OFF, NO_RESOURCES, reads_resources and named_in;
    • the module docstring becomes "Who is calling: the workspace, the session it pins, the client's name and the bearer; and the middleware that carries a caller to a task and refuses a refused workspace.";
    • the docstring also says that X-MCP-Resources is kubed-mcp's (DLV-2), and that so is VS Code's default (DLV-15).
  • instructions.py:

    • add for_delivery(delivery: Resolved) -> str, which returns instructions(delivery.resources != "off"), importing Resolved from kubed.mcp.delivery;
    • delete InstructionsFor and first_instructions;
    • the module docstring says that kubed-mcp calls for_delivery on each handshake, with the request's resolved inputs (DLV-11).
  • server.py:

    • QuickMCP(..., instructions=instructions.instructions());
    • the add_middleware(instructions.InstructionsFor()) line becomes self.mcp.instructions(instructions.for_delivery);
    • no delivery_default.
  • workspaces.py:

    • delete FLAGS, its unions in CLIENT_PARAMS and CLIENT_HEADERS, the flags loop in from_request, and Caller.flags;
    • update the Caller docstring and the positional cls(...) call.
  • Step 7: Rewire the other tests

File Change
test_scrub_coverage.py Drop the mirror import. Use "list_resources" and "read_resource", and parse the listing as json.loads(...)["resources"]. The assertions stay
test_surfaces.py - mirror.MIRROR_TOOLS becomes - RESOURCE_TOOLS. Drop the import
test_skill.py The same, in the tool-table test. Its docstring says "kubed-mcp's two reading tools"
test_oidc_http.py Call "read_resource". Drop the import
test_session_pointers.py Call "read_resource". Rename test_the_mirror_says_… to test_read_resource_says_…, and assert the whole read sentence for session://tester/downloads. The comment by the ToolError loop says "read_resource"
test_workspaces.py Delete test_x_mcp_resources_is_still_read: selenium-flow no longer reads it

Then fix the docstrings and comments that name the mirror:

  • scrubbed.py's module docstring;
  • resources.py's module docstring;
  • failures.py's two comments in Explained;
  • apps.py's module docstring;
  • flows/api.py's HideMirrors mention, which becomes apps.HideApps;
  • core/guidance.py's ENTRY comment.

Run: grep -rn "mirror\|reads_resources\|NO_RESOURCES\|MIRROR_TOOLS\|InstructionsFor\|first_instructions" kubed tests Expected: only the unrelated hits (browser.py, test_openapi.py, test_actions_contract.py).

Run: pytest tests/test_session_pointers.py -p no:randomly Expected: PASS, the "7f3a" not in loop included (Review Focus 1). If that loop fails, rc3's cause-less ToolError named the sub-session. Fix the code, not the assertion: in Explained.on_call_tool, a ToolError with no cause from read_resource is raised again as ToolError(nameless(str(exc))). Anything else passes as it does now. Then run the file again.

  • Step 8: Confirm no route injects a delivery header

Run: grep -rn "x-mcp-\|X-MCP-" kubed Expected: no write of an x-mcp-* header. A hit in a docstring or a message is fine. Note the result for the PR.

  • Step 9: Run the checks

Run: ruff check ., then pytest with the three off goldens deselected: --deselect "tests/test_golden.py::test_the_tools_are_what_they_were[off]", and the two test_the_plugin_surface_is_what_it_was ids with off. Take the exact ids from pytest --collect-only -q tests/test_golden.py. Expected: both clean. The on cells and every other golden pass untouched. Then run the three deselected tests on their own. Expected: they fail only on the named keys, which Task 3 checks.

  • Step 10: Commit
git add pyproject.toml kubed tests/conftest.py tests/test_resources.py \
  tests/test_scrub_coverage.py tests/test_surfaces.py tests/test_skill.py tests/test_oidc_http.py \
  tests/test_session_pointers.py tests/test_workspaces.py
git rm kubed/selenium_flow/mcp/mirror.py
git commit -m "kubed-mcp 0.2.0rc3: its list_resources and read_resource replace the mirror (#190)"

Task 3: The named golden cells, on their own

Files:

  • Modify: tests/golden/tools-off.json, tests/golden/plugin-auto-off.json, tests/golden/plugin-legacy-off.json (written by GOLDEN_UPDATE=1)

Interfaces:

  • Consumes: Task 2's tree. No code changes.

  • Step 1: Regenerate

Run: GOLDEN_UPDATE=1 pytest tests/test_golden.py -p no:randomly Then: git status --short tests/golden Expected: exactly the three files above modified.

  • Step 2: Prove only the named cells moved
python - <<'EOF'
import json, subprocess
named = {
    "tools-off.json": ["list_resources", "read_resource"],
    "plugin-auto-off.json": ["tools/list_resources", "tools/read_resource"],
    "plugin-legacy-off.json": ["tools/list_resources", "tools/read_resource"],
}
for name, keys in named.items():
    old = json.loads(subprocess.check_output(["git", "show", f"HEAD:tests/golden/{name}"]))
    new = json.loads(open(f"tests/golden/{name}").read())
    for key in keys:
        assert key in new, (name, key)
        old.pop(key, None), new.pop(key, None)
    assert old == new, name
print("only the named cells moved")
EOF

Expected: only the named cells moved. If not, stop (Global Constraints).

  • Step 3: Read the diff

Run: git diff tests/golden Expected: the differences named in the design, items 2 to 4:

  • the rows as sent, in {"resources": [...]}, with no ui:// row and no template;
  • the folder and miss texts as resources/read gives them;
  • the binary read sentences unchanged;
  • kubed-mcp's descriptions and annotations.

No absolute path, hostname or version appears. Copy the moved keys into the PR body.

  • Step 4: Run the checks

Run: ruff check . and pytest Expected: both clean.

  • Step 5: Commit, on its own
git add tests/golden/tools-off.json tests/golden/plugin-auto-off.json tests/golden/plugin-legacy-off.json
git commit -m "Golden: kubed-mcp's list_resources and read_resource in the off cells (#190)"

Task 4: The spec, the docs and the changelog

Files:

  • Modify: docs/superpowers/specs/surfaces.md, protocol.md, plugin.md, runtime.md, Specification.md, workspace-files.md
  • Modify: CHANGELOG.md
  • Modify: this plan's History header

Interfaces:

  • Consumes: what Task 2, step 2 read. Cite quick-mcp rows as [quick-mcp DLV-6][delivery], and add a [delivery] link definition beside each file's [skills] one, pointing at quick-mcp's delivery wiki page.

  • Step 1: surfaces.md

  • SURF-8: the X-MCP-Resources row's "Read for" becomes "Whether the caller reads resources, read by kubed-mcp (SURF-13)".

  • SURF-13: "X-MCP-Resources and ?resources= are kubed-mcp's input ([quick-mcp DLV-2][delivery] to DLV-5): the header, then the query. A value it does not take is ignored with one warning. With neither, kubed-mcp's table of known clients answers (DLV-15): a client whose clientInfo.name starts with "Visual Studio Code" is off, and every other client, including one that cannot be identified, is on. The server sets no delivery_default of its own. With off, kubed-mcp's list_resources and read_resource are listed (DLV-6)."

  • SURF-15: the tool list names "kubed-mcp's list_resources and read_resource". The list still varies by caller in two ways:

    • those two are listed only to a request resolved off (SURF-13);
    • show, in apps.HideApps, is listed only to a client that declares MCP Apps…
  • SURF-17: "list_resources and read_resource are kubed-mcp's ([quick-mcp DLV-6][delivery]). The server defines neither, and a tool of its own by either name stops it at boot (DLV-7). read_resource reads through resources/read, so the scrub, Refused and ERR-13's read failures apply as they do to a client's own read, a moved URI's new spelling included."

  • SURF-18: "Binary content: [quick-mcp DLV-6][delivery]. The server's pointer (mcp.binary_pointer) is resources.where_linked. For workspace://files/…, session://downloads/… and session://<name>/downloads/…, it names workspace://files, session://downloads and session://<name>/downloads respectively: 'Read

    for this file's link, which any HTTP client can download.' For any other URI it gives none."
  • Step 2: protocol.md

  • PROT-41: kubed-mcp[tasks]==0.2.0rc3.

  • PROT-9: the first row no longer lists "Instructions per client" among what the middleware hooks are used for.

  • PROT-16: drop list_resources and read_resource from the async tools: they are kubed-mcp's.

  • PROT-23: the read-only list says "kubed-mcp's list_resources and read_resource".

  • PROT-26: "Every tool is, except kubed-mcp's two resource tools, which DLV-6 annotates closed-world."

  • PROT-29: "A request resolved X-MCP-Resources off (SURF-13) gets…"

  • PROT-30: "instructions.for_delivery, registered with mcp.instructions ([quick-mcp DLV-11][delivery]), chooses the text for each initialize and server/discover from the request's resolved resources, so the instructions and the listing agree. The server is built with the text for on."

  • PROT-36, the first row: "Whether the request resolves X-MCP-Resources off (SURF-13) | kubed-mcp's two resource tools in the listing, and the instructions' paragraph | Yes".

  • PROT-37: "The server keeps no list of clients. kubed-mcp's (DLV-15) names only clients known not to reach a resource. Every other client is assumed complete, and one that is not says so with X-MCP-Resources: off."

  • Step 3: The other area files

  • plugin.md:

    • PLG-55: "A request resolved X-MCP-Resources off gets kubed-mcp's list_resources and read_resource ([quick-mcp DLV-6][delivery]). They list the five skill:// rows among the server's and read every skill:// URI (SURF-15)."
    • PLG-59: "the pointer's wording follows the request's resolved X-MCP-Resources, chosen on each handshake (PROT-29, PROT-30)."
    • PLG-69: "show answers a folder URI with FolderNotFound's miss. kubed-mcp's read_resource answers it as resources/read does (SURF-17)."
    • Every other "the mirror's read_resource" or "the two mirror tools" becomes "kubed-mcp's read_resource" or "kubed-mcp's two resource tools" (grep -n mirror).
    • The gateway paragraph's "The server's own text does not carry the prefix (GW-10): the instructions and the hints (core/guidance.py) name plain skill:// addresses" becomes: "The instructions are written with the prefix, as served text is ([quick-mcp DLV-11][delivery]). The rest of the server's own text does not carry it (GW-10): the hints (core/guidance.py) name plain skill:// addresses."
  • runtime.md: drop "mirror tools" from the boot sequence's list and from the async row's tool list. The dependency line says kubed-mcp 0.2.0rc3.

  • Specification.md: the glossary's "Mirror." entry becomes "Resource tools. kubed-mcp's list_resources and read_resource, listed to a client that cannot read resources (SURF-15)". The mcp/ row of the architecture table drops "the mirror".

  • workspace-files.md: "the mirror tools" becomes "kubed-mcp's resource tools".

docs/Installing.md and plugin/skills/deploying-the-server/references/CONFIGURATION.md stay as they read: VS Code is still recognised with neither sent, now by kubed-mcp, and the header and the query still win.

  • Step 4: The changelog

Under [Unreleased]'s ### Changed, replace - The server needs kubed-mcp 0.2.0rc1 (#201). with - The server needs kubed-mcp 0.2.0rc3 (#201, #190).. Above the ### Changed heading, at the end of the flat list, add:

- `list_resources` and `read_resource` are kubed-mcp's: the listing has no templates, a miss no longer lists them, and an `X-MCP-Resources` value other than on or off is ignored with a warning (#190).
- Behind a gateway prefix, the instructions name the skill with the prefix (#190).
  • Step 5: Check the docs

Run: pytest tests/test_wiki.py tests/test_skill.py tests/test_readme.py and then pytest Expected: PASS.

  • Step 6: The History header

Add a **Shipped.** paragraph to this plan's header. It names:

  • the commits and the version installed;
  • what Task 2, steps 2 and 8, read;
  • the requirement ids that hold the change now: SURF-13, SURF-15, SURF-17, SURF-18, PROT-9, PROT-29, PROT-30, PROT-36, PROT-37, PROT-41, PLG-55, PLG-59 and PLG-69.

Leave the body alone.

  • Step 7: Run the checks and commit

Run: ruff check . and pytest Expected: both clean. The workflow commits docs/ to the wiki branch issue-190.

git add CHANGELOG.md docs
git commit -m "Spec and docs: the resource tools and X-MCP-Resources are kubed-mcp's (#190)"

After the tasks

The PR body carries:

  • the installed version;
  • the named differences;
  • the moved golden keys;
  • what Task 2, steps 2 and 8, read.

Dr K's parity QA in the pod compares rc1 with the mirror against rc3 without it. Everything outside the named cells must match, VS Code's delivery included.

Clone this wiki locally