Skip to content

Commit 4255a99

Browse files
committed
docs: move lowlevel server sections to Breaking Changes in migration guide
1 parent cafb3e5 commit 4255a99

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
@@ -426,34 +426,6 @@ await client.read_resource("test://resource")
426426
await client.read_resource(str(my_any_url))
427427
```
428428

429-
## Deprecations
430-
431-
<!-- Add deprecations below -->
432-
433-
## Bug Fixes
434-
435-
### Extra fields no longer allowed on top-level MCP types
436-
437-
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.
438-
439-
```python
440-
# This will now raise a validation error
441-
from mcp.types import CallToolRequestParams
442-
443-
params = CallToolRequestParams(
444-
name="my_tool",
445-
arguments={},
446-
unknown_field="value", # ValidationError: extra fields not permitted
447-
)
448-
449-
# Extra fields are still allowed in _meta
450-
params = CallToolRequestParams(
451-
name="my_tool",
452-
arguments={},
453-
_meta={"progressToken": "tok", "customField": "value"}, # OK
454-
)
455-
```
456-
457429
### Lowlevel `Server`: decorator-based handlers replaced with `RequestHandler`/`NotificationHandler`
458430

459431
The lowlevel `Server` class no longer uses decorator methods for handler registration. Instead, handlers are `RequestHandler` and `NotificationHandler` objects passed to the constructor.
@@ -616,6 +588,34 @@ server = Server(
616588
server.experimental.enable_tasks(task_store)
617589
```
618590

591+
## Deprecations
592+
593+
<!-- Add deprecations below -->
594+
595+
## Bug Fixes
596+
597+
### Extra fields no longer allowed on top-level MCP types
598+
599+
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.
600+
601+
```python
602+
# This will now raise a validation error
603+
from mcp.types import CallToolRequestParams
604+
605+
params = CallToolRequestParams(
606+
name="my_tool",
607+
arguments={},
608+
unknown_field="value", # ValidationError: extra fields not permitted
609+
)
610+
611+
# Extra fields are still allowed in _meta
612+
params = CallToolRequestParams(
613+
name="my_tool",
614+
arguments={},
615+
_meta={"progressToken": "tok", "customField": "value"}, # OK
616+
)
617+
```
618+
619619
## New Features
620620

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

0 commit comments

Comments
 (0)