You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The version fallback to the installed mcp package dated to the SDK's
first initialization-options helper and reported the SDK's version as
the server's own. No spec text supports that: the schema requires the
field but says only 'the version of this implementation', and the
ecosystem expectation (spec discussion #1176) is the server's
distributed version. typescript and kotlin require an explicit
identity; go serializes an empty string for an unset version. Align
with go: version='' unless the constructor sets one, and delete the
_package_version helper.
The stamp is now fully deterministic for unversioned servers, so the
unit suites carry it literally in their expectations instead of
stripping it (tests._stamp stays for the dual-era interaction matrix,
whose era split is unrelated), and the matrix conftest's version pin
is gone. Small migration note added: this is a v1-visible behavior
change for servers that never set a version.
Copy file name to clipboardExpand all lines: docs/advanced/low-level-server.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ Call it and the result carries both representations:
107
107
}
108
108
```
109
109
110
-
The `_meta` block is the server's identity stamp: the SDK adds it to every 2026-era result, with the `version`taken from the constructor or the installed package. A server that must not identify itself can strip the key with a middleware, which owns the results it returns.
110
+
The `_meta` block is the server's identity stamp: the SDK adds it to every 2026-era result, with the `version` from the constructor (a server that sets none reports an empty string). A server that must not identify itself can strip the key with a middleware, which owns the results it returns.
111
111
112
112
The server never compares the two fields. This SDK's `Client` does: return `structured_content` that doesn't satisfy the `output_schema` you declared and `call_tool` raises a `RuntimeError` that starts with `Invalid structured content returned by tool search_books` and goes on to quote the `jsonschema` failure. Promising a schema is cheap; keeping it is on you. The whole ladder of return types and schemas is in **[Structured Output](../servers/structured-output.md)**.
Copy file name to clipboardExpand all lines: docs/migration.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -606,6 +606,14 @@ mcp = MCPServer("Demo", instructions="You answer questions about the weather.")
606
606
607
607
Keep `name` positional and pass everything else by keyword.
608
608
609
+
### Unversioned servers report an empty version
610
+
611
+
In v1, a server constructed without a `version` reported the installed `mcp`
612
+
package's version as its own in the `initialize` result's `serverInfo`. In v2
613
+
it reports an empty string instead: the SDK's version is not your server's
614
+
version. Pass `version="..."` to `Server(...)` or `MCPServer(...)` to identify
615
+
your server properly. The field is display-only; nothing breaks either way.
616
+
609
617
### `mount_path` parameter removed from MCPServer
610
618
611
619
The `mount_path` parameter has been removed from `MCPServer.__init__()`, `MCPServer.run()`, `MCPServer.run_sse_async()`, and `MCPServer.sse_app()`. It was also removed from the `Settings` class.
0 commit comments