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
{{ message }}
Repository navigation
NotImplementedError in asyncio subprocess_exec when using MCP client on Windows with Python 3.12 #369
Describe the bug
When using MCP client with Python 3.12 on Windows, it fails to connect to the server with a NotImplementedError. This is happening because asyncio subprocess functionality is not properly implemented in Python 3.12 on Windows.
To Reproduce
Steps to reproduce the behavior:
Install Python 3.12 on Windows
Install MCP and required packages
Create a simple MCP server script and MCP client
Try to connect to the server using the client
See error: NotImplementedError is raised in asyncio's _make_subprocess_transport method
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Desktop
OS: [Windows 10]
Browser [chrome]
Package versions: anyio, mcp, asyncio standard library
Activity
jayanthma commentedon Mar 27, 2025
Hi @isakulaksiz , the issue was persisting in the jupyter notebook so I converted it to .py and it ran successfully. Find the code below.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_aws import ChatBedrockConverse
import boto3
bedrock_client=boto3.client(service_name='bedrock-runtime', region_name="us-east-1")
model = ChatBedrockConverse(
client=bedrock_client,
model="us.meta.llama3-3-70b-instruct-v1:0",
temperature=0,
)
async def test_mcp_client():
async with MultiServerMCPClient(
{
"math": {
"command": "C:/Users/jay/coding_projects/LangGraph/venv/Scripts/python.exe",
Make sure to update to the full absolute path to your math_server.py file
"args": ["C:/Users/jay/coding_projects/LangGraph/mcp/math_server.py"],
"transport": "stdio",
},
"weather": {
make sure you start your weather server on port 8000
"url": "http://localhost:8000/sse",
"transport": "sse",
}
}
) as client:
tools = client.get_tools()
print("Tools: ", tools)
agent = create_react_agent(model, client.get_tools(), debug=True)
math_response = await agent.ainvoke({"messages": "what's 3*175"})
weather_response = await agent.ainvoke({"messages": "what is the weather in nyc?"})
return math_response, weather_response
if name == "main":
import asyncio
math_response, weather_response = asyncio.run(test_mcp_client())
print(math_response)
print(weather_response)
Hope it helps!!