|
| 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