-
Notifications
You must be signed in to change notification settings - Fork 285
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
When using langchain-mcp-adapters
with LangGraph's create_react_agent
, MCP tools cannot access RunnableConfig
parameters that are automatically passed to local LangChain tools.
Current Behavior
Local LangChain Tools (Working):
@tool
def get_user_info(config: RunnableConfig) -> Dict[str, Any]:
token = config.get("metadata").get("token") # β
Works
return {"user_id": "current_user"}
MCP Tools (Not Working):
@mcp.tool()
def event_query(bot_name=None, status: int=None):
# β Cannot access config.get("metadata").get("token")
return {"event_query": {...}}
Impact
- Authentication blocked: MCP tools cannot access user tokens
- Multi-tenant impossible: No way to pass user context
- Production limitation: Forces developers to avoid MCP for authenticated scenarios
Root Cause
LangGraph's create_react_agent
manages tool invocation internally, and langchain-mcp-adapters
doesn't preserve the ability to pass RunnableConfig
to MCP tools.
Environment
- langchain-mcp-adapters: 0.1.7
- langgraph: 0.2.20
- mcp: 1.9.4
Request
Add support for passing RunnableConfig
parameters to MCP tools, similar to how local LangChain tools receive them.
Priority: High (blocks production use cases requiring authentication)
94wogus-quantit, fernandocorreia-snorkel, vaedprasad and rustem-feyzkhanov-snorkel
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request