Repository navigation
feat!: generate MCP servers on the official Go MCP SDK #89
Copy link
Copy link
Labels
factory:in-progressA factory worker is on itA factory worker is on itfactory:readyReady for the factory to pick upReady for the factory to pick up
Milestone
Description
Closes #44. The core migration from github.com/mark3labs/mcp-go to the official SDK, github.com/modelcontextprotocol/go-sdk v1.8.0 (requires Go 1.25). It lands on main; the old official-go-mcp branch and draft #74 are superseded, but #74's typed-handler idea is fine to reuse.
Do
go.mod:go 1.25, requiregithub.com/modelcontextprotocol/go-sdk v1.8.0. Remove mark3labs fromgo.modandgo.sum.- Generator (
cmd/protoc-gen-go-mcp/mcp.go), for each non-streaming RPC:- Tool:
&mcp.Tool{Name, Description, InputSchema: <schema from #88 for the request message, emitted as a json.RawMessage literal>}. - Registration:
mcp.AddTool[json.RawMessage, any](server, tool, handler)so that the SDK validates arguments against the schema (rawServer.AddTooldoes not validate). - Handler:
protojson.Unmarshal(args, req)→ call the gRPC client.- On success: return
&mcp.CallToolResult{Content: []mcp.Content{&mcp.TextContent{Text: protojson.Marshal(resp)}}}. - On a gRPC error: return it as a Go error, which the SDK turns into an
isErrorresult. Include the gRPC status code in the message.
- On success: return
- Exported API: keep the generated names and shape (
New<Service>MCPServer, the per-tool accessors,RegisterDefaultTools) wherever the official types allow, and list any change in the PR body.
- Tool:
- Examples: regenerate them, and update the golden file (test: golden-file test for the plugin's generated code #85).
cmd/mcp-vibe:mcp.NewServer(&mcp.Implementation{...}, nil)+server.Run(ctx, &mcp.StdioTransport{}).- End-to-end test (test: end-to-end test of a generated MCP server (gRPC backend + MCP client) #87): swap its MCP-client helper to
mcp.NewInMemoryTransports()+mcp.NewClient(...).Connect(...)+ClientSession.CallTool.- Resolve the
KNOWN BUGmarkers: the advertised schema must now be the top-level request schema. - Add a case where invalid arguments (wrong type or unknown field) produce
isError: trueand never reach the backend.
- Resolve the
- PR: a
feat!:title and aBREAKING CHANGE:note in the body listing what users must change.
Acceptance criteria
-
grep -rn mark3labs .finds nothing (outside the CHANGELOG). -
go build ./...,go vet ./...andgo test ./...pass, including the golden and e2e tests. - Regeneration:
make generatereproduces the committed examples exactly. - Smoke test, pasted in the PR:
mcp-vibeover stdio answersinitialize,tools/listand onetools/call.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
factory:in-progressA factory worker is on itA factory worker is on itfactory:readyReady for the factory to pick upReady for the factory to pick up
Activity
test(e2e): drop low-value deadline test, dedupe known-bug comment (#87)
test(e2e): isolate MCP client, stop asserting known-buggy values (#87)
erikist commentedon Oct 8, 2026
🤖 Factory: picked up by dispatcher; working on branch factory/89-feat-generate-mcp-servers-on-the.
erikist commentedon Oct 8, 2026
🤖 Factory: opened PR #99 migrating the generator, examples,
cmd/mcp-vibe, and the e2e test togithub.com/modelcontextprotocol/go-sdkv1.8.0 (Go 1.25). All ofgofmt -l .,go vet ./...,go build ./..., andgo test ./...pass,make generatereproduces the committed examples exactly, and a stdio smoke test ofmcp-vibe(initialize / tools/list / tools/call) succeeds. See the PR body for the full breaking-change list and test evidence.test: assert SetVibe's full input schema in TestToolsList (#89)