Closed
Description
TL;DR I spoke to @dsp on Friday, and the plan is to add support for MCP to PydanticAI via something I'm currently calling "toolsets".
One of the things I've realised while building PydanticAI is that building tools to give agents access to resources is going to be quite resource intensive and repetative — say you want to build an agent to interact with slack, 90% of your time will be spend figuring out the slack API and dealing with auth and reties, not building the agent.
I therefore propose the following process to make this kind of thing easy with PydanticAI:
- Add the concept of reusable "Toolsets" which contain multiple tools, their own state (e.g. http connection) and their own relation to agent dependencies
- Add a Toolset to support OpenAPI scheme APIs - e.g. so you could register an API which has an OpenAPI schema in a few lines of code - this should cover many common cases where you don't need full bidirectional communications
- Add support for registering MCP toolsets
- Create our own toolsets for interacting with common tools like slack, gmail, search etc. - this should be simple since I think many of these are already build for MCP, see here