Commit 3226676
Refactor MCP server config types across all SDK languages (#1051)
* Refactor MCP server config types across all SDK languages
Introduce an abstract McpServerConfig base class in C# with a private
protected constructor and sealed derived types McpStdioServerConfig and
McpHttpServerConfig. Shared properties (Tools, Type, Timeout) are
deduplicated into the base class. The Type property uses the
JsonPolymorphic discriminator pattern consistent with SessionEvent.
All Dictionary<string, object> McpServers properties are now strongly
typed as Dictionary<string, McpServerConfig>.
Rename Local/Remote to Stdio/Http across all four SDK languages to
match MCP protocol terminology:
- C#: McpStdioServerConfig / McpHttpServerConfig
- TypeScript: MCPStdioServerConfig / MCPHttpServerConfig
- Go: MCPStdioServerConfig / MCPHTTPServerConfig
- Python: MCPStdioServerConfig / MCPHttpServerConfig
Update documentation examples accordingly.
Fixes #245
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use idiomatic HTTP casing in Python and TypeScript type names
Rename MCPHttpServerConfig to MCPHTTPServerConfig in Python (matching
stdlib convention: HTTPServer, HTTPError) and TypeScript (matching
the all-caps treatment of MCP already in use).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update mcp-servers C# scenario to use strongly-typed McpServerConfig API
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Make Go MCPServerConfig type-safe with interface + marker method
Change MCPServerConfig from map[string]any to an interface with a
private marker method, matching the type-safety approach used for C#.
MCPStdioServerConfig and MCPHTTPServerConfig implement the interface
and use MarshalJSON to auto-inject the type discriminator.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix consistency gaps: update JSDoc and drop stale type field in Python tests
- Update MCPServerConfigBase JSDoc to reference stdio/http instead of
local/remote
- Remove explicit type: local from Python E2E tests (omitted type
defaults to stdio, matching Go/C# pattern)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent d2130ff commit 3226676
File tree
15 files changed
+166
-163
lines changed- docs
- features
- troubleshooting
- dotnet
- src
- test
- go
- internal/e2e
- nodejs
- src
- test/e2e
- python
- copilot
- e2e
- test/scenarios/tools/mcp-servers
- csharp
- go
15 files changed
+166
-163
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
| |||
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
146 | | - | |
| 144 | + | |
147 | 145 | | |
148 | | - | |
| 146 | + | |
149 | 147 | | |
150 | | - | |
151 | 148 | | |
152 | 149 | | |
153 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | | - | |
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
263 | | - | |
| 262 | + | |
264 | 263 | | |
265 | | - | |
266 | 264 | | |
267 | 265 | | |
268 | 266 | | |
| |||
275 | 273 | | |
276 | 274 | | |
277 | 275 | | |
278 | | - | |
| 276 | + | |
279 | 277 | | |
280 | | - | |
281 | 278 | | |
282 | 279 | | |
283 | 280 | | |
284 | 281 | | |
285 | 282 | | |
286 | 283 | | |
287 | 284 | | |
288 | | - | |
| 285 | + | |
289 | 286 | | |
290 | | - | |
291 | 287 | | |
292 | 288 | | |
293 | 289 | | |
| |||
305 | 301 | | |
306 | 302 | | |
307 | 303 | | |
308 | | - | |
| 304 | + | |
309 | 305 | | |
310 | | - | |
| 306 | + | |
311 | 307 | | |
312 | | - | |
313 | 308 | | |
314 | 309 | | |
315 | 310 | | |
| |||
321 | 316 | | |
322 | 317 | | |
323 | 318 | | |
324 | | - | |
| 319 | + | |
325 | 320 | | |
326 | | - | |
327 | 321 | | |
328 | 322 | | |
329 | 323 | | |
| |||
357 | 351 | | |
358 | 352 | | |
359 | 353 | | |
360 | | - | |
| 354 | + | |
361 | 355 | | |
362 | | - | |
| 356 | + | |
363 | 357 | | |
364 | 358 | | |
365 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1631 | 1631 | | |
1632 | 1632 | | |
1633 | 1633 | | |
1634 | | - | |
| 1634 | + | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
| |||
1686 | 1686 | | |
1687 | 1687 | | |
1688 | 1688 | | |
1689 | | - | |
| 1689 | + | |
1690 | 1690 | | |
1691 | 1691 | | |
1692 | 1692 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1502 | 1502 | | |
1503 | 1503 | | |
1504 | 1504 | | |
1505 | | - | |
| 1505 | + | |
1506 | 1506 | | |
1507 | | - | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
1508 | 1513 | | |
| 1514 | + | |
| 1515 | + | |
1509 | 1516 | | |
1510 | 1517 | | |
1511 | 1518 | | |
1512 | 1519 | | |
1513 | 1520 | | |
1514 | 1521 | | |
1515 | 1522 | | |
1516 | | - | |
| 1523 | + | |
1517 | 1524 | | |
1518 | | - | |
1519 | | - | |
| 1525 | + | |
| 1526 | + | |
1520 | 1527 | | |
1521 | 1528 | | |
1522 | 1529 | | |
1523 | 1530 | | |
1524 | 1531 | | |
1525 | 1532 | | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1526 | 1543 | | |
1527 | 1544 | | |
1528 | 1545 | | |
| |||
1552 | 1569 | | |
1553 | 1570 | | |
1554 | 1571 | | |
1555 | | - | |
| 1572 | + | |
1556 | 1573 | | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
1574 | 1577 | | |
1575 | 1578 | | |
1576 | 1579 | | |
| |||
1628 | 1631 | | |
1629 | 1632 | | |
1630 | 1633 | | |
1631 | | - | |
| 1634 | + | |
1632 | 1635 | | |
1633 | 1636 | | |
1634 | 1637 | | |
| |||
1697 | 1700 | | |
1698 | 1701 | | |
1699 | 1702 | | |
1700 | | - | |
| 1703 | + | |
1701 | 1704 | | |
1702 | 1705 | | |
1703 | 1706 | | |
| |||
1829 | 1832 | | |
1830 | 1833 | | |
1831 | 1834 | | |
1832 | | - | |
| 1835 | + | |
1833 | 1836 | | |
1834 | | - | |
| 1837 | + | |
1835 | 1838 | | |
1836 | 1839 | | |
1837 | 1840 | | |
| |||
1925 | 1928 | | |
1926 | 1929 | | |
1927 | 1930 | | |
1928 | | - | |
| 1931 | + | |
1929 | 1932 | | |
1930 | 1933 | | |
1931 | 1934 | | |
| |||
2061 | 2064 | | |
2062 | 2065 | | |
2063 | 2066 | | |
2064 | | - | |
| 2067 | + | |
2065 | 2068 | | |
2066 | | - | |
| 2069 | + | |
2067 | 2070 | | |
2068 | 2071 | | |
2069 | 2072 | | |
| |||
2608 | 2611 | | |
2609 | 2612 | | |
2610 | 2613 | | |
2611 | | - | |
2612 | | - | |
| 2614 | + | |
2613 | 2615 | | |
2614 | 2616 | | |
2615 | 2617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
0 commit comments