Repository navigation
2026 11 25 delivery inputs
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'sissue-16right 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 namedlist_resourcesorread_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 publicmcp.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_defaultand checks that VS Code gets today's delivery.InstructionsFormoves 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 approvedcomes 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 leavesExplainedand the cause-lessToolError(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, pip0.2.0rc3, on PyPI). Read at the tag, inkubed/mcp/_tools.py,delivery.pyandapp.py:
The tools are
_ResourceTools, a provider._list_toolslists them only when_resolved().resources == "off", and_get_toolalways answers. Both are annotated with a title ("List resources", "Read a resource"), read-only, not destructive, idempotent and closed-world.
_readreads throughget_context().read_resource(uri), so the server's middleware runs.
- An
MCPErrorbecomesToolError(exc.message);- a
NotFoundErrorbecomesToolError(f"Resource not found: {uri!r}"), with no cause.
_listtakesget_context().list_resources()through the middleware, dropsui://, and returns{"resources": rows}.
mcp.binary_pointer(fn: BinaryPointer),mcp.instructions(fn: Instructions)andmcp.delivery_default(fn)each returnfn.
Instructions = Callable[[Resolved], str | None]. It is called perinitializeandserver/discover, its string written with the gateway prefix. None, a raise or a non-string gives the builtinstructions.Resolvedis public inkubed.mcp.delivery, withresources,listed,via,prefixandextensions.DLV-15 is
_KNOWN_CLIENTS = {"Visual Studio Code": resources="off"}, matched by the longest prefix ofclientInfo.name. The name is read frominitialize's params, otherwise from_meta["io.modelcontextprotocol/clientInfo"], then from the session'sinitialize. 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-Resourcesheader over HTTP. No golden moved.- 8ad5d3b, Task 2: the pin,
mcp/mirror.pydeleted,apps.HideApps,resources.where_linkedas the binary pointer, andinstructions.for_deliveryonmcp.instructions.Explained.on_call_toolraisesread_resource's cause-lessToolErroragain throughnamelessandwithout_userinfo, because the message quotes the URI as sent (Review Focus 1).test_scrub_coveragereads 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:
_readalso turns any otherFastMCPErrorinto a cause-lessToolError(str(exc)). Step 8 found no selenium-flow code that writes anx-mcp-*header: the only hits are the OpenAPI extension keysx-mcp-toolandx-mcp-resourceinspec/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-ListedandX-MCP-Via, which ride on the bump), PLG-57 and SURF-16 (the prompt and agent files read asprompts://andagents://resources, which ride on it too), PLG-74 (list_resourceswrites 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.
-
A test-only change on rc1. The goldens and the annotation tests choose resources on or off
with a real
X-MCP-Resourcesheader over HTTP, and no golden moves. This is needed because rc3 reads the header itself, and the old patch ofclients.request_valuesno longer reaches it. -
The bump and the deletion, in one commit:
-
mirror.pyis deleted; - the app-tools half of
HideMirrorssurvives asapps.HideApps; - the link pointer is registered with
mcp.binary_pointer; - the client sniffing goes;
-
InstructionsForgives way tomcp.instructions(instructions.for_delivery).
-
- The goldens. Exactly the named cells are regenerated.
- 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.
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):HideMirrorswithout the mirror half. It hidesapp_toolsunless apps are on andapps.supported(). It is registered whereHideMirrorswas. -
resources.where_linked(uri) -> str | None: the binary pointer, registered with DLV-6'smcp.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 prefixesNot returned: binary content is not text.and a space, so thereadstring is byte-identical to today's. -
-
instructions.for_delivery(delivery: Resolved) -> str(Resolvedfromkubed.mcp.delivery): returnsinstructions(delivery.resources != "off"). It is registered withself.mcp.instructions(instructions.for_delivery)(DLV-11), which calls it on everyinitializeandserver/discoverwith 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(InstructionsForwas its only reader) and the docstring's three-step order; - in
instructions.py:InstructionsForandfirst_instructions; -
workspaces.FLAGS, its two set unions inCLIENT_PARAMSandCLIENT_HEADERS, andCaller.flags, which nothing else reads.
Named differences (the PR body lists each, and Task 3's goldens show them):
- An unrecognised
X-MCP-Resourcesvalue is ignored with one warning, and the query or the next default answers. Before, it meant on. -
list_resourcesreturns one text content, the JSON{"resources": [...]}. It holdsresources/list's rows as sent, withoutui://. It has no template rows and no output schema. Before, it returned structuredResourceRows andTemplateRows. -
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 asno flow called 'nope'. No template list; - a folder is
resources/read's answer for a folder, notFolderNotFound.miss(the 20 folder texts in the-offplugin 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.
- a miss is
- Both tools' names, descriptions and annotations are kubed-mcp's (
tools-off.json). - Behind a gateway prefix (
X-MCP-Resource-Prefix), the instructions are written with the prefix, as served text is (DLV-11). Theirskill://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.
-
The pin:
"kubed-mcp[tasks]==0.2.0rc3", or the exact string Dr K posts on #190. Keep the comment above the line inpyproject.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 keyslist_resourcesandread_resource; -
plugin-auto-off.json's andplugin-legacy-off.json's keystools/list_resourcesandtools/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,viaismcp, which lists as today. The golden'sinitializecell 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_coverageor a golden to pass (AGENTS.md). Replacingmirror.MIRROR_TOOLSwith the sharedRESOURCE_TOOLSset 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 andinstructions()'s signature stay.for_deliveryis added,InstructionsForandfirst_instructionsare 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 areclients.Carry'ssf-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 .andpytest, astest.ymlruns them. Noui/change, so the UI's checks don't apply. The integration suite runs in CI only. -
Commits: stage exact paths, never
-a.
-
A sub-session's name in a
read_resourceerror. Today the mirror's failure is a cause, soExplained.on_call_toolpasses it throughnameless. rc3's_readraisesToolError(...)from None, andExplainedpasses a cause-lessToolErrorthrough as written. This is pinned bytest_session_pointers' existing"7f3a" not in str(refused.value)loop (Task 2). If it fails, Task 2 step 7's fix applies. -
The reads through the middleware (#21's re-entry hazard). rc3's
_readreads throughget_context().read_resource, so selenium-flow'son_read_resourcehooks run once, inside the tool call. For a retired URI (session://current),Explained.on_read_resourceraises anMCPErrornaming the new URI, and_readturns it into aToolErrorwith that message.Refused.on_call_toolrefuses before the tool runs. This is pinned bytest_read_resource_refuses_an_old_uri_naming_the_new_one,test_a_refused_workspace_is_refused_once_through_read_resourceandtest_scrub_coverage's read-through-the-tool cases (Task 2). -
VS Code identified on only one path. DLV-15 must match
initialize'sclientInfo(legacy) and the_metakeyio.modelcontextprotocol/clientInfo(2026-07-28), by prefix, so that "Visual Studio Code - Insiders" counts. This is pinned bytest_vs_code_with_no_header_gets_todays_delivery, over both modes and both names (Task 2). -
The instructions and the listing disagreeing, for example when a bad header falls through
to
?resources=off. This is pinned bytest_the_instructions_agree_with_the_listing, over six inputs (Task 2). -
A binary read whose
readstring drifts from today's, by a space or a period, for any of the three prefixes. This is pinned by exact-string assertions intest_resources.pyandtest_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).
Files:
- Modify:
tests/conftest.py(addover_httpbesidehttp) - 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.ASGITransportandStreamableHttpTransport, astests/test_oidc_http.py::currentuses them. -
Produces:
over_http(server, headers: dict | None = None, params: dict | None = None, *, mode: str | None = None, client_info: Implementation | None = None) -> AsyncContextManager[Client]intests/conftest.py. It always sendsAuthorization: Bearer {TOKEN}and enters the app's lifespan.paramsgo on the URL's query, andmodeis passed toClientonly 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)andplugin_surface(server, mode, resources)drop themonkeypatchofclients_module.request_values. Instead they openover_http(server, {"X-MCP-Resources": resources}, mode=mode, client_info=info).publishedpasses nomode. -
In the two
test_surfacestests, the same header goes throughover_http, and the tools come fromclient.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)"Files:
- Modify:
pyproject.toml(thekubed-mcp[tasks]line) - Delete:
kubed/selenium_flow/mcp/mirror.py - Modify:
kubed/selenium_flow/mcp/apps.py(addHideApps) - Modify:
kubed/selenium_flow/mcp/resources.py(addwhere_linked,LINKED_FROMandNAMED_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), whereBinaryPointer = Callable[[str], str | None]; -
mcp.instructions(fn: Instructions)(DLV-11), whereInstructions = Callable[[Resolved], str | None]; -
kubed.mcp.delivery.Resolved, whose.resourcesis"on"or"off".
-
-
Produces:
-
RESOURCE_TOOLS = frozenset({"list_resources", "read_resource"})intests/conftest.py; -
apps.HideApps(app_tools=(), apps_enabled: bool = True), aMiddlewarewithon_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_readlists throughover_httpwith the header off, and loops overRESOURCE_TOOLS; -
test_the_listing_is_every_uri_to_read_and_nothing_to_drawreadsjson.loads(result.content[0].text)["resources"]and drops itsflow://flows/{name}line; - delete
test_a_uri_that_is_not_there_is_told_the_templatesandtest_the_listing_publishes_both_row_shapes(named differences 2 and 3); - rename
test_the_mirror_refuses_an_old_uri_naming_the_new_onetotest_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_toototest_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 NoneIn 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
HideAppsandwhere_linked -
Delete
mcp/mirror.py. -
In
server.py:- drop
mirrorfrom the imports, and themirror.register(self.mcp)call with its comment; - after
resources.register(...), addself.mcp.binary_pointer(resources.where_linked); -
self.mcp.add_middleware(apps.HideApps(app_tools, apps_enabled))takesHideMirrors' place.
- drop
-
apps.HideAppsisHideMirrors.on_list_toolswith thereads_resourceshalf removed. Its docstring keeps "Hidden tools stay callable." -
resources.where_linked:LINKED_FROM,NAMED_DOWNLOADand_where_to_read's matching move here unchanged. It returns the sentence aftersaid, or None. -
Step 6: Drop the sniffing; the instructions through DLV-11
-
clients.py:- delete
_OFF,NO_RESOURCES,reads_resourcesandnamed_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-Resourcesis kubed-mcp's (DLV-2), and that so is VS Code's default (DLV-15).
- delete
-
instructions.py:- add
for_delivery(delivery: Resolved) -> str, which returnsinstructions(delivery.resources != "off"), importingResolvedfromkubed.mcp.delivery; - delete
InstructionsForandfirst_instructions; - the module docstring says that kubed-mcp calls
for_deliveryon each handshake, with the request's resolved inputs (DLV-11).
- add
-
server.py:-
QuickMCP(..., instructions=instructions.instructions()); - the
add_middleware(instructions.InstructionsFor())line becomesself.mcp.instructions(instructions.for_delivery); - no
delivery_default.
-
-
workspaces.py:- delete
FLAGS, its unions inCLIENT_PARAMSandCLIENT_HEADERS, theflagsloop infrom_request, andCaller.flags; - update the
Callerdocstring and the positionalcls(...)call.
- delete
-
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 inExplained; -
apps.py's module docstring; -
flows/api.py'sHideMirrorsmention, which becomesapps.HideApps; -
core/guidance.py'sENTRYcomment.
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)"Files:
- Modify:
tests/golden/tools-off.json,tests/golden/plugin-auto-off.json,tests/golden/plugin-legacy-off.json(written byGOLDEN_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")
EOFExpected: 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 noui://row and no template; - the folder and miss texts as
resources/readgives them; - the binary
readsentences 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)"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'sdeliverywiki page. -
Step 1:
surfaces.md -
SURF-8: the
X-MCP-Resourcesrow's "Read for" becomes "Whether the caller reads resources, read by kubed-mcp (SURF-13)". -
SURF-13: "
X-MCP-Resourcesand?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 whoseclientInfo.namestarts with "Visual Studio Code" is off, and every other client, including one that cannot be identified, is on. The server sets nodelivery_defaultof its own. Withoff, kubed-mcp'slist_resourcesandread_resourceare listed (DLV-6)." -
SURF-15: the tool list names "kubed-mcp's
list_resourcesandread_resource". The list still varies by caller in two ways:- those two are listed only to a request resolved off (SURF-13);
-
show, inapps.HideApps, is listed only to a client that declares MCP Apps…
-
SURF-17: "
list_resourcesandread_resourceare 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_resourcereads throughresources/read, so the scrub,Refusedand 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 (
for this file's link, which any HTTP client can download.' For any other URI it gives none."mcp.binary_pointer) isresources.where_linked. Forworkspace://files/…,session://downloads/…andsession://<name>/downloads/…, it namesworkspace://files,session://downloadsandsession://<name>/downloadsrespectively: 'Read -
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_resourcesandread_resourcefrom the async tools: they are kubed-mcp's. -
PROT-23: the read-only list says "kubed-mcp's
list_resourcesandread_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-Resourcesoff (SURF-13) gets…" -
PROT-30: "
instructions.for_delivery, registered withmcp.instructions([quick-mcp DLV-11][delivery]), chooses the text for eachinitializeandserver/discoverfrom the request's resolvedresources, 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-Resourcesoff (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-Resourcesoff gets kubed-mcp'slist_resourcesandread_resource([quick-mcp DLV-6][delivery]). They list the fiveskill://rows among the server's and read everyskill://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: "
showanswers a folder URI withFolderNotFound'smiss. kubed-mcp'sread_resourceanswers it asresources/readdoes (SURF-17)." - Every other "the mirror's
read_resource" or "the two mirror tools" becomes "kubed-mcp'sread_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 plainskill://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 plainskill://addresses."
- PLG-55: "A request resolved
-
runtime.md: drop "mirror tools" from the boot sequence's list and from the async row's tool list. The dependency line sayskubed-mcp0.2.0rc3. -
Specification.md: the glossary's "Mirror." entry becomes "Resource tools. kubed-mcp'slist_resourcesandread_resource, listed to a client that cannot read resources (SURF-15)". Themcp/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)"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.
The action pages are generated from the server's tool schemas, so they describe the version that shipped.
selenium-flow · MIT
Start here
Guides
Lifecycle
Going places
Doing things
Getting things out
Site data
Console and network