Repository navigation
docs: README parity with protoc-gen-go-mcp (#13) - #30
Merged
Merged
Conversation
Brings README.md to parity with Go's reference README at stablekernel/protoc-gen-go-mcp@9e072f9, filling in its [TODO]s: - Prerequisites: Rust toolchain, protoc 29.3, and the pinned protoc-gen-{prost,tonic,prost-serde} versions with install commands, plus a table of the generated code's own runtime crates and why each is needed. - Running the plugin: the full protoc --rust-mcp_out=... invocation alongside the prost/tonic/serde plugins, make generate, and how the output is include!d. - Debugging the plugin: protoc-gen-debug (new script) saves the CodeGeneratorRequest to request.bin; replay it under rust-lldb/ rust-gdb or VS Code CodeLLDB (new .vscode/launch.json). Rust has no direct counterpart of Go's dlv --headless step, so this is two-step instead of one script that also launches a debugger. - Testing the example: unchanged (was already filled in). - What the plugin generates: stdio and Streamable HTTP wiring snippets, kept compiling by a new examples/tests/wiring.rs (the counterpart of Go's Example_wiring), needing new hyper/hyper-util dev-dependencies and rmcp's transport-streamable-http-server feature in examples/Cargo.toml. - How tool arguments map to the request message: every rule from Go's section, restated for pbjson (field names, 64-bit integers, enums, bytes, non-finite floats, zero-value omission, gRPC error text) and cross-checked against this repo's own schema.rs/server.rs doc comments and handler.rs assertions. - A new Differences from protoc-gen-go-mcp section, per #20's PR review feedback on this issue: Any's pbjson shape, non-finite float results as JSON null, no editions support, and FieldMask's protojson-matching (not pbjson-matching) treatment. - Philosophical Notes: the Rust version of Go's three composable parts (tool, handler, registration), using this repo's own generated identifier names. - Topeka and Maintainers sections: kept as-is. Every command in the README (prerequisite installs, the direct protoc invocation, make generate, cargo install --path examples --bin mcp-vibe, the protoc-gen-debug replay) was run in the factory image; see the PR for the transcript. The wiring snippets are compiled by cargo test via examples/tests/wiring.rs.
3 tasks
Contributor
Author
|
🔍 Review: LGTM. It's thorough and matches the Go README section for section, with a precise Differences section. I ran the debugging workflow in the factory image: |
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.
Closes #13
Summary
Brings
README.mdto parity with Go's reference README atstablekernel/protoc-gen-go-mcp@9e072f9,filling in every
[TODO]:protoc-gen-prost/protoc-gen-tonic/protoc-gen-prost-serdeversionswith an install command, plus a table of the generated code's own
runtime crates (prost, tonic, pbjson/pbjson-types 0.8, rmcp,
serde_json, jsonschema, futures) and why each is needed.
protoc --rust-mcp_out=...invocation alongside the prost/tonic/serde plugins,
make generate,and how the output is
include!d.protoc-gen-debugscript (executable) that saves the
CodeGeneratorRequesttorequest.bin; replay it directly, underrust-lldb/rust-gdb, or inVS Code with CodeLLDB and a new
.vscode/launch.json.Go's
protoc-gen-debugis a one-liner that also startsdlv --headless; Rust debuggers have no direct equivalent of that singlestep, so this is a save-then-replay two-step instead. The README is
explicit that neither
lldbnorgdbitself is installed in thefactory image (only
rustup's wrapper scripts are) — CodeLLDB bundlesits own LLDB, so that path needs no separate install.
snippets, kept compiling by a new
examples/tests/wiring.rs(thecounterpart of Go's
Example_wiring). The Streamable HTTP snippetneeded new
hyper/hyper-utildev-dependencies andrmcp'stransport-streamable-http-serverfeature inexamples/Cargo.toml(checked against
rmcp3.5.1/hyper1.12.0/hyper-util0.1.21, theversions
Cargo.lockalready pinned viatonic's own dependency onaxum/hyper, by compiling the exact feature set standalone beforewiring it into the workspace — see that file's doc comment).
Go's section, restated for pbjson (field names, 64-bit integers,
enums,
bytes, non-finite floats, zero-value omission, gRPC errortext) and cross-checked against this repo's own
schema.rs/server.rsdoc comments and
examples/tests/handler.rs's assertions (exact errortext, exact
rpc error: code = ...format).review feedback on this issue:
Any's pbjson shape vs. protojson's,non-finite float results as JSON
null(input still accepts allthree strings either way), no editions support, and that
google.protobuf.FieldMaskis made to match Go (not a divergence).parts (tool, handler, registration), using this repo's own generated
identifier names (
VIBE_SERVICE_SET_VIBE_INPUT_SCHEMA,call_set_vibe, etc.) instead of Go's.Decisions made along the way
protoc-gen-debugstarts a debugger (dlv --headless) directly;there's no Rust tool that does the equivalent single step, so I split
it into "save the request" (the new script) + "replay it under
whatever debugger you have" (documented for
rust-lldb/rust-gdb/VSCode CodeLLDB). I called out explicitly that the factory image has
neither
lldbnorgdbinstalled (onlyrustup's wrapper scripts,which need one of those) so nobody is misled into thinking the
rust-lldbcommand works out of the box here; CodeLLDB (which bundlesits own LLDB) is the one documented path that is usable without any
further local install.
examples/tests/*.rsfile(not a doctest), matching how Go's
Example_wiringlives in a_test.gofile compiled-but-never-run bygo vet/go test: bothfunctions in
wiring.rswould block forever if called, so neither isan actual
#[test].Test evidence
All commands below were run in this factory image (
rustc 1.99.0,cargo 1.99.0,protoc 29.3/protoc-gen-prost0.5.0/protoc-gen-tonic0.5.0/
protoc-gen-prost-serde0.4.0 already onPATH).Repo checks (
AGENTS.md):README commands, each run directly in a scratch directory (not
committed):
protoc-gen-prost@0.5.0/protoc-gen-tonic@0.5.0/protoc-gen-prost-serde@0.4.0were already installed in this image (per
Dockerfile.factory); Iconfirmed their versions (
protoc-gen-prost --versionetc. →0.5.0,0.5.0,0.4.0) rather than reinstalling.Notes for reviewers
examples/Cargo.toml's new dev-dependencies (hyper,hyper-util,and
rmcp's addedtransport-streamable-http-serverfeature) onlyaffect test builds, not the published runtime API;
Cargo.lock's diffalso picks up a second
base64version (0.22.1 and 0.23.1) astransitive fallout from
sse-stream(pulled in bytransport-streamable-http-server) wanting a newerbase64than therest of the dependency graph — normal, not hand-edited.
I did not re-run
rust-lldb/rust-gdbend to end since neitherlldbnor
gdbitself is installed in this image; the README says soexplicitly rather than claiming otherwise.
protoc-gen-debugand thereplay-without-a-debugger path (
cargo build+ run the binarydirectly against the saved request) are both verified above.
Self-reviewed via the
reviewersubagent against this issue'sacceptance criteria; it found no blocking issues (one nit about
calling out the duplicate
base64version inCargo.lock, addressedin this description).
Factory-authored