mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 20:14:44 +08:00
fix: langchain-mcp-adapters version conflict (#500)
* fix: langchain-mcp-adapters version conflict * fix the lint error
This commit is contained in:
@@ -458,16 +458,17 @@ async def _setup_and_execute_agent_step(
|
||||
|
||||
# Create and execute agent with MCP tools if available
|
||||
if mcp_servers:
|
||||
async with MultiServerMCPClient(mcp_servers) as client:
|
||||
loaded_tools = default_tools[:]
|
||||
for tool in client.get_tools():
|
||||
if tool.name in enabled_tools:
|
||||
tool.description = (
|
||||
f"Powered by '{enabled_tools[tool.name]}'.\n{tool.description}"
|
||||
)
|
||||
loaded_tools.append(tool)
|
||||
agent = create_agent(agent_type, agent_type, loaded_tools, agent_type)
|
||||
return await _execute_agent_step(state, agent, agent_type)
|
||||
client = MultiServerMCPClient(mcp_servers)
|
||||
loaded_tools = default_tools[:]
|
||||
all_tools = await client.get_tools()
|
||||
for tool in all_tools:
|
||||
if tool.name in enabled_tools:
|
||||
tool.description = (
|
||||
f"Powered by '{enabled_tools[tool.name]}'.\n{tool.description}"
|
||||
)
|
||||
loaded_tools.append(tool)
|
||||
agent = create_agent(agent_type, agent_type, loaded_tools, agent_type)
|
||||
return await _execute_agent_step(state, agent, agent_type)
|
||||
else:
|
||||
# Use default tools if no MCP servers are configured
|
||||
agent = create_agent(agent_type, agent_type, default_tools, agent_type)
|
||||
|
||||
Reference in New Issue
Block a user