feat: add subscription listen streams (SEP-2575) (#1000)
* feat: add subscription listen streams * refactor: reuse legacy request helper
This commit is contained in:
parent
8ee9ee68f1
commit
ff1a715b6e
1 changed files with 3617 additions and 223 deletions
73
.github/workflows/conformance.yml
vendored
73
.github/workflows/conformance.yml
vendored
|
|
@ -85,79 +85,6 @@ jobs:
|
|||
echo "draft conformance server did not become ready" >&2
|
||||
exit 1
|
||||
|
||||
# useful for enforcing partial conformance for SEP-2575.
|
||||
# when `server-stateless` is removed from `expected-failures-2026-07-28.yaml`,
|
||||
# this step can be removed.
|
||||
- name: Run SEP-2575 discovery contract
|
||||
run: |
|
||||
endpoint=http://127.0.0.1:8002/mcp
|
||||
common_headers=(
|
||||
-H "Content-Type: application/json"
|
||||
-H "Accept: application/json, text/event-stream"
|
||||
-H "Mcp-Method: server/discover"
|
||||
)
|
||||
|
||||
discover_response="$(
|
||||
curl --fail-with-body --silent --show-error \
|
||||
"${common_headers[@]}" \
|
||||
-H "MCP-Protocol-Version: 2026-07-28" \
|
||||
--data '{
|
||||
"jsonrpc": "2.0",
|
||||
"id": "discover",
|
||||
"method": "server/discover",
|
||||
"params": {
|
||||
"_meta": {
|
||||
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
|
||||
"io.modelcontextprotocol/clientInfo": {
|
||||
"name": "conformance-workflow",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"io.modelcontextprotocol/clientCapabilities": {}
|
||||
}
|
||||
}
|
||||
}' \
|
||||
"$endpoint"
|
||||
)"
|
||||
jq -e '
|
||||
.result.resultType == "complete" and
|
||||
(.result.supportedVersions | index("2026-07-28") != null) and
|
||||
(.result.capabilities | type == "object") and
|
||||
(.result.serverInfo.name | type == "string") and
|
||||
.result.ttlMs == 0 and
|
||||
.result.cacheScope == "private"
|
||||
' <<<"$discover_response"
|
||||
|
||||
status="$(
|
||||
curl --silent --show-error \
|
||||
--output /tmp/unsupported-version.json \
|
||||
--write-out "%{http_code}" \
|
||||
"${common_headers[@]}" \
|
||||
-H "MCP-Protocol-Version: 2099-01-01" \
|
||||
--data '{
|
||||
"jsonrpc": "2.0",
|
||||
"id": "unsupported",
|
||||
"method": "server/discover",
|
||||
"params": {
|
||||
"_meta": {
|
||||
"io.modelcontextprotocol/protocolVersion": "2099-01-01",
|
||||
"io.modelcontextprotocol/clientInfo": {
|
||||
"name": "conformance-workflow",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"io.modelcontextprotocol/clientCapabilities": {}
|
||||
}
|
||||
}
|
||||
}' \
|
||||
"$endpoint"
|
||||
)"
|
||||
test "$status" = "400"
|
||||
jq -e '
|
||||
.id == "unsupported" and
|
||||
.error.code == -32022 and
|
||||
.error.data.requested == "2099-01-01" and
|
||||
(.error.data.supported | index("2026-07-28") != null)
|
||||
' /tmp/unsupported-version.json
|
||||
|
||||
- name: Run 2026-07-28 server suite
|
||||
run: |
|
||||
npx -y "@modelcontextprotocol/conformance@${DRAFT_CONFORMANCE_VERSION}" server \
|
||||
|
|
|
|||
Loading…
Reference in a new issue