You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: comment processing, description fallback and file header (port from Go) #4
Part of #2. Port the text helpers in Go's cmd/protoc-gen-go-mcp/mcp.go at 9e072f9, with their tests from mcp_test.go. Tool descriptions and schema descriptions both depend on them, so their output must match Go's character for character.
Do
Comments. Look up leading comments from SourceCodeInfo by path: the method, the message, the field, the enum, and the syntax/package detached comments for the file header.
process_comment_to_string: a port of processCommentToString.
Handle line comments (strip // from continuation lines) and block comments (strip /* and */).
Join the lines with spaces, trim, and collapse whitespace runs into one space.
Do not escape anything; callers escape for their own context. This was a real bug in Go (#100): escaping here and again in the caller produced double escaping.
camel_to_space: a port of camelToSpace, the fallback description when a method has no comment (e.g. SetVibeDetails → Set Vibe Details). Include the letter↔digit boundaries.
File header:// @generated by protoc-gen-rust-mcp. DO NOT EDIT., followed by // versions: with the plugin version and protoc vX.Y.Z[-suffix] (or (unknown)) from compiler_version. This mirrors Go's protocVersion.
Rust string literals: a helper that emits arbitrary text, such as descriptions and the JSON schema, as a valid Rust literal. Prefer a raw string r#"…"# with enough #s; it must survive any comment text, including "#, backslashes and backticks.
Acceptance criteria
Port every case in Go's TestProcessCommentToString and TestUnexport/TestQuoteBacktickString (or their Rust-literal equivalents), plus the example proto's tricky comments: the block comment on SetVibe (quotes, a backtick, C:\vibes\new) and the multi-line GetVibe comment with its trailing empty // line. Each expected string must equal Go's output; take the expected values from the descriptions in Go's committed examples/gen/example/v1/example_mcp.pb.go.
Add a property test or table test showing that the literal helper round-trips any string through syn::parse_str::<syn::LitStr>, or something equivalent.
🤖 Factory: opened PR #19 implementing comment processing, description fallback and the file header, ported from Go's cmd/protoc-gen-go-mcp/mcp.go (commit 9e072f9). All checks in AGENTS.md pass; details and test evidence in the PR.
Activity
erikist commentedon Oct 9, 2026
🤖 Factory: picked up by dispatcher; working on branch factory/4-feat-comment-processing-description-fallback-and.
erikist commentedon Oct 9, 2026
🤖 Factory: opened PR #19 implementing comment processing, description fallback and the file header, ported from Go's
cmd/protoc-gen-go-mcp/mcp.go(commit9e072f9). All checks in AGENTS.md pass; details and test evidence in the PR.fix(plugin): collapse only ASCII whitespace in comment processing (#4)
feat: comment processing, description fallback and file header (#4) (#19
refactor(schema): use #19's shared comment helpers (#5)
feat: generate JSON Schema for tool inputs from proto descriptors (#5) (
fix: start generated .mcp.rs with the DO NOT EDIT header (#6)
feat: generate MCP tool definitions and the server registration API (#6…