feat(mcp): discoverability — --list-tools, --probe, rivet docs mcp#231
Open
feat(mcp): discoverability — --list-tools, --probe, rivet docs mcp#231
Conversation
`rivet mcp --list-tools` walks the registered tool router and prints the catalog (15 tools today) as either a human-readable table or — with `--format json` — the JSON-RPC `tools/list` payload exactly as the stdio server would emit it. Does not start the server and does not need a project to be present, so it works as a fast capability probe even before any artifact files exist. `rivet mcp --probe` runs the in-process equivalent of `tools/call rivet_list` (no args) against the current project and prints the decoded `result.content[0].text` payload — the same envelope an MCP client would observe — without standing up a stdio server. Used as a smoke test for AI integrators verifying their project is reachable through MCP. Both flags reuse the same handlers the wire server dispatches to, so their output cannot drift from what a real client would see. Implements: REQ-007 Refs: FEAT-010
…log, gotchas Adds an embedded documentation topic for the MCP server, registered in the docs registry so `rivet docs mcp` and the `rivet docs` listing both surface it. Companion to the new `rivet mcp --list-tools` and `rivet mcp --probe` flags. Covers: what the server exposes; the line-delimited JSON-RPC over stdio wire format (and the LSP Content-Length pitfall it is NOT); the 3-message handshake including the easily-forgotten `notifications/initialized` notification; the 15-tool catalog with inputs; the `result.content[0].text` double-parse envelope gotcha; three smoke-test recipes (`--list-tools`, `--probe`, raw bash JSON-RPC); the mutate-then-`rivet_reload` convention; and a pointer to the upstream MCP spec for clients building from scratch. Also amends `rivet docs cli` to mention the new `mcp` subflags and cross-link to `rivet docs mcp`. Trace: skip
📐 Rivet artifact deltaNo artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph. |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 681563c | Previous: 92ad95d | Ratio |
|---|---|---|---|
link_graph_build/10000 |
36870006 ns/iter (± 4159555) |
30052745 ns/iter (± 2252438) |
1.23 |
query/10000 |
141563 ns/iter (± 4674) |
109024 ns/iter (± 1298) |
1.30 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Scenario C dogfood (an AI integrator wiring rivet's MCP server into a
custom client) burned ~30 minutes on two unrelated discoverability
gaps: figuring out the JSON-RPC framing the server expects (line-delimited
vs LSP-style Content-Length) and writing throwaway JSON-RPC by hand to
enumerate the tool catalog. Both should be solvable in seconds.
What
Two changes on top of
feat/v0.5.0-readme-quickstart-changelog:rivet mcp --list-toolsandrivet mcp --probe— two new flagson the existing
rivet mcpsubcommand. Neither starts a long-runningserver.
--list-toolswalks the registeredToolRouterand prints the15-tool catalog. Default output is a human table;
--format jsonemits the JSON-RPC
tools/listpayload exactly as the wire serverwould. Works without a project loaded — useful as a "is this
binary an MCP-capable rivet?" check before any setup.
--proberuns the in-process equivalent oftools/call rivet_list(no args) against the current project and prints the decoded
result.content[0].textpayload. Verifies the project loads, theschema parses, and a real read tool returns artifacts — without
spinning up stdio.
Both reuse the exact handlers the wire server dispatches to, so
their output cannot drift from a real session.
rivet docs mcp— a new embedded doc topic (~1400 words) thatcovers what the server exposes, the wire format (line-delimited
JSON-RPC, NOT LSP Content-Length), the 3-message handshake (with the
easily-forgotten
notifications/initializednotification), the15-tool catalog with inputs, the
result.content[0].textdouble-parse gotcha, three smoke-test recipes (one of them the
bash-only raw JSON-RPC fallback), the mutate-then-
rivet_reloadconvention, and a pointer to the upstream MCP spec. Registered in
the docs index so
rivet docslistsmcpalongsidecli,cross-repo, etc.Also amends
rivet docs clito mention the new flags and cross-linkto
rivet docs mcp.Test plan
cargo check --workspace— cleancargo clippy --workspace --all-targets -- -D warnings— clean(only pre-existing MSRV info warning, no new lint errors)
cargo fmt --allcargo test -p rivet-cli --test mcp_integration— 22/22 pass,including
test_tools_list_returns_all_15_toolsrivet docslistsmcpunder Referencerivet docs mcpprints the new topic (1411 words)rivet mcp --list-toolslists 15 tools with parametersrivet mcp --list-tools --format jsonemits a JSON-RPCtools/list-shaped payload (result.tools[]with name,description, inputSchema)
rivet mcp --probereturns therivet_listpayload (759artifacts on this project) without errors
rivet --project /tmp mcp --list-toolsworks without a projectTrailers
Per CLAUDE.md, the feature commit carries:
The docs commit is
Trace: skip(docs-only, exempt per the AGENTS.mdtrailer policy).
🤖 Generated with Claude Code