updated mcp-agent.ipynb #141
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
*Issue #, if available:
When executing the code below in Kiro and Visual Studio code on WIndows OS
Create an agent with MCP tools
with stdio_mcp_client:
# Get the tools from the MCP server
tools = stdio_mcp_client.list_tools_sync()
Get the following error:
NotImplementedError Traceback (most recent call last)
File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\mcp\os\win32\utilities.py:169, in create_windows_process(command, args, env, errlog, cwd)
167 try:
168 # First try using anyio with Windows-specific flags to hide console window
--> 169 process = await anyio.open_process(
170 [command, *args],
171 env=env,
172 # Ensure we don't create console windows for each process
173 creationflags=subprocess.CREATE_NO_WINDOW # type: ignore
174 if hasattr(subprocess, "CREATE_NO_WINDOW")
175 else 0,
176 stderr=errlog,
177 cwd=cwd,
178 )
179 except NotImplementedError:
180 # If Windows doesn't support async subprocess creation, use fallback
File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\anyio_core_subprocesses.py:190, in open_process(command, stdin, stdout, stderr, cwd, env, startupinfo, creationflags, start_new_session, pass_fds, user, group, extra_groups, umask)
188 kwargs["umask"] = umask
--> 190 return await get_async_backend().open_process(
191 command,
192 stdin=stdin,
193 stdout=stdout,
194 stderr=stderr,
...
117 logger.exception("client failed to initialize")
--> 118 raise MCPClientInitializationError("the client initialization failed") from e
119 return self
MCPClientInitializationError: the client initialization failed
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.