Skip to content

Commit 0cf57f4

Browse files
committed
docs: move lowlevel server sections to Breaking Changes in migration guide
1 parent 2a8a295 commit 0cf57f4

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

docs/migration.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -378,34 +378,6 @@ await client.read_resource("test://resource")
378378
await client.read_resource(str(my_any_url))
379379
```
380380

381-
## Deprecations
382-
383-
<!-- Add deprecations below -->
384-
385-
## Bug Fixes
386-
387-
### Extra fields no longer allowed on top-level MCP types
388-
389-
MCP protocol types no longer accept arbitrary extra fields at the top level. This matches the MCP specification which only allows extra fields within `_meta` objects, not on the types themselves.
390-
391-
```python
392-
# This will now raise a validation error
393-
from mcp.types import CallToolRequestParams
394-
395-
params = CallToolRequestParams(
396-
name="my_tool",
397-
arguments={},
398-
unknown_field="value", # ValidationError: extra fields not permitted
399-
)
400-
401-
# Extra fields are still allowed in _meta
402-
params = CallToolRequestParams(
403-
name="my_tool",
404-
arguments={},
405-
_meta={"progressToken": "tok", "customField": "value"}, # OK
406-
)
407-
```
408-
409381
### Lowlevel `Server`: decorator-based handlers replaced with `RequestHandler`/`NotificationHandler`
410382

411383
The lowlevel `Server` class no longer uses decorator methods for handler registration. Instead, handlers are `RequestHandler` and `NotificationHandler` objects passed to the constructor.
@@ -568,6 +540,34 @@ server = Server(
568540
server.experimental.enable_tasks(task_store)
569541
```
570542

543+
## Deprecations
544+
545+
<!-- Add deprecations below -->
546+
547+
## Bug Fixes
548+
549+
### Extra fields no longer allowed on top-level MCP types
550+
551+
MCP protocol types no longer accept arbitrary extra fields at the top level. This matches the MCP specification which only allows extra fields within `_meta` objects, not on the types themselves.
552+
553+
```python
554+
# This will now raise a validation error
555+
from mcp.types import CallToolRequestParams
556+
557+
params = CallToolRequestParams(
558+
name="my_tool",
559+
arguments={},
560+
unknown_field="value", # ValidationError: extra fields not permitted
561+
)
562+
563+
# Extra fields are still allowed in _meta
564+
params = CallToolRequestParams(
565+
name="my_tool",
566+
arguments={},
567+
_meta={"progressToken": "tok", "customField": "value"}, # OK
568+
)
569+
```
570+
571571
## New Features
572572

573573
### `streamable_http_app()` available on lowlevel Server

0 commit comments

Comments
 (0)