Skip to content

Conversation

matiasanaya
Copy link
Contributor

Not sure if this is the right approach. It is the simplest I could come up with right now. Though what I would probably prefer is something like a middleware, since context is only available for tools but _meta is everywhere. Thoughts?

@punkpeye
Copy link
Owner

What were you trying to achieve?

Asking because I just exposed sessionId

@matiasanaya
Copy link
Contributor Author

What were you trying to achieve?

I'm trying to read _meta fields from within a tool execution. This I need because I want to build an x402 enabled MCP server, and per the spec the x402 data is sent in the _meta fields.

@matiasanaya matiasanaya force-pushed the m/metadata-in-ctx branch 4 times, most recently from 1fd3940 to 4b7979f Compare October 16, 2025 17:27
@matiasanaya
Copy link
Contributor Author

@punkpeye I've also added a re-throw mechanism for McpError since that's also required by the x402 spec.

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