-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
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
Toolsets, OpenAPI and Model Context Protocol #110
Comments
Was instantly thinking of this as I saw the release. I would love to help with this if you're looking for some extra hands! |
Hello! Just stumbled over this, I´m working on a project which incoroporates many of the same ideas, but in a different way. It´s basically a backend for both mcp servers as well as pydantic-ai agents. Perhaps it´s interesting for you. :) |
This framework has a very nice collection of tools and keeps everything quite simple. Only a few of them are API related but a lot of them seem to be quite useful: |
Hi Everyone, excited to see where this goes. The link between OpenAPI, Pydantic, FastAPI is so well established you don't need me to explain it! MCP is looking like the equivalent of OpenAPI for this world, so naturally we're starting to familiar looking libraries like this... Using PydanticAI today against a well documented OpenAPI endpoint one has to essentially re-implement tools for each of the endpoints one has spent time documenting, validating and implementing on the FastAPI side. It would be really cool to imagine a future where one could:
|
+1 for Model Context Protocol support as their open-source tooling has grown quite a bit over the past 60 days Toolsets can also assist in dealing with third-party data which is often raw and unstructured |
I've started an experimental implementation of MCP tools. It currently is a little hack-y right now and depends on #881 Unfortunately the official mcp python library requires 3.10+ which is incompatible with with pydantic's support for 3.9 -- I was too lazy to look into fixing the UV errors so i just bumped a bunch of stuff to 3.10, but for the official release we probably want to do something different https://github.com/jonchun/pydantic-ai/tree/mcp The meat of the change is in |
I can look into what it takes to use 3.9. We rely on some features like pattern matching and new union syntax , but if needed I think we can manage to downgrade |
@dsp - to be clear pydantic-ai already supports 3.9 and the problem is mcp (new dependency) only supports 3.10+. The issue would be not downgrading but rather supporting the mcp package on 3.9 (or choosing to drop support for 3.9 in pydantic ai) |
Sorry. I am the maintainer of mcp, I meant 3.9 in the mcp sdk. Notable 3.9 is going to EOL in October, so we would support it only for 8 months |
@dsp - That makes a lot more sense, thanks! Bringing Python 3.9 support into MCP seems like unnecessary effort, especially since it’s reaching EOL in October. Instead, it might be worth exploring what it would take to drop 3.9 support for pydantic-ai. Maybe MCP support could be handled as a separate package for now and merged later when the time is right? |
I vote for killing 3.9 now 💀 |
That's one option. Selfishly I would love to say way more agents build around MCP so for I would be interested to make it as easy as possible to use MCP for Pydantic AI users, even if that means lowering the Python version on the MCP side. |
https://pypistats.org/packages/pydantic-ai According to this, there's a decent number of 3.9 downloads (~1000/day) -- No idea how accurate these numbers are though. |
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:
The text was updated successfully, but these errors were encountered: