Skip to content

Fix Bug: request_meta is not available in server.request_context #103#108

Merged
dsp-ant merged 2 commits into
v1.1.xfrom
davidsp/fix-103
Dec 21, 2024
Merged

Fix Bug: request_meta is not available in server.request_context #103#108
dsp-ant merged 2 commits into
v1.1.xfrom
davidsp/fix-103

Conversation

@dsp-ant

@dsp-ant dsp-ant commented Dec 21, 2024

Copy link
Copy Markdown
Member

Summary

Test plan

  • Run pytest tests/server/test_request_context.py

@dsp-ant dsp-ant changed the title Add request context tests Fix #103 Dec 21, 2024
@dsp-ant dsp-ant changed the title Fix #103 Fix Bug: request_meta is not available in server.request_context #103 Dec 21, 2024
@dsp-ant dsp-ant changed the base branch from main to v1.1.x December 21, 2024 00:38

@phact phact left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aside from typo LGTM +1

Comment thread src/mcp/server/__init__.py Outdated
Pydantic treats fields starting with underscore as private/hidden. To fix this,
we need to use Field with alias='_meta' to properly handle these fields while
keeping the external API unchanged. This fixes #103 where meta fields were not
being properly assigned in request contexts.
@dsp-ant dsp-ant merged commit e691c51 into v1.1.x Dec 21, 2024
@dsp-ant dsp-ant deleted the davidsp/fix-103 branch December 21, 2024 23:17
@phact

phact commented Dec 23, 2024

Copy link
Copy Markdown

Hi folks, curious when this will hit a released version. Thanks!

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.

2 participants