Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PYDANTIC_MCP_HOST | No | The host address to bind to when using HTTP transport. | |
| PYDANTIC_MCP_PORT | No | The port number to bind to when using HTTP transport. | |
| PYDANTIC_MCP_TRANSPORT | No | Transport method for the MCP server (e.g., 'stdio' or 'http'). | |
| PYDANTIC_MCP_ERROR_HISTORY_LIMIT | No | Limit for the number of errors kept in history. | |
| PYDANTIC_MCP_ALLOWED_IMPORT_ROOTS | No | Roots allowed for imports (e.g., paths to your application code). | |
| PYDANTIC_MCP_DEFAULT_SCAN_PACKAGES | No | Packages to scan for Pydantic models by default. | |
| PYDANTIC_MCP_IMPORT_TIMEOUT_SECONDS | No | Timeout for importing packages in seconds. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_models | Discover exported Pydantic models in configured packages. |
| inspect_type | Resolve a Python type annotation or model into a structured description. |
| explain_model | Turn a model or type into a human-readable contract. |
| validate_data | Validate input against a model name or Python type expression. |
| serialize_data | Dump validated data using Pydantic serialization behavior. |
| generate_json_schema | Generate JSON Schema for a model or type. |
| create_example_payload | Generate example valid and invalid payloads for a target model or type. |
| compare_validation_modes | Compare model, TypeAdapter, strict, and JSON-vs-Python validation behavior. |
| migrate_v1_to_v2 | Analyze a snippet or model source for common Pydantic v1-to-v2 migration issues. |
| parse_partial_json | Best-effort parse partial JSON, then validate the parsed fragment. |
| generate_model_from_json | Infer candidate Pydantic models from a JSON string or JSON-like payload. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| explain model | Explain a model's fields, constraints, defaults, aliases, and edge cases. |
| generate api contract docs | Turn a model or schema into docs for API consumers. |
| debug validation error | Given a validation trace, suggest the smallest payload fix. |
| design a model from example json | Infer a candidate Pydantic model from sample payloads. |
| review schema compatibility | Compare two models or schemas for breaking changes. |
| migrate to pydantic v2 | Inspect code and produce a migration checklist. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| server_capabilities | |
| project_settings | |
| project_import_roots | |
| recent_errors | |
| migration_rules | |
| models_index | |
| changed_models | |
| reference_overview |