Skip to content

Commit af893e8

Browse files
mcp: Upgrade conformance test to latest available deployoment (#1021)
Upgrade conformance test to the 0.2.0-alpha.5 version, and differentiate legacy from 20260728 servers.
1 parent a817f61 commit af893e8

2 files changed

Lines changed: 40 additions & 19 deletions

File tree

.github/workflows/conformance.yml

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
permissions:
1414
contents: read
1515

16+
env:
17+
CONFORMANCE_VERSION: "0.2.0-alpha.5"
18+
1619
jobs:
1720
server-conformance:
1821
runs-on: ubuntu-latest
@@ -23,19 +26,34 @@ jobs:
2326
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
2427
with:
2528
go-version: "^1.26"
26-
- name: Start everything-server
27-
run: |
28-
go run ./conformance/everything-server/main.go -http=":3001" &
29-
# Wait for the server to be ready.
30-
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp; do sleep 0.5; done'
31-
- name: "Run conformance tests"
32-
uses: modelcontextprotocol/conformance@a2855b03582a6c0b31065ad4d9af248316ce61a3 # v0.1.15
29+
- name: Set up Node.js
30+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3331
with:
34-
mode: server
35-
url: http://localhost:3001/mcp
36-
suite: active
37-
expected-failures: ./conformance/baseline.yml
3832
node-version: 22
33+
- name: Build everything-server
34+
run: go build -o everything-server ./conformance/everything-server
35+
- name: Run conformance tests (stateful, legacy spec versions)
36+
run: |
37+
./everything-server -http=":3001" -stateless=false &
38+
SERVER_PID=$!
39+
trap "kill -9 $SERVER_PID 2>/dev/null || true; wait $SERVER_PID 2>/dev/null || true" EXIT
40+
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
41+
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
42+
--url http://localhost:3001/mcp \
43+
--suite active \
44+
--spec-version 2025-11-25 \
45+
--expected-failures ./conformance/baseline.yml
46+
- name: Run conformance tests (stateless, 2026-07-28)
47+
run: |
48+
./everything-server -http=":3001" -stateless &
49+
SERVER_PID=$!
50+
trap "kill -9 $SERVER_PID 2>/dev/null || true; wait $SERVER_PID 2>/dev/null || true" EXIT
51+
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
52+
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
53+
--url http://localhost:3001/mcp \
54+
--suite active \
55+
--spec-version 2026-07-28 \
56+
--expected-failures ./conformance/baseline.yml
3957
4058
client-conformance:
4159
runs-on: ubuntu-latest
@@ -46,11 +64,13 @@ jobs:
4664
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
4765
with:
4866
go-version: "^1.26"
49-
- name: "Run conformance tests"
50-
uses: modelcontextprotocol/conformance@a2855b03582a6c0b31065ad4d9af248316ce61a3 # v0.1.15
67+
- name: Set up Node.js
68+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
5169
with:
52-
mode: client
53-
command: go run ./conformance/everything-client
54-
suite: core
55-
expected-failures: ./conformance/baseline.yml
5670
node-version: 22
71+
- name: Run conformance tests
72+
run: |
73+
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" client \
74+
--command "go run ./conformance/everything-client" \
75+
--suite core \
76+
--expected-failures ./conformance/baseline.yml

conformance/everything-server/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ import (
2727
)
2828

2929
var (
30-
httpAddr = flag.String("http", "", "if set, use streamable HTTP at this address, instead of stdin/stdout")
30+
httpAddr = flag.String("http", "", "if set, use streamable HTTP at this address, instead of stdin/stdout")
31+
stateless = flag.Bool("stateless", true, "use stateless streamable HTTP mode")
3132
)
3233

3334
const watchedResourceURI = "test://watched-resource"
@@ -60,7 +61,7 @@ func main() {
6061
if *httpAddr != "" {
6162
handler := mcp.NewStreamableHTTPHandler(func(*http.Request) *mcp.Server {
6263
return server
63-
}, nil)
64+
}, &mcp.StreamableHTTPOptions{Stateless: *stateless})
6465
log.Printf("Conformance server listening at %s", *httpAddr)
6566
log.Fatal(http.ListenAndServe(*httpAddr, handler))
6667
} else {

0 commit comments

Comments
 (0)