Skip to content

Conversation

streamnsight
Copy link

@streamnsight streamnsight commented Aug 14, 2025

usage:
On the MCP server side, specify the key to map to the state with annotations:

@mcp.tool(annotations={"injected_state": "state"}) 
def tool(a: int = 0, b: Union[str, None] = None, state):
   pass

On the client side, it is handled automatically by the added code.

Caveat:

  • trying to parse most types (base type, List, Unions, Literal, Optional) and default values, but probably not complete.
  • no implementation for the converter from langchain tool to mcp tool at the moment

usage:
On the MCP server side, specify the key to map to the state with annotations:
@mcp.tool(annotations={"injected_state": "state"})
def tool(a, b, state):
   pass

On the client side, it is handled automatically
@streamnsight streamnsight marked this pull request as ready for review August 15, 2025 21:11
@streamnsight
Copy link
Author

@eyurtsev for review.
Thanks

@streamnsight
Copy link
Author

@eyurtsev
Any chance you can give this one a look?
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.

1 participant