Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9d3c9fd
feat: MCP graph server
StarpTech Apr 11, 2025
00b7672
chore: proper nullable handling, graceful shutdown mcp
StarpTech Apr 11, 2025
fe327d4
chore: add list_graphql_operations endpoint
StarpTech Apr 11, 2025
acef17e
chore: seperate operation execution info from listing
StarpTech Apr 12, 2025
18838b5
chore: explain which operations has sideeffects
StarpTech Apr 12, 2025
275bfcd
chore: allow to exclude mutations
StarpTech Apr 12, 2025
0471660
chore: improve prompt
StarpTech Apr 12, 2025
c7b618b
chore: add recovery handler and pagination limit
StarpTech Apr 13, 2025
e813f91
chore: split into multiple files
StarpTech Apr 13, 2025
e9f6027
chore: implement get_schema, execute_graphql and refactor code
StarpTech Apr 13, 2025
8613d83
chore: add fs to storage provider
StarpTech Apr 14, 2025
0690467
chore: add integration tests
StarpTech Apr 15, 2025
035bddc
chore: improve tests
StarpTech Apr 15, 2025
82344d8
chore: add auth header support
StarpTech Apr 15, 2025
4bbb795
chore: fix tests, rename /sse to /mcp
StarpTech Apr 15, 2025
3cab111
Merge branch 'main' into dustin/eng-6881-mcp-support-in-the-router
StarpTech Apr 15, 2025
3ec16e4
chore: merge
StarpTech Apr 15, 2025
a24e11d
chore: use snake case library, shutdown mcpserver when graph is swapped
StarpTech Apr 16, 2025
419f79f
chore: set accept header
StarpTech Apr 16, 2025
ccf63e2
Merge branch 'main' into dustin/eng-6881-mcp-support-in-the-router
StarpTech Apr 16, 2025
94d61e5
chore: reload mcp server on schema reload, improve error handling
StarpTech Apr 16, 2025
cbcc2d5
chore: update naming
StarpTech Apr 16, 2025
bb39d73
Merge branch 'main' into dustin/eng-6881-mcp-support-in-the-router
StarpTech Apr 16, 2025
5aa3032
chore: address feedback
StarpTech Apr 16, 2025
4f94240
chore: remove list operation info
StarpTech Apr 16, 2025
ed68912
chore: improve
StarpTech Apr 16, 2025
ac4b962
chore: allow to pass custom router url for proxy use cases
StarpTech Apr 17, 2025
75a0e5c
chore: delete example mcp ops, revert demo config
StarpTech Apr 17, 2025
180d372
chore: validate raw json schema before use
StarpTech Apr 17, 2025
2da5494
chore: remove defer in walker
StarpTech Apr 17, 2025
7c59d6a
chore: use enum in get_operation_info
StarpTech Apr 17, 2025
41952df
chore: upgrade client to fix tool tests
StarpTech Apr 17, 2025
f9c4b50
chore: bump engine
StarpTech Apr 17, 2025
74eaa60
Merge branch 'main' into dustin/eng-6881-mcp-support-in-the-router
StarpTech Apr 17, 2025
dc9f5c5
chore: improve
StarpTech Apr 17, 2025
203c1fa
chore: validate operations based on schema
StarpTech Apr 17, 2025
51b8820
chore: ignore cancellation errors in test env
StarpTech Apr 17, 2025
6f6ad3d
chore: fix
StarpTech Apr 17, 2025
252335f
chore: fix tests
StarpTech Apr 17, 2025
318cd42
chore: detect duplicate mcp operations and use filename as fallback
StarpTech Apr 18, 2025
434ca99
chore: simplify and use mcp-go fork due to issue in shutdown logic
StarpTech Apr 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions demo/pkg/subgraphs/availability/subgraph/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ extend schema
@link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@authenticated", "@composeDirective", "@external", "@extends", "@inaccessible", "@interfaceObject", "@override", "@provides", "@key", "@requires", "@requiresScopes", "@shareable", "@tag"])

type Mutation {
""" This mutation updates the availability status of an employee in the system."""
updateAvailability(employeeID: Int!, isAvailable: Boolean!): Employee!
}
type Employee @key(fields: "id") {
Expand Down
2 changes: 2 additions & 0 deletions demo/pkg/subgraphs/family/subgraph/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ extend schema
@link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@authenticated", "@composeDirective", "@external", "@extends", "@inaccessible", "@interfaceObject", "@override", "@provides", "@key", "@requires", "@requiresScopes", "@shareable", "@tag"])

type Query {
""" This is a GraphQL query that retrieves a list of employees."""
findEmployees(criteria: SearchInput): [Employee!]!
}

Expand Down Expand Up @@ -103,6 +104,7 @@ type Employee @key(fields: "id") {
details: Details @shareable
}

""" Allows to filter employees by their details. """
input SearchInput {
hasPets: Boolean
nationality: Nationality
Expand Down
1 change: 1 addition & 0 deletions demo/pkg/subgraphs/mood/subgraph/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ extend schema
@link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@authenticated", "@composeDirective", "@external", "@extends", "@inaccessible", "@interfaceObject", "@override", "@provides", "@key", "@requires", "@requiresScopes", "@shareable", "@tag"])

type Mutation {
""" This mutation update the mood of an employee. """
updateMood(employeeID: Int!, mood: Mood!): Employee!
}

Expand Down
20 changes: 0 additions & 20 deletions demo/pkg/subgraphs/mood/subgraph/schema.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions router-tests/cache_warmup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,14 +856,14 @@ func TestCacheWarmup(t *testing.T) {
otel.WgClientVersion.String(""),
// This is a miss, because we just planned it
otel.WgEnginePlanCacheHit.Bool(false),
otel.WgFeatureFlag.String(""),
otel.WgFederatedGraphID.String("graph"),
otel.WgOperationHash.String("1163600561566987607"),
otel.WgOperationName.String(""),
otel.WgOperationType.String("query"),
otel.WgRouterClusterName.String(""),
otel.WgFederatedGraphID.String("graph"),
otel.WgRouterConfigVersion.String(xEnv.RouterConfigVersionMain()),
otel.WgRouterVersion.String("dev"),
otel.WgFeatureFlag.String(""),
),
Count: 1,
},
Expand Down
3 changes: 3 additions & 0 deletions router-tests/events/nats_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,22 @@ import (
const NatsWaitTimeout = time.Second * 30

func assertLineEquals(t *testing.T, reader *bufio.Reader, expected string) {
t.Helper()
line, _, err := reader.ReadLine()
assert.NoError(t, err)
assert.Equal(t, expected, string(line))
}

func assertMultipartPrefix(t *testing.T, reader *bufio.Reader) {
t.Helper()
assertLineEquals(t, reader, "")
assertLineEquals(t, reader, "--graphql")
assertLineEquals(t, reader, "Content-Type: application/json")
assertLineEquals(t, reader, "")
}

func assertMultipartValueEventually(t *testing.T, reader *bufio.Reader, expected string) {
t.Helper()
assert.Eventually(t, func() bool {
assertMultipartPrefix(t, reader)
line, _, err := reader.ReadLine()
Expand Down
11 changes: 9 additions & 2 deletions router-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/hasura/go-graphql-client v0.12.2
github.com/mark3labs/mcp-go v0.21.1
github.com/nats-io/nats.go v1.35.0
github.com/ory/dockertest/v3 v3.11.0
github.com/prometheus/client_golang v1.19.1
Expand All @@ -25,7 +26,7 @@ require (
github.com/twmb/franz-go/pkg/kadm v1.11.0
github.com/wundergraph/cosmo/demo v0.0.0-20250325163111-208e63bb0e3d
github.com/wundergraph/cosmo/router v0.0.0-20250325163111-208e63bb0e3d
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.169
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.170
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/sdk v1.28.0
go.opentelemetry.io/otel/sdk/metric v1.28.0
Expand Down Expand Up @@ -84,6 +85,7 @@ require (
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/jensneuse/abstractlogger v0.0.4 // indirect
github.com/jensneuse/byte-template v0.0.0-20231025215717-69252eb3ed56 // indirect
github.com/joho/godotenv v1.5.1 // indirect
Expand Down Expand Up @@ -136,6 +138,7 @@ require (
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.23.0 // indirect
Expand Down Expand Up @@ -176,4 +179,8 @@ replace (
// github.com/wundergraph/graphql-go-tools/v2 => ../../graphql-go-tools/v2
)

replace github.com/hashicorp/consul/sdk => github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301
replace (
github.com/hashicorp/consul/sdk => github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301
// Due to https://github.com/mark3labs/mcp-go/pull/128
github.com/mark3labs/mcp-go => github.com/wundergraph/mcp-go v0.0.0-20250418103513-9bd590ca8b7f
)
10 changes: 8 additions & 2 deletions router-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hasura/go-graphql-client v0.12.2 h1:cYeQK/CELtvFy2jvik4kG0b5UMGngQRYWTTXQkbGHDo=
github.com/hasura/go-graphql-client v0.12.2/go.mod h1:17qYcHgGSensF/wMAHKUhtMYaRZwZa3TyD7biqH9L3k=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/jensneuse/abstractlogger v0.0.4 h1:sa4EH8fhWk3zlTDbSncaWKfwxYM8tYSlQ054ETLyyQY=
github.com/jensneuse/abstractlogger v0.0.4/go.mod h1:6WuamOHuykJk8zED/R0LNiLhWR6C7FIAo43ocUEB3mo=
github.com/jensneuse/byte-template v0.0.0-20231025215717-69252eb3ed56 h1:wo26fh6a6Za0cOMZIopD2sfH/kq83SJ89ixUWl7pCWc=
Expand Down Expand Up @@ -315,8 +317,10 @@ github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 h1:8/D7f8gKxTB
github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083/go.mod h1:eOTL6acwctsN4F3b7YE+eE2t8zcJ/doLm9sZzsxxxrE=
github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301 h1:EzfKHQoTjFDDcgaECCCR2aTePqMu9QBmPbyhqIYOhV0=
github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301/go.mod h1:wxI0Nak5dI5RvJuzGyiEK4nZj0O9X+Aw6U0tC1wPKq0=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.169 h1:x8cSom3UvI8PqRB+4DNJKepP3cA5KgBm0vEnEalZyvo=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.169/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.170 h1:gOu7Sh4O2HUtKAdsKoxHF28my+o8f8vbJId40nrGwJ0=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.170/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ=
github.com/wundergraph/mcp-go v0.0.0-20250418103513-9bd590ca8b7f h1:8NnjSbokfzVMSso/qdcMmp2pt376rkASdVdOWwmrh3g=
github.com/wundergraph/mcp-go v0.0.0-20250418103513-9bd590ca8b7f/go.mod h1:KmJndYv7GIgcPVwEKJjNcbhVQ+hJGJhrCCB/9xITzpE=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
Expand All @@ -326,6 +330,8 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
Expand Down
Loading