Description
Please read this first
- Have you read the docs? Agents SDK docs
Yes - Have you searched for related issues? Others may have had similar requests
Yes
Describe the feature
I am currently have a MCPServer created with model context protocol library and it running locally. In the same express app I want to create a new endpoint to work with multi-agents architecture but currently, we don't support that. Since the MCP tools from what I read only work with stdio MCPServer?
const mcpServer = new MCPServerStdio({
name: 'Filesystem Server, via npx',
fullCommand: `npx -y @modelcontextprotocol/server-filesystem ${samplesDir}`,
// Or passing command and args
// command: 'npx',
// args: ['-y', '@modelcontextprotocol/server-filesystem', samplesDir],
});
And you kind of have to do it like above which doesn't make sense.
We should just be able to pass in server name and the local url or url to work with and the library should automatically discover the list of mcp tools to use.
Or we do it similar to what Vercel AI Sdk does and pass it to the model creation call.
const mcpClient = await experimental_createMCPClient({
transport: mcpTransportInstance,
onUncaughtError,
});
const tools = await mcpClient.tools();
What is the feature you're requesting? How would it work? Please provide examples and details if possible.