We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi. I am having issues to start an mcp server with the class MCPServerStdio whenever I pass a dict[str, str] to the env parameter.
MCPServerStdio
env
I can confirm that I have npx installed and have used with success the MCPServerStdio without passing the env parameter.
npx
import asyncio from pydantic_ai import Agent from pydantic_ai.models.openai import OpenAIModel from pydantic_ai.providers.openai import OpenAIProvider from pydantic_ai.mcp import MCPServerStdio github_server = MCPServerStdio( command="npx", args=["@modelcontextprotocol/server-github"], env={"GITHUB_PERSONAL_ACCESS_TOKEN": "<github-pat-here>"}, ) ollama_model = OpenAIModel( model_name="llama3.2", provider=OpenAIProvider(base_url="http://localhost:11434/v1") ) agent = Agent(ollama_model, mcp_servers=[github_server]) async def main(): async with agent.run_mcp_servers(): result = await agent.run("list issues from repo XXX") print(result.data) if __name__ == "__main__": asyncio.run(main()) --- Error: File "/opt/homebrew/Cellar/[email protected]/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 1974, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'npx'
3.13, 0.0.43, openai v1.68.0 (azure openai and ollama)
The text was updated successfully, but these errors were encountered:
It was fixed on mcp's side: modelcontextprotocol/python-sdk#327
mcp
If you bump the mcp dependency to 1.5.0, it should work as expected (the release is in progress, should be available in some hours).
Sorry, something went wrong.
Thanks!
No branches or pull requests
Initial Checks
Description
Hi. I am having issues to start an mcp server with the class
MCPServerStdio
whenever I pass a dict[str, str] to theenv
parameter.I can confirm that I have
npx
installed and have used with success the MCPServerStdio without passing the env parameter.Example Code
Python, Pydantic AI & LLM client version
The text was updated successfully, but these errors were encountered: