Skip to content

Commit 7f9317f

Browse files
cliffhallclaude
andcommitted
feat: add the project-structure, local-dev, testing and client-smoke skills
Four knowledge skills adapted from the MCP Inspector's (#4872), each with committed eval cases and a row in the AGENTS.md Skills index. - project-structure: what is inside each server and where a new file goes. - local-dev: install, build and run each server from the checkout. - testing: the harness each server has today, recipes, commands, and test versus coverage. It describes v2/main as it stands; #4854 and #4855 update it when they change the harnesses and add a threshold. - client-smoke: the Inspector CLI as the scripted path, the web UI by hand, and an LLM client. The servers are on v1 SDKs, so only the legacy protocol era can be exercised today, and the skill says so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent 2b97691 commit 7f9317f

9 files changed

Lines changed: 885 additions & 0 deletions

File tree

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
---
2+
name: client-smoke
3+
description: "Drive a locally built server with a real client: the Inspector CLI (scripted), the Inspector web UI (by hand) and an LLM client. Use when smoke-testing a server change; when calling a tool, reading a resource or getting a prompt from the command line; when choosing a protocol era; or when the Inspector CLI will not connect to, or misreads, a server command."
4+
disable-model-invocation: false
5+
---
6+
7+
# Client smoke
8+
9+
A server change is checked against real clients before its PR opens: the MCP
10+
Inspector and an LLM client. This skill is how to run each one against a server
11+
built from this checkout, and what the output means. What the PR must then
12+
record is in `/pr-flow` (client evidence); building and starting the server is
13+
`/local-dev`; automated tests are `/testing`.
14+
15+
Three clients, in the order to reach for them:
16+
17+
| Client | Driven by | Use it for |
18+
| --- | --- | --- |
19+
| Inspector **CLI** | A command. This is the **scripted path**, and the one an agent runs | One request, one JSON result: the evidence that goes in a PR |
20+
| Inspector **web** UI | A person, by hand. Nothing in this repo automates a browser | What only a UI shows: notifications arriving, elicitation and sampling prompts, a long-running tool's progress |
21+
| An **LLM client** | A prompt | Whether a model picks the tool and uses its result, which the PR checklist asks for |
22+
23+
Build first (`npm run build -w src/<server>`). Every command below runs the
24+
last build of a TypeScript server, not your edit.
25+
26+
## The Inspector CLI
27+
28+
```sh
29+
npx -y @modelcontextprotocol/inspector --cli <server command> [-- ] <inspector options>
30+
```
31+
32+
It starts the server command over stdio (or connects to a URL), sends one
33+
request, prints the result and exits. Pin the Inspector version in anything you
34+
keep (`@modelcontextprotocol/inspector@<version>`); the commands here were run
35+
on 2.9.0. `--cli --help` is the reference for the options.
36+
37+
```sh
38+
INSPECT="npx -y @modelcontextprotocol/inspector --cli"
39+
40+
# List, then call, on a TypeScript server
41+
$INSPECT node src/everything/dist/index.js stdio --method tools/list --format json
42+
$INSPECT node src/everything/dist/index.js stdio \
43+
--method tools/call --tool-name echo --tool-arg message=hello --format json
44+
# → {"result":{"content":[{"type":"text","text":"Echo: hello"}]}}
45+
46+
# Arguments that are not strings: pass them as JSON
47+
$INSPECT node src/everything/dist/index.js stdio \
48+
--method tools/call --tool-name get-sum --tool-args-json '{"a":2,"b":3}' --format json
49+
50+
# Resources and prompts
51+
$INSPECT node src/everything/dist/index.js stdio \
52+
--method resources/read --uri demo://resource/dynamic/text/1 --format json
53+
$INSPECT node src/everything/dist/index.js stdio \
54+
--method prompts/get --prompt-name args-prompt --prompt-args city=Paris --format json
55+
56+
# A server that takes a positional argument
57+
$INSPECT node src/filesystem/dist/index.js /abs/dir \
58+
--method tools/call --tool-name list_allowed_directories --format json
59+
60+
# A Python server: note the `--` (see below)
61+
$INSPECT uv --directory src/time run mcp-server-time -- \
62+
--method tools/call --tool-name get_current_time --tool-arg timezone=UTC --format json
63+
$INSPECT uv --directory src/git run mcp-server-git --repository "$PWD" -- \
64+
--method tools/list --format json
65+
```
66+
67+
`--format json` prints one JSON object on stdout, `{"result": …}` or
68+
`{"error": …}`, which is the form to paste into a PR. The server's own stderr
69+
(its startup banner) still passes through, so capture stdout alone.
70+
71+
### How the command line is split
72+
73+
The server command comes **first** and the Inspector's options **after** it.
74+
With no `--`, the server command ends at the first word that starts with `-`.
75+
That rule produces the three failures people actually hit:
76+
77+
- **A server command with its own flags needs `--` before the Inspector's
78+
options.** `uv --directory …` and `mcp-server-git --repository …` both have
79+
one. Without the separator the command is cut at `--directory`, and what runs
80+
is a bare `uv`, which prints its help and exits. With it, everything before
81+
`--` is the server command and everything after is the Inspector's.
82+
- **Putting an Inspector option before the server command loses the command.**
83+
`--cli -e KEY=VALUE node …` leaves no server command at all, and the CLI
84+
falls back to your personal catalog (`~/.mcp-inspector/mcp.json`). With
85+
several servers in it that fails with `Multiple servers found in config
86+
file. Please specify one with --server`. Either way it is no longer talking
87+
to your build, so move the option after the command.
88+
- **`Method is required`** means the options ended up on the wrong side of a
89+
`--`.
90+
91+
### Environment variables
92+
93+
The spawned server does **not** inherit your shell's environment. Setting
94+
`MEMORY_FILE_PATH=… npx …` has no effect on the server; pass it with `-e`:
95+
96+
```sh
97+
$INSPECT node src/memory/dist/index.js \
98+
-e MEMORY_FILE_PATH=/abs/tmp/graph.jsonl \
99+
--method tools/call --tool-name read_graph --format json
100+
```
101+
102+
### Exit codes and errors
103+
104+
The exit code is the verdict, so check it rather than reading the text:
105+
106+
| Outcome | stdout | Exit |
107+
| --- | --- | --- |
108+
| The request succeeded | `{"result": …}` | 0 |
109+
| The tool ran and returned `isError: true` | The result, then `{"error":{"code":"tool_is_error", …}}` | 5 |
110+
| No such tool | `{"error":{"code":"tool_not_found", …}}` | 5 |
111+
| Could not connect, or bad arguments | `{"error":{"code":"error", …}}` | 1 |
112+
113+
A tool error is a **successful protocol exchange**: the result object is still
114+
printed, and it is what to quote when the change is about an error a tool
115+
returns.
116+
117+
### `everything` over HTTP
118+
119+
Start the transport in one terminal (or in the background), then give the CLI
120+
the URL. The transport is inferred from the path: `/mcp` is Streamable HTTP,
121+
`/sse` is HTTP+SSE.
122+
123+
```sh
124+
PORT=3917 node src/everything/dist/index.js streamableHttp &
125+
$INSPECT http://localhost:3917/mcp \
126+
--method tools/call --tool-name echo --tool-arg message=over-http --format json
127+
kill %1
128+
```
129+
130+
A change to a tool, resource or prompt of `everything` is checked over stdio
131+
and Streamable HTTP. Check HTTP+SSE as well when the change touches transport
132+
or session code; it is deprecated but must keep working.
133+
134+
## Protocol eras
135+
136+
The Inspector connects in one of three eras, chosen with `--protocol-era` (the
137+
CLI) or **Server Settings → Protocol Era** (the web UI):
138+
139+
| Era | What the Inspector does |
140+
| --- | --- |
141+
| `legacy` (the default) | A plain `initialize`. Negotiates 2025-11-25 or older |
142+
| `modern` | Pins 2026-07-28 through `server/discover`, with no fallback |
143+
| `auto` | Probes `server/discover`, and falls back to `initialize` |
144+
145+
⚠️ **Only the legacy era can be exercised against these servers today.** All
146+
seven are on a v1 SDK (`@modelcontextprotocol/sdk` 1.x, `mcp` 1.x), whose
147+
newest protocol version is 2025-11-25. None implements `server/discover`. So:
148+
149+
- `--protocol-era modern` fails, by design, with `Version negotiation failed:
150+
the server did not offer pinned protocol version 2026-07-28 via
151+
server/discover (no fallback in pin mode)` and exit 1. That is the expected
152+
result for an unmigrated server, not a regression in your change.
153+
- `--protocol-era auto` succeeds, but through the fallback, so it is a legacy
154+
connection and proves nothing about 2026-07-28.
155+
156+
The both-eras check that `/pr-flow` asks for (#4857) therefore has one half
157+
that can pass today. For a server still on a v1 SDK, record the legacy run,
158+
and say in the PR that the server does not yet speak 2026-07-28 rather than
159+
leaving the modern era unmentioned. Once a server is migrated under #4857, run
160+
every command twice, with `--protocol-era legacy` and `--protocol-era modern`,
161+
and expect both to succeed. Do not use `auto` for evidence in either case: it
162+
does not say which era answered.
163+
164+
## The Inspector web UI
165+
166+
The web client is the hand-driven path. It needs a person at a browser; this
167+
repo configures no browser automation, so an agent prepares the command and
168+
the steps and asks for what was observed.
169+
170+
```sh
171+
npx -y @modelcontextprotocol/inspector node src/everything/dist/index.js stdio
172+
npx -y @modelcontextprotocol/inspector -- uv --directory src/time run mcp-server-time
173+
npx -y @modelcontextprotocol/inspector --transport http --server-url http://localhost:3001/mcp
174+
```
175+
176+
⚠️ **The web launcher reads `--` the other way round from the CLI.** Here the
177+
Inspector's own options come **before** `--` and the server command **after**
178+
it; in `--cli` mode the server command is before `--` and the options after.
179+
A line copied from one mode to the other starts the wrong thing. Pass a
180+
server's environment with `-e KEY=VALUE` before the `--`.
181+
182+
Use the web UI for what a single request cannot show: `toggle-simulated-logging` and
183+
`toggle-subscriber-updates` (notifications over time),
184+
`trigger-elicitation-request` and `trigger-sampling-request` (the client is
185+
asked something), `trigger-long-running-operation` (progress), and a
186+
filesystem server's response to a Roots change.
187+
188+
Evidence from the web UI is what was clicked and what appeared, in words. This
189+
repo does not attach screenshots.
190+
191+
## An LLM client
192+
193+
The PR checklist asks whether the change was tested with an LLM client. Any
194+
client that can launch a stdio server works; each server's `README.md` has the
195+
config blocks for Claude Desktop and VS Code, and `/local-dev` shows how to
196+
point one at the local build.
197+
198+
Claude Code can do it in one headless command, which makes it the scriptable
199+
option. Write a config that names the local build with an **absolute** path:
200+
201+
```json
202+
{
203+
"mcpServers": {
204+
"everything": {
205+
"command": "node",
206+
"args": ["/abs/path/to/servers/src/everything/dist/index.js", "stdio"]
207+
}
208+
}
209+
}
210+
```
211+
212+
```sh
213+
printf '%s' "Call the echo tool of the everything server with the message 'llm-smoke' and reply with exactly the text it returned." \
214+
| claude -p --mcp-config /abs/path/to/config.json --strict-mcp-config \
215+
--allowedTools "mcp__everything__echo" --max-turns 3
216+
# → Echo: llm-smoke
217+
```
218+
219+
`--strict-mcp-config` makes the file the only source of servers, so the answer
220+
cannot have come from a published copy configured elsewhere. A tool is
221+
addressed as `mcp__<server name in the config>__<tool name>`, and only the
222+
tools listed in `--allowedTools` can be called without a prompt. Keep the
223+
config file outside the worktree.
224+
225+
An LLM client does not report which protocol version it negotiated, and offers
226+
no era switch. Record the client and its version; do not present an LLM run as
227+
evidence for a particular era.
228+
229+
## What to write down
230+
231+
For each client: the command or the prompt, and the result trimmed to what
232+
shows the change. For a bug fix, run the same CLI command against `v2/main`
233+
and against the branch, and keep both outputs. Where the evidence goes in the
234+
PR, and what a change with no client-visible surface records instead, is
235+
`/pr-flow`.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[
2+
{
3+
"prompt": "Smoke-test my change to the time server with the Inspector CLI.",
4+
"expect": "client-smoke"
5+
},
6+
{
7+
"prompt": "How do I call a tool on my locally built server from the command line and get JSON back?",
8+
"expect": "client-smoke"
9+
},
10+
{
11+
"prompt": "The Inspector CLI says 'Multiple servers found in config file' when I pass it my server command. How do I fix it?",
12+
"expect": "client-smoke"
13+
},
14+
{
15+
"prompt": "How do I check my server change against a 2026-07-28 client?",
16+
"expect": "client-smoke"
17+
},
18+
{
19+
"prompt": "How do I get Claude Code to call a tool on my local build of the everything server in one headless command?",
20+
"expect": "client-smoke"
21+
},
22+
{
23+
"prompt": "How do I open the Inspector web UI against my local build of the git server?",
24+
"expect": "client-smoke"
25+
},
26+
{
27+
"prompt": "Summarize the plot of Hamlet in two sentences.",
28+
"expect": null
29+
},
30+
{
31+
"prompt": "Convert 5 kilometers to miles.",
32+
"expect": null
33+
}
34+
]

0 commit comments

Comments
 (0)