Skip to content

Conversation

phact
Copy link

@phact phact commented Dec 17, 2024

Fixes #103

Fix the issue where server.request_context.meta does not include the progressToken.

  • Extract _meta field: Extract the _meta field from request parameters and assign it to message.request_meta in src/mcp/server/__init__.py.
  • Update RequestContext: Update RequestContext instantiation to include progressToken in src/mcp/server/__init__.py.
  • Allow extra fields: Update RequestParams instantiation to include model_config = ConfigDict(extra="allow") in src/mcp/types.py.

For more details, open the Copilot Workspace session.

Fixes modelcontextprotocol#103

Fix the issue where `server.request_context.meta` does not include the `progressToken`.

* **Extract `_meta` field**: Extract the `_meta` field from request parameters and assign it to `message.request_meta` in `src/mcp/server/__init__.py`.
* **Update `RequestContext`**: Update `RequestContext` instantiation to include `progressToken` in `src/mcp/server/__init__.py`.
* **Allow extra fields**: Update `RequestParams` instantiation to include `model_config = ConfigDict(extra="allow")` in `src/mcp/types.py`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/modelcontextprotocol/python-sdk/issues/103?shareId=XXXX-XXXX-XXXX-XXXX).
@phact
Copy link
Author

phact commented Dec 18, 2024

@dsp-ant here's a quick take on this issue (works in my test setup)

@dsp-ant dsp-ant changed the base branch from main to v1.1.x December 20, 2024 15:59
@dsp-ant dsp-ant changed the base branch from v1.1.x to main December 20, 2024 16:00
@dsp-ant
Copy link
Member

dsp-ant commented Dec 21, 2024

Thank you for this. This helped me figuring out a fix. I think my fix in #108 is more general and we should probably go down that route. I'll close out this PR. Thank you so much for the bug report and the attempted fix!

@dsp-ant dsp-ant closed this Dec 21, 2024
gspencergoog pushed a commit to gspencergoog/mcp-python-sdk that referenced this pull request Jul 29, 2025
…/mahesh/redirect-to-specification

Redirect / to /specification
gspencergoog pushed a commit to gspencergoog/mcp-python-sdk that referenced this pull request Jul 29, 2025
…/update-server-docs

docs: add server initialization instructions to quickstart guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: request_meta is not available in server.request_context
2 participants