Skip to content

Commit 6784912

Browse files
committed
add migration note
1 parent e448b42 commit 6784912

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/migration.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,30 @@ await client.read_resource(str(my_any_url))
321321

322322
<!-- Add deprecations below -->
323323

324+
## Bug Fixes
325+
326+
### Extra fields no longer allowed on top-level MCP types
327+
328+
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.
329+
330+
```python
331+
# This will now raise a validation error
332+
from mcp.types import CallToolRequestParams
333+
334+
params = CallToolRequestParams(
335+
name="my_tool",
336+
arguments={},
337+
unknown_field="value", # ValidationError: extra fields not permitted
338+
)
339+
340+
# Extra fields are still allowed in _meta
341+
params = CallToolRequestParams(
342+
name="my_tool",
343+
arguments={},
344+
_meta={"progressToken": "tok", "customField": "value"}, # OK
345+
)
346+
```
347+
324348
## New Features
325349

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

0 commit comments

Comments
 (0)