Title: Inconsistency in `types.py` schema for `RequestParams` · Issue #913 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Inconsistency in `types.py` schema for `RequestParams` · Issue #913 · modelcontextprotocol/python-sdk
X Title: Inconsistency in `types.py` schema for `RequestParams` · Issue #913 · modelcontextprotocol/python-sdk
Description: Describe the bug Not sure if I'm missing something, but I found that I was unable to add extra fields to RequestParams in the MCP Python schema in types.py (e.g., I'm trying to pass auth tokens along for ListToolsRequest). The Python MCP...
Open Graph Description: Describe the bug Not sure if I'm missing something, but I found that I was unable to add extra fields to RequestParams in the MCP Python schema in types.py (e.g., I'm trying to pass auth tokens alo...
X Description: Describe the bug Not sure if I'm missing something, but I found that I was unable to add extra fields to RequestParams in the MCP Python schema in types.py (e.g., I'm trying to pass auth to...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/913
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistency in `types.py` schema for `RequestParams`","articleBody":"**Describe the bug**\n\nNot sure if I'm missing something, but I found that I was unable to add extra fields to `RequestParams` in the MCP Python schema in `types.py` (e.g., I'm trying to pass auth tokens along for `ListToolsRequest`). The Python MCP schema ignores extra fields at the top level of `RequestParams`, but the TypeScript MCP schema does not. \n\n**To Reproduce**\n\nTry to create a `RequestParams` instance with an extra field at the top level (not inside `meta`), e.g.:\n\n```python\nRequestParams(foo=\"bar\", meta=None)\n```\n\nThe additional field `foo` is ignored.\n\n**Expected behavior**\n\nExtra fields at the top level of `RequestParams` should be accepted, matching the TypeScript schema’s behavior.\n\n**Additional context**\n\n- The TypeScript interface allows arbitrary extra fields at the top level of params via:\n\n```ts\nexport interface Request {\n method: string;\n params?: {\n _meta?: {\n progressToken?: ProgressToken;\n };\n [key: string]: unknown;\n };\n}\n```\n\n- The Python class only allows extra fields inside the `Meta` class:\n\n```python\nclass RequestParams(BaseModel):\n class Meta(BaseModel):\n progressToken: ProgressToken | None = None\n model_config = ConfigDict(extra=\"allow\")\n meta: Meta | None = Field(alias=\"_meta\", default=None)\n```\n","author":{"url":"https://github.com/lucasng32","@type":"Person","name":"lucasng32"},"datePublished":"2025-06-09T23:03:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/913/python-sdk/issues/913"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:06604cff-2253-e976-1ce1-f26038465ef8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 839E:111BB1:15EA62C:1F31FA3:6A5A1C65 |
| html-safe-nonce | 185f5201e6006e97963488d3523ba59677701f8647469d9b53f6293939327e71 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzlFOjExMUJCMToxNUVBNjJDOjFGMzFGQTM6NkE1QTFDNjUiLCJ2aXNpdG9yX2lkIjoiMTY1MDkzNzg2Nzg5ODg1NDUwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 90f7c24d72dc8e3420a9e1f89f4cedf4a3a525fd2b91b50ce41f9899aa7cc3ae |
| hovercard-subject-tag | issue:3131695012 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/913/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6d04e983165beab7e8d6a109f729d967cc46f1b8dd2e8e4f8187de51361c1864/modelcontextprotocol/python-sdk/issues/913 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6d04e983165beab7e8d6a109f729d967cc46f1b8dd2e8e4f8187de51361c1864/modelcontextprotocol/python-sdk/issues/913 |
| og:image:alt | Describe the bug Not sure if I'm missing something, but I found that I was unable to add extra fields to RequestParams in the MCP Python schema in types.py (e.g., I'm trying to pass auth tokens alo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lucasng32 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e31742e80bbd077fd5679c13ed870ce4e0c13803a2fa5beaae557b6769de2c8a |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c9fcdbf98c619d1561ed843fa01d9766a32b5cd9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width