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_mcp.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.0.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.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydantic_mcp-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 dc867b5c8e1c342186868be33d6e4d3eb38f5195edddc7ad427ad9e04d054201
MD5 f5fca62866a098c35daca8ffec0f3801
BLAKE2b-256 b2c743c4a6867a2f6ae1007463fca2a542626458c9e9467dcbb04b36e5474a78

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_mcp-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: pydantic_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 562b34b9e1477aef26a12fae6e0317789c25d8976236e6165aced0e532e5fbc9
MD5 ea44d5e3ae4752d6f068a6b7acada059
BLAKE2b-256 de5344c290f5ded4c2430ea50aeeecfc0e9e333c2380780855517d500983baef

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_mcp-0.1.0-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