fix: langchain-mcp-adapters version conflict (#500)

* fix: langchain-mcp-adapters version conflict

* fix the lint error
This commit is contained in:
Willem Jiang
2025-08-04 10:36:31 +08:00
committed by GitHub
parent ba7509d9ae
commit 4218cddab5
2 changed files with 13 additions and 12 deletions

View File

@@ -458,9 +458,10 @@ 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:
client = MultiServerMCPClient(mcp_servers)
loaded_tools = default_tools[:]
for tool in client.get_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}"

View File

@@ -1110,7 +1110,7 @@ def patch_multiserver_mcp_client():
async def __aexit__(self, exc_type, exc, tb):
pass
def get_tools(self):
async def get_tools(self):
return [
FakeTool("toolA", "descA"),
FakeTool("toolB", "descB"),
@@ -1244,7 +1244,7 @@ async def test_setup_and_execute_agent_step_with_mcp_tools_description_update(
async def __aexit__(self, exc_type, exc, tb):
pass
def get_tools(self):
async def get_tools(self):
return [FakeTool("toolA", "descA")]
with patch("src.graph.nodes.MultiServerMCPClient", return_value=FakeClient()):