Dev loop¶
How to iterate on the gateway efficiently.
Run the demo¶
bash
docker compose --profile demo up --build
Brings up k3s + Prometheus + Loki + the three chaos services + the gateway. Edit, save, the dev server restarts; the demo stack keeps running.
Stop with docker compose --profile demo down.
Local hot-reload¶
mcp-server/ runs npm run dev under tsx watch — every save
restarts the server. The Web UI is a single HTML file at
mcp-server/src/ui/index.html; reload the browser tab to pick up
edits.
Add a tool¶
- Define the handler in
mcp-server/src/tools/<your-tool>.ts. Follow the pattern fromquery-logs.ts: - export an
inputSchemaJSON-Schema object - export an async handler that returns
{ content: [...], isError: false }(always includeisError: falseon the success path so strict tsc accepts the union of return shapes). - Add the tool name to both arrays in
mcp-server/src/tools/registry-names.ts. A test enforces the 1:1 mapping withregisterTool()call sites inindex.ts. - Register the handler in
mcp-server/src/index.tsinsidecreateMcpServer— copy the shape of thequery_tracesblock: enforceEntitledAccess(RBAC + Product gate)withToolMetrics(Prometheus counter + latency)chargeTokenBudget(per-identity quota)- Add unit tests in
tools/<your-tool>.test.ts(node:test assert/strict). A FakeRegistry / FakeConnector shape lives in most existing test files — crib it.- Run locally:
bash docker run --rm -w /app -v "$(pwd)/mcp-server:/app" node:20-alpine \ sh -c "npm install --silent && npx tsx --test src/tools/<your-tool>.test.ts"
Add a connector¶
- New file at
mcp-server/plugins/<your-connector>/: manifest.jsonperdocs/plugin-architecture.md- implementation file(s)
- Implement the
ObservabilityConnectorinterface from@thotischner/observability-mcp/sdk. Optional methods to add based on capability: queryMetrics?(metrics signal)queryLogs?(logs signal)queryTraces?(traces signal — Phase F13+)listResources?/listEdges?/getTopologySnapshot?/watchTopology?(topology signal)- The loader picks it up on next boot when the plugin tarball is
in
/app/plugins. For signed-plugin testing seedocs/plugin-architecture.md.
Run the conformance harness¶
Boot the demo, then:
bash
make conformance
Runs mcp-server/src/conformance/mcp-2025-11-25.test.ts against
the live /mcp endpoint. CI runs the same target on every PR.
Run the full test suite¶
bash
docker run --rm -w /app -v "$(pwd)/mcp-server:/app" node:20-alpine \
sh -c "npm install --silent && find src -name '*.test.ts' -print0 | xargs -0 npx tsx --test"
This mirrors what CI runs.
Reviewer-agent gate before push¶
The sprint plan requires every PR to clear a reviewer-agent gate (quality + sensitive-data scan) before push. Catching things like "oh that test fake didn't implement the full interface" pre-push is dramatically cheaper than catching it from a red CI build.
Playground tab (planned)¶
A built-in playground tab that mirrors Inspector inline is on the F18b list — until it lands, use the actual Inspector via the Quickstart.