-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathknown-sdks.ts
More file actions
177 lines (174 loc) · 7.81 KB
/
Copy pathknown-sdks.ts
File metadata and controls
177 lines (174 loc) · 7.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import type { SdkConfig } from './config';
/**
* Built-in conformance configs for official SDKs, keyed by repo name.
*
* These live here (not in the SDK repos) so adding an SDK to the matrix
* doesn't require a coordinated cross-repo PR. Any field can be overridden
* per-invocation via the CLI flags (--build-cmd / --client-cmd / etc.).
*/
export const KNOWN_SDKS: Record<string, SdkConfig> = {
// v2 — the monorepo on `main` (pnpm). Default ref is `main`.
'typescript-sdk': {
build: 'pnpm install && pnpm run build:all',
client: {
command: 'npx tsx test/conformance/src/everythingClient.ts'
},
server: {
command: 'npx tsx test/conformance/src/everythingServer.ts',
url: 'http://localhost:3000/mcp'
},
expectedFailures: 'test/conformance/expected-failures.yaml'
},
// v1.x — the published npm line. Same fixtures as v2; differs only in the
// build (npm, not pnpm) and the baseline filename. Clones the typescript-sdk
// repo, defaulting to the `v1.x` branch. Targets the latest dated spec, so
// draft-only scenarios and checks are excluded by default.
'typescript-sdk-v1': {
repo: 'typescript-sdk',
defaultRef: 'v1.x',
specVersion: '2025-11-25',
build: 'npm ci && npm run build',
client: {
command: 'npx tsx test/conformance/src/everythingClient.ts'
},
server: {
command: 'npx tsx test/conformance/src/everythingServer.ts',
url: 'http://localhost:3000/mcp'
},
expectedFailures: 'test/conformance/conformance-baseline.yml'
},
// Fixtures live under conformance/ (everything-client + everything-server,
// mirroring scripts/{client,server}-conformance.sh). The server's -stateless
// flag defaults to true; the dated-spec (`active` suite) scenarios need the
// stateful transport, so the base command pins -stateless=false and the
// 2026-07-28 override drops it for the SEP-2575 stateless lifecycle.
'go-sdk': {
build:
'go build -o ./.conformance-server ./conformance/everything-server && go build -o ./.conformance-client ./conformance/everything-client',
client: {
command: './.conformance-client'
},
server: {
command: './.conformance-server -http=localhost:3000 -stateless=false',
url: 'http://localhost:3000'
},
expectedFailures: 'conformance/baseline.yml',
specOverrides: {
'2026-07-28': {
server: { command: './.conformance-server -http=localhost:3000' }
}
}
},
// main — targets the 2026-07-28 revision. Same uv workspace layout as v1.x
// (client fixture in .github/actions/conformance/, mcp-everything-server
// workspace package). Two baselines exist upstream, one per spec target;
// the 2026-07-28 override picks the matching one.
'python-sdk': {
// Mirrors the SDK's own CI, which syncs the two conformance packages
// individually (--inexact so the second sync doesn't prune the first).
// --all-packages is unbuildable on main: an example package's declared
// README is missing, and uv builds every workspace member.
build:
'uv sync --frozen --all-extras --package mcp-everything-server && uv sync --frozen --all-extras --package mcp --inexact',
client: {
command: 'uv run --frozen python .github/actions/conformance/client.py'
},
server: {
command: 'uv run --frozen mcp-everything-server --port 3000',
url: 'http://localhost:3000/mcp'
},
expectedFailures: '.github/actions/conformance/expected-failures.yml',
specOverrides: {
'2026-07-28': {
expectedFailures:
'.github/actions/conformance/expected-failures.2026-07-28.yml'
}
}
},
// v1.x — the stable, published line of the python-sdk, analogous to
// typescript-sdk-v1. Clones the python-sdk repo, defaulting to the `v1.x`
// branch, and targets the latest
// dated spec so draft-only scenarios/checks are excluded by default. uv
// workspace: the `mcp` (client) and `mcp-everything-server` (server) packages
// are both members, so one `uv sync --all-packages` covers both modes.
// Fixtures live in the python-sdk repo (.github/actions/conformance/ and
// examples/servers/everything-server). `--port 3000` matches the url and the
// 3000 convention used above; the server's own default is 3001.
'python-sdk-v1': {
repo: 'python-sdk',
defaultRef: 'v1.x',
specVersion: '2025-11-25',
build: 'uv sync --frozen --all-extras --all-packages',
client: {
command: 'uv run --frozen python .github/actions/conformance/client.py'
},
server: {
command: 'uv run --frozen mcp-everything-server --port 3000',
url: 'http://localhost:3000/mcp'
},
expectedFailures: '.github/actions/conformance/expected-failures.yml'
},
// Fixtures live in conformance/ (the mcp-conformance package's
// conformance-client + conformance-server bins; the package is excluded from
// the workspace default-members, so build it explicitly). The server reads
// PORT and STATELESS from the environment: the stateful (dated-spec)
// lifecycle is the default, and the 2026-07-28 override sets STATELESS=1
// for the SEP-2575 stateless lifecycle.
// One default server serves every revision — rust-sdk's own CI starts a
// single un-flagged conformance-server and runs both the 2025-11-25 and
// 2026-07-28 legs against it. (A STATELESS=1 override here used to force the
// 2026 leg onto a mode the SDK's CI never exercises, failing its SEP-2575
// input-required scenarios.)
'rust-sdk': {
build: 'cargo build -p mcp-conformance',
client: {
command: './target/debug/conformance-client'
},
server: {
command: 'PORT=3000 ./target/debug/conformance-server',
url: 'http://localhost:3000/mcp'
}
},
// Fixtures live in tests/ModelContextProtocol.ConformanceClient and
// tests/ModelContextProtocol.ConformanceServer (requires the .NET 10 SDK,
// per global.json); build output goes to the repo-level artifacts/ tree
// (UseArtifactsOutput), not per-project bin/. The client binary takes the scenario as its first
// argument rather than reading MCP_CONFORMANCE_SCENARIO, so the command
// bridges the env var into argv ($1 is the server URL the harness appends).
// The server serves the stateful lifecycle at / and the SEP-2575 stateless
// lifecycle at /stateless from the same port; the 2026-07-28 override
// points runs at the stateless endpoint.
'csharp-sdk': {
build:
'dotnet build tests/ModelContextProtocol.ConformanceClient -c Release -f net10.0 && dotnet build tests/ModelContextProtocol.ConformanceServer -c Release -f net10.0',
client: {
command: `bash -c 'exec dotnet artifacts/bin/ModelContextProtocol.ConformanceClient/Release/net10.0/ModelContextProtocol.ConformanceClient.dll "$MCP_CONFORMANCE_SCENARIO" "$1"' conformance-client`
},
server: {
// Launch from the build-output directory: ASP.NET resolves
// appsettings.json from the content root (the cwd), and that file
// carries the AllowedHosts filter dns-rebinding-protection tests.
// Launched from the repo root it silently never loads.
command:
"bash -c 'cd artifacts/bin/ModelContextProtocol.ConformanceServer/Release/net10.0 && exec dotnet ModelContextProtocol.ConformanceServer.dll --urls http://localhost:3000'",
url: 'http://localhost:3000'
},
specOverrides: {
'2026-07-28': {
server: { url: 'http://localhost:3000/stateless' }
}
}
}
};
/**
* Look up a built-in config by SDK name. Accepts bare names (typescript-sdk),
* owner/repo (modelcontextprotocol/typescript-sdk), or a checkout path
* basename — only the final path segment is used as the key.
*/
export function lookupBuiltinConfig(name: string): SdkConfig | null {
const key = name.split('/').pop() ?? name;
return KNOWN_SDKS[key] ?? null;
}
export function knownSdkNames(): string[] {
return Object.keys(KNOWN_SDKS);
}