Skip to content

Commit ef5c3dc

Browse files
dprevoznikclaude
andcommitted
Document MCP Inspector testing flow in AGENTS.md
Add an Inspector CLI recipe to the local-testing section, noting the 127.0.0.1-vs-localhost fetch gotcha, the streamable-http transport flag, and that the tool surface boots without Clerk/Redis env. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1265a2d commit ef5c3dc

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,32 @@ Key MCP methods: `initialize`, `tools/list`, `tools/call`, `resources/list`, `pr
134134

135135
The `KERNEL_API_KEY` env var is passed as the Bearer token and forwarded to the Kernel SDK for API calls. The `search_docs` tool works without network restrictions; other tools (`manage_browsers`, etc.) require connectivity to the Kernel platform API.
136136

137+
#### Testing with the MCP Inspector
138+
139+
The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) CLI is the fastest way to exercise tools without hand-writing the JSON-RPC handshake. This flow has been run against a live server and works:
140+
141+
```bash
142+
bun run dev # starts on :3002
143+
144+
# list tools
145+
npx -y @modelcontextprotocol/inspector --cli http://127.0.0.1:3002/mcp \
146+
--transport streamable-http \
147+
--header "Authorization: Bearer $KERNEL_API_KEY" \
148+
--method tools/list
149+
150+
# call a tool
151+
npx -y @modelcontextprotocol/inspector --cli http://127.0.0.1:3002/mcp \
152+
--transport streamable-http \
153+
--header "Authorization: Bearer $KERNEL_API_KEY" \
154+
--method tools/call --tool-name manage_browsers --tool-arg action=create
155+
```
156+
157+
Gotchas found while running this:
158+
159+
- Use `http://127.0.0.1:3002/mcp`, **not** `localhost` — the Inspector's Node `fetch` resolves `localhost` to IPv6 and fails with `fetch failed`. `curl` works either way, which can be misleading.
160+
- Pass `--transport streamable-http` (bare `http` fails to connect).
161+
- The tool surface needs **no** `.env`/Clerk/Redis to test: the API-key bearer path skips Clerk verification and the `/mcp` route does not import the OAuth `const.ts`/Redis modules, so `bun run dev` boots clean and forwards your bearer straight to the SDK. (OAuth routes like `/token` and `/authorize` still need the full env.)
162+
137163
### Required secrets
138164

139165
- `OP_SERVICE_ACCOUNT_TOKEN` — 1Password service account token for `op run` to resolve `.env` references

0 commit comments

Comments
 (0)