Skip to main content

Model Context Protocol tool calling support for Pydantic AI

Project description

pydantic-mcp

PyPI - Version

Model Context Protocol tool calling support for Pydantic AI.

Just create an mcp.ClientSession and call tools = await mcptools(session) to get a list of pydantic_ai.Tool instances for the supported tools.

Example:

https://github.com/rectalogic/pydantic-mcp/blob/98c4e9abf31837cb48ebeb3eae6cb55b16c841e8/tests/demo.py#L15-L25

Demo

You can run the demo against Groq llama-3.1-8b-instant:

$ export GROQ_API_KEY=xxx
$ uv run tests/demo.py "Read and summarize the file ./LICENSE"
Secure MCP Filesystem Server running on stdio
Allowed directories: [ '/users/aw/projects/rectalogic/pydantic-mcp' ]
The file ./LICENSE is a MIT License agreement. It states that the software is provided "as is" without warranty and that the authors and copyright holders are not liable for any claims, damages, or other liability arising from the software or its use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic_mcp-0.1.1.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydantic_mcp-0.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: pydantic_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pydantic_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1fd52f14bc2b6fdf10eeb52672b175bea5514ea31dfa736388c51b08d46a857c
MD5 d91c3b8c131080d42a8f458c5a0058c8
BLAKE2b-256 a63f873ff020c7aca0062e4af486bb123ee3ee40ee660041753a3b0941ddc85f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_mcp-0.1.1.tar.gz:

Publisher: publish.yml on rectalogic/pydantic-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydantic_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pydantic_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pydantic_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b46331fab6fb2a8b56fc869a6f1a7920e6519936d0a2f5dece0dce597eb5bd9
MD5 5c500cd03a5afaec5095eb8931981f09
BLAKE2b-256 e0ac41f84a853cfdf10b78491679ee92e53aba3b996b016968a8e88447cbb9fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_mcp-0.1.1-py3-none-any.whl:

Publisher: publish.yml on rectalogic/pydantic-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page