Skip to content

test: end-to-end test of a generated MCP server (gRPC backend + MCP client) #87

Closed

Description

@erikist

Part of #44. This is the behavioural safety net for the migration: it pins down what MCP clients see today, so the official-SDK version (#89) can be checked against it.

Do

Add an end-to-end test (e.g. examples/gen/example/v1/e2e_test.go, or test/e2e/) that:

  1. Starts an in-memory gRPC server (google.golang.org/grpc/test/bufconn) with a fake VibeService that records the requests it receives and returns canned responses or errors.
  2. Builds the generated MCP server (NewVibeServiceMCPServer + RegisterDefaultTools) on a client to that backend.
  3. Talks MCP to it in-process, using mark3labs' in-process client if v0.21 has one, otherwise MCPServer.HandleMessage with JSON-RPC messages.
  4. Asserts:
    • tools/list: the tool names, descriptions and input schemas (snapshot them).
    • tools/call for every RPC: the arguments sent reach the fake backend as the right proto request.
    • Results: the tool result content matches the response.
    • Errors: a gRPC error (e.g. codes.NotFound) produces a tool result with isError: true.

Keep the MCP-client part behind one small helper (e.g. listTools(t), callTool(t, name, args)), so the migration only has to swap that helper.

Today's generated schema nests arguments under a property named after the request message, while the handler reads them from the top level. Test what the handler does today (top-level arguments), and mark the schema mismatch with a // KNOWN BUG (#88/#89) comment instead of asserting the wrong schema.

Acceptance criteria

  • go test ./... passes, covering all 5 VibeService RPCs plus at least one gRPC error case.
  • Runs in under 5 seconds and needs no network or protoc.

Activity

  1. erikist commented on Oct 8, 2026

    @erikist
    ContributorAuthor

    🤖 Factory: picked up by dispatcher; working on branch factory/87-test-end-to-end-test-of.

  2. erikist commented on Oct 8, 2026

    @erikist
    ContributorAuthor

    🤖 Factory: opened PR #95 with an end-to-end test (examples/gen/example/v1/e2e_test.go) covering tools/list and tools/call for all 5 VibeService RPCs plus a gRPC error case, against a fake backend over bufconn. go test ./... passes in ~10ms. See the PR for details, including documented KNOWN BUG behaviors for #88/#89 to address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions