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.
This commit is contained in:
parent
a817f61412
commit
af893e8d1e
2 changed files with 40 additions and 19 deletions
54
.github/workflows/conformance.yml
vendored
54
.github/workflows/conformance.yml
vendored
|
|
@ -13,6 +13,9 @@ concurrency:
|
|||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CONFORMANCE_VERSION: "0.2.0-alpha.5"
|
||||
|
||||
jobs:
|
||||
server-conformance:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -23,19 +26,34 @@ jobs:
|
|||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
||||
with:
|
||||
go-version: "^1.26"
|
||||
- name: Start everything-server
|
||||
run: |
|
||||
go run ./conformance/everything-server/main.go -http=":3001" &
|
||||
# Wait for the server to be ready.
|
||||
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp; do sleep 0.5; done'
|
||||
- name: "Run conformance tests"
|
||||
uses: modelcontextprotocol/conformance@a2855b03582a6c0b31065ad4d9af248316ce61a3 # v0.1.15
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||
with:
|
||||
mode: server
|
||||
url: http://localhost:3001/mcp
|
||||
suite: active
|
||||
expected-failures: ./conformance/baseline.yml
|
||||
node-version: 22
|
||||
- name: Build everything-server
|
||||
run: go build -o everything-server ./conformance/everything-server
|
||||
- name: Run conformance tests (stateful, legacy spec versions)
|
||||
run: |
|
||||
./everything-server -http=":3001" -stateless=false &
|
||||
SERVER_PID=$!
|
||||
trap "kill -9 $SERVER_PID 2>/dev/null || true; wait $SERVER_PID 2>/dev/null || true" EXIT
|
||||
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
|
||||
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
|
||||
--url http://localhost:3001/mcp \
|
||||
--suite active \
|
||||
--spec-version 2025-11-25 \
|
||||
--expected-failures ./conformance/baseline.yml
|
||||
- name: Run conformance tests (stateless, 2026-07-28)
|
||||
run: |
|
||||
./everything-server -http=":3001" -stateless &
|
||||
SERVER_PID=$!
|
||||
trap "kill -9 $SERVER_PID 2>/dev/null || true; wait $SERVER_PID 2>/dev/null || true" EXIT
|
||||
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
|
||||
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
|
||||
--url http://localhost:3001/mcp \
|
||||
--suite active \
|
||||
--spec-version 2026-07-28 \
|
||||
--expected-failures ./conformance/baseline.yml
|
||||
|
||||
client-conformance:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -46,11 +64,13 @@ jobs:
|
|||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
||||
with:
|
||||
go-version: "^1.26"
|
||||
- name: "Run conformance tests"
|
||||
uses: modelcontextprotocol/conformance@a2855b03582a6c0b31065ad4d9af248316ce61a3 # v0.1.15
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||
with:
|
||||
mode: client
|
||||
command: go run ./conformance/everything-client
|
||||
suite: core
|
||||
expected-failures: ./conformance/baseline.yml
|
||||
node-version: 22
|
||||
- name: Run conformance tests
|
||||
run: |
|
||||
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" client \
|
||||
--command "go run ./conformance/everything-client" \
|
||||
--suite core \
|
||||
--expected-failures ./conformance/baseline.yml
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
httpAddr = flag.String("http", "", "if set, use streamable HTTP at this address, instead of stdin/stdout")
|
||||
httpAddr = flag.String("http", "", "if set, use streamable HTTP at this address, instead of stdin/stdout")
|
||||
stateless = flag.Bool("stateless", true, "use stateless streamable HTTP mode")
|
||||
)
|
||||
|
||||
const watchedResourceURI = "test://watched-resource"
|
||||
|
|
@ -60,7 +61,7 @@ func main() {
|
|||
if *httpAddr != "" {
|
||||
handler := mcp.NewStreamableHTTPHandler(func(*http.Request) *mcp.Server {
|
||||
return server
|
||||
}, nil)
|
||||
}, &mcp.StreamableHTTPOptions{Stateless: *stateless})
|
||||
log.Printf("Conformance server listening at %s", *httpAddr)
|
||||
log.Fatal(http.ListenAndServe(*httpAddr, handler))
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue