From 2a64364e9bdad59cd1fee3addf62dc28398c17d0 Mon Sep 17 00:00:00 2001 From: miyawakiclaude <276040126+miyawakiclaude@users.noreply.github.com> Date: Thu, 27 Aug 2026 01:12:29 +0900 Subject: [PATCH 1/2] fix(mcp): read_docs reaches three of the five documents the service serves /interop.md and /auth.md are served (src/app.py _DOCS and the /auth.md route) and both are named in the manual read_docs itself returns, but the page enum stops at manual, patterns and skill. That gap matters for exactly the audience mcp/README.md names: "a runtime whose only outbound path is MCP tool calls". For that runtime the manual says the document exists, read_docs answers -32602, and the tool description closes with advice it cannot take - "every lane is reachable with a plain GET". /interop.md shipped in 0.9.6 (#256), the release this wrapper is pinned to, and it is the document that discusses carrying MCP over a room and states this wrapper's own protocol-version position. An MCP-only agent asking about MCP interop is sent to the one document it cannot open. Routes and pages now come from one table, and the test asserts the two sets are equal rather than listing pages by hand - so a document added to the service cannot be reachable from a plain GET and unreachable from here. Renames test_read_docs_reaches_all_three_pages, whose name was the assumption. Verified locally that _PAGES.values() equals app._DOCS plus /auth.md and /llms.txt. I could not run the suite - the store is fcntl/os.fchmod-only and this is a Windows host - so CI is the first full run. Co-Authored-By: Claude Opus 5 --- mcp/README.md | 2 +- mcp/src/technocore_mcp/server.py | 23 +++++++++++++++++++---- tests/test_mcp.py | 13 +++++++++++-- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/mcp/README.md b/mcp/README.md index 0308dd6ee..b9cc75445 100644 --- a/mcp/README.md +++ b/mcp/README.md @@ -54,7 +54,7 @@ with `-i`; without an attached stdin the process reads EOF and exits, correctly. | `list_rooms` | public rooms, most recently active first, with topics | | `discover_rooms` | the announcement log: one line per new public room | | `read_note` · `write_note` · `list_notes` | durable key-value notes, with compare-and-set | -| `read_docs` | the service's own manual and worked patterns | +| `read_docs` | the service's own documents: manual, patterns, interop, auth, skill | Tools return the service's `text/plain` rendering rather than re-serialised JSON, on purpose: that rendering carries the untrusted-content banner and the `next:` cursor line, and stripping them would diff --git a/mcp/src/technocore_mcp/server.py b/mcp/src/technocore_mcp/server.py index 05789b31e..317dba7d6 100644 --- a/mcp/src/technocore_mcp/server.py +++ b/mcp/src/technocore_mcp/server.py @@ -214,15 +214,30 @@ def list_notes(namespace: str) -> str: return _fetch(f"/kv/{_segment(namespace)}") +# One table, so a document the service starts serving cannot be reachable from a +# plain GET and unreachable from here. An MCP-only runtime has no other route to +# them, and the manual names all of these. +_PAGES = { + "manual": "/llms.txt", + "patterns": "/patterns.md", + "interop": "/interop.md", + "auth": "/auth.md", + "skill": "/skill.md", +} + + @server.tool( "read_docs", "Fetch the service's own documentation: `manual` is the complete API reference, " "`patterns` is worked multi-agent choreographies (mailboxes, private channels, " - "end-to-end encryption, room ownership). Use this for anything these tools do not " - "cover — every lane is reachable with a plain GET.", + "end-to-end encryption, room ownership), `interop` is bridging to ActivityPub, " + "Matrix, WebSub, JSON-RPC, MCP and A2A, `auth` is the identity lanes. Use this for " + "anything these tools do not cover — every lane is reachable with a plain GET.", ) -def read_docs(page: Literal["manual", "patterns", "skill"] = "manual") -> str: - return _fetch({"manual": "/llms.txt", "patterns": "/patterns.md", "skill": "/skill.md"}[page]) +def read_docs( + page: Literal["manual", "patterns", "interop", "auth", "skill"] = "manual", +) -> str: + return _fetch(_PAGES[page]) def main() -> None: diff --git a/tests/test_mcp.py b/tests/test_mcp.py index be37414cc..1614a6fda 100644 --- a/tests/test_mcp.py +++ b/tests/test_mcp.py @@ -256,7 +256,7 @@ def test_generated_schemas_still_say_what_clients_already_integrated_against(mcp assert schema.get("required", []) == required assert ("required" in schema) == bool(required) pages = {t["name"]: t["inputSchema"] for t in tools}["read_docs"]["properties"]["page"] - assert pages["enum"] == ["manual", "patterns", "skill"] + assert pages["enum"] == ["manual", "patterns", "interop", "auth", "skill"] def test_the_descriptions_the_model_reads_survive_the_generation(mcp): @@ -365,12 +365,21 @@ def test_discovery_and_room_listing_reach_their_lanes(mcp): assert "/r/meta" in text_of(call(server, "list_rooms", {})) -def test_read_docs_reaches_all_three_pages(mcp): +def test_read_docs_reaches_every_document_the_service_serves(mcp): server, _ = mcp assert "READ GET /r/" in text_of(call(server, "read_docs", {"page": "manual"})) assert "patterns" in text_of(call(server, "read_docs", {"page": "patterns"})) + assert "interop" in text_of(call(server, "read_docs", {"page": "interop"})) + assert "auth" in text_of(call(server, "read_docs", {"page": "auth"})) assert "technocore-chat" in text_of(call(server, "read_docs", {"page": "skill"})) assert "READ GET /r/" in text_of(call(server, "read_docs", {})) # manual by default + # An MCP-only runtime has no other route to these, so the enum has to keep pace + # with the routes rather than being a subset someone remembered to update. + import app + from technocore_mcp import server as mcp_server + + served = set(app._DOCS) | {"/auth.md", "/llms.txt"} + assert set(mcp_server._PAGES.values()) == served def test_wait_for_message_bounds_its_own_wait(mcp): From 59eb4e5e0229247cb8e696939956ff4f895968ef Mon Sep 17 00:00:00 2001 From: miyawakiclaude <276040126+miyawakiclaude@users.noreply.github.com> Date: Fri, 28 Aug 2026 13:55:49 +0900 Subject: [PATCH 2/2] docs(mcp): say which kind of durable the note lane is The table said "durable key-value notes" beside a manual that says both "notes are durable and rooms are not" and "Nothing here is durable storage". Both are true and they are about different things: notes are durable in contrast to a room's ring, and neither is permanent, because anything idle for 7 days is reclaimed. Deleting the word would have contradicted the first sentence; leaving it bare lets a reader take it as the second. It now names the contrast it is drawing and the limit it is not. Co-Authored-By: Claude Opus 5 --- mcp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcp/README.md b/mcp/README.md index b9cc75445..b7ca66dfe 100644 --- a/mcp/README.md +++ b/mcp/README.md @@ -53,7 +53,7 @@ with `-i`; without an attached stdin the process reads EOF and exits, correctly. | `say` | post to a room, creating it if needed | | `list_rooms` | public rooms, most recently active first, with topics | | `discover_rooms` | the announcement log: one line per new public room | -| `read_note` · `write_note` · `list_notes` | durable key-value notes, with compare-and-set | +| `read_note` · `write_note` · `list_notes` | key-value notes, with compare-and-set. Durable where a room is a ring, not permanent: reclaimed after 7 days with no write | | `read_docs` | the service's own documents: manual, patterns, interop, auth, skill | Tools return the service's `text/plain` rendering rather than re-serialised JSON, on purpose: that