Skip to content

Commit f9d7acf

Browse files
os-steveclaude
andauthored
docs(mcp): rewrite the published README to the shipped host-extension surface (#9579) (#9868)
The page told the reader to extend the server imperatively — `kernel.getService('mcp').registerTool/registerResource/registerPrompt` at six call sites. `MCPServerRuntime` has never had any of those members, and the receiver is a local variable, so both halves of check:published-readme-exports are structurally blind to it. Ruled 2026-08-18: document the shipped surface, do not grow the API to match the docs. The imperative narrative is replaced by what actually ships — the bridge methods, handleHttpRequest / renderSkill, and the exported registerObjectTools / registerActionTools / registerSkillPrompts helpers. Every row is probed against the built dist/index.d.ts and the host-extension example compiles clean against it. ⚠️ The ruling also named `registerToolFromDefinition` as the story to document. It is `private` on the built type (TS2341 for any consumer), so it is NOT documented — writing it down would recreate this card's own defect in a new spelling. Its public counterparts (bridgeDataTools, registerObjectTools, registerActionTools) carry that story instead. Neighbouring fabrications corrected in the same pass: an entire invented `objectstack_*` tool family; a missing `aggregate_records`; two wrong `objectstack://` resource URI shapes plus two omitted ones; an invented capability block claiming subscribe/listChanged/streaming when the server derives capabilities and hand-declares only `logging`; the undocumented OS_MCP_STDIO_ENABLED / OS_MCP_STDIO_API_KEY pair without which stdio refuses to boot; and a relative link resolving above the repo root. Docs only — no runtime code changed, and no API was added. Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4f994de commit f9d7acf

2 files changed

Lines changed: 272 additions & 301 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
"@objectstack/mcp": patch
3+
---
4+
5+
docs(mcp): rewrite the published README to the shipped host-extension surface (#9579)
6+
7+
`packages/mcp/README.md` is in the package's `files` array with `private` unset,
8+
so it is the page npm renders. It told the reader to extend the server
9+
imperatively at six call sites:
10+
11+
```ts
12+
kernel.getService('mcp').registerTool(calculateRevenueTool);
13+
kernel.getService('mcp').registerResource({ … });
14+
kernel.getService('mcp').registerPrompt({ … });
15+
```
16+
17+
`MCPServerRuntime` has never had any of those members. Measured against the
18+
built `dist/index.d.ts`, a consumer who copies those lines gets three
19+
`TS2339 Property … does not exist on type 'MCPServerRuntime'`. The receiver is a
20+
local variable, so `check:published-readme-exports` is structurally blind to
21+
them — both of its halves key on a name the fence *imported*, and this one is
22+
neither imported nor a bare identifier.
23+
24+
Ruled 2026-08-18: **document the shipped surface; do not grow the API to match
25+
the docs.** So the imperative narrative is gone and the page now documents what
26+
actually ships — the bridge methods (`bridgeTools`, `bridgeDataTools`,
27+
`bridgeResources`, `bridgePrompts`), `handleHttpRequest` / `renderSkill`, and the
28+
exported `registerObjectTools` / `registerActionTools` / `registerSkillPrompts`
29+
helpers driving an `McpServer`. Every row is probed against the built type entry
30+
the `exports` map resolves, and the page's one host-extension example compiles
31+
clean against it.
32+
33+
Neighbouring fabrications the audit turned up, all corrected in the same pass —
34+
each of them was reachable only through prose or an unimported receiver, which is
35+
why nothing had read them:
36+
37+
- **A tool family that does not exist.** The page listed
38+
`objectstack_find` / `objectstack_findOne` / `objectstack_create` /
39+
`objectstack_update` / `objectstack_delete` / `objectstack_describeObject` /
40+
`objectstack_listObjects` / `objectstack_listFields` as "auto-registered". No
41+
such tool name occurs anywhere in the repo. The real names are the
42+
`list_objects``run_action` set the page listed separately, one section down.
43+
- **`aggregate_records` was missing** from the list that *was* correct, along
44+
with the fact that it registers only when the bridge implements `aggregate`.
45+
- **Resource URIs were wrong in both directions.** The page taught
46+
`objectstack://objects/{name}/records` (no such resource) and
47+
`objectstack://objects/{name}/{id}` (real shape is
48+
`…/{name}/records/{id}`), and omitted `objectstack://objects` and
49+
`objectstack://metadata/types` entirely.
50+
- **The advertised capability block was invented.** It claimed
51+
`tools.listChanged`, `resources.subscribe`, `resources.listChanged`,
52+
`prompts.listChanged` and `experimental.streaming`. The server hand-declares
53+
only `logging`; everything else is *derived* from what was actually registered,
54+
which is the ADR-0076 D12 contract the README was contradicting. The
55+
"Streaming Support" feature bullet and the streaming-resource example went with
56+
it — neither names anything that ships.
57+
- **The stdio transport could not be started by following the page.** Neither
58+
`OS_MCP_STDIO_ENABLED` nor `OS_MCP_STDIO_API_KEY` was documented, and stdio
59+
auto-start refuses to boot without the key (ADR-0101, fail-closed). The three
60+
client config blocks now carry both. The Debugging section also taught
61+
`OS_MCP_SERVER_ENABLED=true` as the stdio switch, which is the deprecated path
62+
that logs a warning.
63+
- **A broken relative link.** `../../spec/src/ai/` resolves above the repo root
64+
from `packages/mcp/`; the target is `../spec/src/ai/`.
65+
66+
Docs only — no runtime code changed, and no API was added. `registerTool` /
67+
`registerResource` / `registerPrompt` remain unbuilt by ruling; a future
68+
imperative API is its own card on measured pull.

0 commit comments

Comments
 (0)