You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using AutoGen with McpWorkbench to connect and call a weather query MCP server on Windows 11, the business logic (e.g., listing tools and agent tool calls) executes correctly. However, after the business logic completes, an exception is raised related to unclosed transports and I/O operations on closed pipes. This issue does not occur on CentOS 7.9 with the same setup.
To Reproduce
Steps to reproduce the behavior:
Set up a weather query MCP server using FastMCP on Windows 11.
Use AutoGen's McpWorkbench to connect and call the server.
Execute business logic that involves agent tool calls.
Observe the exception after the business logic completes.
Code Example:
weather_mcp_server=StdioServerParams(
**MCP_PARAM_JSON,
)
model_client=OpenAIChatCompletionClient(model="gpt-4o-mini")
asyncwithMcpWorkbench(server_params=weather_mcp_server) asmcp:
agent=AssistantAgent(
name="WeatherAgent",
model_client=model_client,
workbench=mcp,
)
team=RoundRobinGroupChat(
participants=[agent],
termination_condition=TextMessageTermination(source='WeatherAgent'),
)
awaitConsole(
team.run_stream(task="How is the weather like in Beijing?"),
output_stats=True,
)
Expected behavior
The program should complete without raising exceptions related to unclosed transports or I/O operations on closed pipes, as observed on CentOS 7.9.
Screenshots
Additional context
Operating System: Windows 11 (issue present), CentOS 7.9 (no issue)
MCP Server Setup: Using FastMCP for a weather query service.
This issue appears to be specific to the Windows environment, possibly due to differences in how subprocesses or asynchronous I/O are handled in Python on Windows compared to Linux.
Which packages was the bug in?
Python Extensions (autogen-ext)
AutoGen library version.
Python 0.5.6
Python version
3.12
Operating system
Windows11 and CentOS7.9
The text was updated successfully, but these errors were encountered:
KamikazEr101
changed the title
MCP Workbench Error on Windows 11 but not on CentOS 7
Error related to asyncio when using mcp with autgen on Windows 11 but not on CentOS 7
May 6, 2025
KamikazEr101
changed the title
Error related to asyncio when using mcp with autgen on Windows 11 but not on CentOS 7
Error related to asyncio when using mcp with autogen on Windows 11 but not on CentOS 7
May 6, 2025
The initial diagnosis indicates that this error is caused by the resource cleanup when the program exits. The problem might lie in the specific implementation of McpWorkbench.
Now that #6497 is merged, could you try and repro again from main @KamikazEr101 ?
Thanks for the update! I tested the bug with the latest main branch after #6497 was merged, but the issue still persists. Besides, I noticed that when running the code in debug mode on Windows 11, the bug does not occur, regardless of whether I use the latest main branch or the previous version. However, in normal mode (non-debug), the bug consistently appears on Windows 11.
What happened?
Describe the bug
When using AutoGen with McpWorkbench to connect and call a weather query MCP server on Windows 11, the business logic (e.g., listing tools and agent tool calls) executes correctly. However, after the business logic completes, an exception is raised related to unclosed transports and I/O operations on closed pipes. This issue does not occur on CentOS 7.9 with the same setup.
To Reproduce
Steps to reproduce the behavior:
Code Example:
Exception Traceback:
Expected behavior
The program should complete without raising exceptions related to unclosed transports or I/O operations on closed pipes, as observed on CentOS 7.9.
Screenshots
Additional context
server.py
utils.py
This issue appears to be specific to the Windows environment, possibly due to differences in how subprocesses or asynchronous I/O are handled in Python on Windows compared to Linux.
Which packages was the bug in?
Python Extensions (autogen-ext)
AutoGen library version.
Python 0.5.6
Python version
3.12
Operating system
Windows11 and CentOS7.9
The text was updated successfully, but these errors were encountered: