Skip to content

Conversation

@Artui
Copy link
Contributor

@Artui Artui commented Oct 7, 2025

Closes #3100

@DouweM DouweM self-assigned this Oct 7, 2025
@Artui Artui requested a review from DouweM October 8, 2025 13:36
@Artui
Copy link
Contributor Author

Artui commented Oct 8, 2025

@DouweM can you check it again, when you have a moment? Thanks!

@Artui
Copy link
Contributor Author

Artui commented Oct 9, 2025

I have also updated docs now

@DouweM
Copy link
Collaborator

DouweM commented Oct 9, 2025

@Artui Thanks Artur, I'll review today!

@Artui Artui requested a review from DouweM October 9, 2025 21:48
@Artui
Copy link
Contributor Author

Artui commented Oct 9, 2025

@DouweM i think I addressed most of the comments. I'm a bit unsure regarding passing things back to API - BuiltinToolCallPart/BuiltinToolReturnPart only has args/content passed to it, but MCP calls have additional fields on it, like server_label and such. I'm pushing an entire serialised calls there, not sure if that's correct though, but seems okay

@Artui
Copy link
Contributor Author

Artui commented Oct 10, 2025

@DouweM this is once again ready for review. Sorry for constant pings - I really want to start using it :D

Copy link
Collaborator

@DouweM DouweM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Artui Nice work! Feel free to join our public Slack in case there's something you want to discuss more directly

@DouweM
Copy link
Collaborator

DouweM commented Oct 13, 2025

@Artui Check out the docs changes in https://github.com/pydantic/pydantic-ai/pull/2784/files as well - this may make sense as a third item on the list of MCP "client"s.

@Artui Artui force-pushed the feature/native-mcp-support branch from c68416d to 20a4a6a Compare October 13, 2025 20:04
@Artui Artui requested a review from DouweM October 13, 2025 20:45
@Artui Artui requested a review from DouweM October 22, 2025 07:12
@Artui
Copy link
Contributor Author

Artui commented Oct 22, 2025

@DouweM I don't think server_id and tool_name fit into args because of how streaming of built-in tools and their args is built. I have now added tool_call_metadata and tool_return_metadata to classes, and I think they now fit the use case better and handle serialization and deserialisation too

@DouweM DouweM changed the title feature: Native MCP support Support OpenAI and Anthropic native MCP support via MCPServerTool builtin tool Oct 23, 2025
@DouweM DouweM merged commit d4a85e6 into pydantic:main Oct 24, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native MCP support

3 participants