repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

docs(system): mcp frontend plan and interface mode

2acdbd880b1f89514a414b22feda44546799f85d

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

+75 / −0 text lines

Diff layout

.system/plans/SMH-PLAN-H7QBKZ4Z-model-context-protocol-frontend/index.md

Added
new file mode 100644

+68 / −0 text lines

1---
2id: SMH-PLAN-H7QBKZ4Z
3type: plan
4title: "Model Context Protocol Frontend"
5spec: SMH-SPEC-SPEC0001
6status: draft
7depends_on: [SMH-PLAN-CORE0001]
8---
9
10# Model Context Protocol Frontend
12## Outcome
14Agent clients speak MCP to a running smith: list tools, call them with durable evidence, read sessions as resources, watch progress.
15`smith-mcp` is the second `smith-ui` consumer and the generality proof that the UI vocabulary serves non-terminal audiences.
17## Scope
19The `smith-ui` intent vocabulary v0 with a diagnostic reference consumer, the `smith-mcp` crate over the `rmcp` engine, and the `smith mcp` interface mode.
20Daemon, HTTP serving, and OAuth flows stay in the remote-frontends spec; this plan delivers the client-spawned stdio server.
22## Behaviors
24Ordered by delivery value.
261. **Intent vocabulary v0**: `smith-ui` defines semantic intents — progress, notification, transcript append — each with its per-intent degradation behavior.
272. **Diagnostic consumer**: `smith-ui` renders every intent as structured records; it becomes the conformance reference all frontends test against.
283. **RPC event mapping**: the existing smith-rpc event stream emits intents, proving the vocabulary against the first headless consumer in place.
294. **MCP server mode**: `smith mcp` runs a client-spawned stdio server; initialize handshake, tool listing over the built-in `read`, `write`, `edit`, `bash`, `find`, `grep`, `ls`; tool calls execute through the tool session with durable, attributable effects.
305. **Progress streaming**: long-running tool calls stream MCP progress notifications sourced from intent events.
316. **Sessions as resources**: sessions list and read as MCP resources; transcript appends surface as resource updates.
327. **Degradation conformance**: overlay and theme intents degrade under MCP per the intent law; the diagnostic consumer verifies equivalence.
34## Behavior structure
36```mermaid
37flowchart LR
38 V["Intent vocabulary v0"] --> D["Diagnostic consumer"]
39 V --> R["RPC event mapping"]
40 D --> M["MCP server mode"]
41 R --> M
42 M --> P["Progress streaming"]
43 M --> S["Sessions as resources"]
44 P --> G["Degradation conformance"]
45 S --> G
46```
48## Interfaces
50- `smith-ui`: intent types, degradation metadata, diagnostic renderer.
51- `smith-mcp`: rmcp engine ownership, MCP constructs, intent translation.
52- `smith-cli`: `mcp` interface mode.
53- `smith-core`: tool session, durable effects, session store.
55## Verification
57- An MCP client completes initialize, tools/list, and one tools/call per built-in tool end to end.
58- Progress notifications arrive during a long tool call and stop at completion.
59- A session read as a resource returns the full ordered transcript.
60- Diagnostic and MCP consumers produce equivalent records for identical intent scripts.
61- No credential material crosses the MCP boundary.
62- Tool calls made through MCP leave the same durable evidence as local calls.
64## Stop conditions
66- An intent cannot express its MCP translation without mode sniffing.
67- rmcp cannot serve the stdio subset without pulling a runtime decision.
68- A tool call through MCP would bypass the durable effect boundary.

.system/specs/SMH-SPEC-SPEC0001-smith-specification/index.md

Modified

+7 / −0 text lines

342342Replay operates without provider credentials.
343343Structured replay output is deterministic for the same session and trace inputs.
345### Model Context Protocol
347`smith mcp` serves MCP over stdio as a client-spawned frontend.
348It consumes the smith-ui intent vocabulary: progress maps to progress notifications, sessions to resources, built-in tools to MCP tools.
349Intents without an MCP translation degrade per the intent law.
350Remote serving and OAuth flows belong to the remote-frontends spec.
345352## Documentation and help
347354Public Rust and plugin SDK APIs are documented.