Closed
Description
Please read this first
- Have you read the docs?Agents SDK docs
- Have you searched for related issues? Others may have had similar requests
Question
Using the following code, why does it throw an error? Is there a convenient way to integrate MCP with agent orchestration?
SERVER_FILE_SYSTEM = MCPServerStdio(
name="Filesystem Server, via npx",
params={
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", WORK_SPACE],
},
)
SEARCHER_AGENT = Agent(
name="Searcher",
instructions="Search for related files and content",
handoff_description="""Responsible for finding relevant files and code content based on given information""",
model=ModelConfig.cr_ultra_model,
mcp_servers=[
SERVER_FILE_SYSTEM
]
)
if __name__ == "__main__":
from agents import Runner
async def main():
with trace("File search example"):
result = await Runner.run(starting_agent=SEARCHER_AGENT, input="List directory structure")
print(result)
asyncio.run(main())