Add MCP server endpoint at /mcp#177
Merged
Merged
Conversation
zer0stars
force-pushed
the
feat/mcp-server
branch
4 times, most recently
from
March 28, 2026 04:15
1a53a2a to
14bd4f7
Compare
Expose an MCP (Model Context Protocol) Streamable HTTP endpoint that lets LLM agents query identity-api's GraphQL surface via the standard MCP transport. Unauthenticated to match /query (public read API). - schema/directives.graphqls: new @mcptool / @mcpExample / @mcpHide directives - schema/aftermarket.graphqls, schema/vehicle.graphqls: annotate aftermarketDevice, vehicle, and vehicles with @mcptool / @mcpExample - graph/mcp_tools_gen.go: generated via server-garage mcpgen; 3 tools (identity_get_aftermarket_device, identity_get_vehicle, identity_list_vehicles) - graph/resolver.go: //go:generate runs mcpgen after gqlgen - cmd/identity-api/main.go: build the MCP handler on the same ExecutableSchema as /query, mount at /mcp with zerolog context injection - gqlgen.yml: mark mcpTool / mcpExample skip_runtime - go.mod: add server-garage + modelcontextprotocol/go-sdk (bumps gqlgen to v0.17.89 hence the no-op resolver header churn)
7 tasks
zer0stars
force-pushed
the
feat/mcp-server
branch
from
April 20, 2026 14:24
52cb103 to
653144b
Compare
…ndensed schema trim - Drop context.Background() arg from New() call - Regen condensed schema via updated mcpgen (stronger self-evident filter, legend-fold) - Remove redundant @mcpExample on vehicles(owner:...)
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.
Summary
Expose an MCP (Model Context Protocol) Streamable HTTP endpoint at
/mcpso LLM agents can query identity-api's GraphQL surface via the standard MCP transport. Unauthenticated to match the public/queryendpoint.History rewritten on 2026-04-20 — surgical rebase on top of current
mainreplacing the prior branch that had stripped schema docstrings and accumulated ~13 unrelated conflicts.Why draft
Depends on server-garage v0.1.0 (DIMO-Network/server-garage#31). Before marking ready:
replace github.com/DIMO-Network/server-garage => /Users/zer0stars/workspace/server-garagefromgo.modgithub.com/DIMO-Network/server-garage v0.1.0go mod tidyWhat's in this PR
graph/schema/directives.graphqls(new):@mcpTool/@mcpExample/@mcpHidegraph/schema/aftermarket.graphqls,graph/schema/vehicle.graphqls: annotateaftermarketDevice,vehicle,vehicleswith@mcpTool/@mcpExample(docstrings preserved)graph/mcp_tools_gen.go(new): generated bymcpgen; 3 tools —identity_get_aftermarket_device,identity_get_vehicle,identity_list_vehiclesgraph/resolver.go://go:generatenow runsmcpgenaftergqlgengqlgen.yml:mcpTool/mcpExamplemarkedskip_runtimecmd/identity-api/main.go: build MCP handler on the sameExecutableSchemaas/query, mount at/mcp, inject zerolog contextgo.mod: addserver-garage+modelcontextprotocol/go-sdk v1.4.1(bumps gqlgen to v0.17.89 → one-line no-op version-header churn across resolver files)Test plan
go build ./...go test ./...(full suite incl. testcontainers integration tests)golangci-lintcleango generate ./graph/...produces stable outputgo mod tidyclean; CI greenPOST /mcptools/listreturns 3 tools;tools/call identity_get_vehiclereturns vehicle datahttps://identity-api.dev.dimo.zone/mcpwithtools/list