Pydantic Resolve

v1.0.0Developer Toolsstable

build declarative and ai native application from day 1

bfffastapifullstackgraphqlmcp
Share:
323
Stars
0
Downloads
0
Weekly
0/5

What is Pydantic Resolve?

Pydantic Resolve is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to build declarative and ai native application from day 1

build declarative and ai native application from day 1

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • build declarative and ai native application from day 1

Use Cases

Build declarative AI-native applications.
Create full-stack solutions.
Use FastAPI with Pydantic.
allmonday

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx pydantic-resolve

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Pydantic Resolve

Pydantic Resolve is a Python framework that simplifies building declarative, AI-native data layers by automatically batching and resolving nested relational data through Pydantic v2 models. Its MCP integration — available via pip install pydantic-resolve[mcp] — lets developers expose their entity relationship diagram as an MCP server with a single create_mcp_server() call, allowing AI agents to traverse complex data graphs (users, posts, comments, tasks) using natural language without writing one-off query endpoints. It is particularly useful for full-stack Python applications using FastAPI, GraphQL, or async ORMs where N+1 query problems and scattered data-fetching logic are common pain points.

Prerequisites

  • Python 3.10 or higher
  • Pydantic v2 installed
  • pip for installing pydantic-resolve and the optional mcp extra
  • An MCP-compatible client such as Claude Desktop (for the MCP server feature)
1

Install pydantic-resolve with MCP support

Install the base package plus the mcp extra, which adds the create_mcp_server() helper and the MCP SDK dependency.

pip install pydantic-resolve
pip install "pydantic-resolve[mcp]"
2

Define your entity models with resolve_ methods

Create Pydantic models with resolve_ methods that load related data. Pydantic Resolve automatically batches these into efficient bulk queries to avoid N+1 problems.

from pydantic import BaseModel
from pydantic_resolve import Loader
from typing import Optional

async def user_loader(user_ids: list[int]):
    # batch fetch users by id
    return {uid: await fetch_user(uid) for uid in user_ids}

class TaskView(BaseModel):
    id: int
    owner_id: int
    owner: Optional[dict] = None

    def resolve_owner(self, loader=Loader(user_loader)):
        return loader.load(self.owner_id)
3

Expose your data graph as an MCP server

Use create_mcp_server() with your entity relationship diagram to spin up an MCP server. AI agents can then query your data graph through the MCP protocol.

from pydantic_resolve import AppConfig, create_mcp_server

mcp = create_mcp_server(apps=[AppConfig(name="blog", er_diagram=diagram)])
mcp.run()
4

Configure Claude Desktop to connect to the MCP server

Add the pydantic-resolve MCP server to your claude_desktop_config.json. Since it is a Python script, use the Python binary from your virtual environment.

{
  "mcpServers": {
    "pydantic-resolve": {
      "command": "/path/to/venv/bin/python",
      "args": ["/path/to/your/mcp_server.py"]
    }
  }
}
5

Resolve nested data in your application code

Use the Resolver class to trigger batch resolution of nested models. This is the core usage pattern outside of the MCP context, for building BFF (backend for frontend) APIs.

from pydantic_resolve import Resolver

tasks = [TaskView(id=1, owner_id=42), TaskView(id=2, owner_id=43)]
resolved = await Resolver().resolve(tasks)
# owner field is populated via batched loader

Pydantic Resolve Examples

Client configuration

Claude Desktop configuration pointing to a pydantic-resolve MCP server script in a local Python virtual environment.

{
  "mcpServers": {
    "pydantic-resolve": {
      "command": "/Users/yourname/myproject/venv/bin/python",
      "args": ["/Users/yourname/myproject/mcp_server.py"]
    }
  }
}

Prompts to try

Example prompts for an MCP server built with pydantic-resolve exposing a blog entity relationship diagram.

- "List all blog posts by user Alice including the comment count on each post."
- "Show me the top 5 most commented posts and their authors."
- "Get all tasks assigned to user ID 42 along with their sprint and project details."
- "List all posts published in the last 30 days with their tags."
- "Show me all users who have commented more than 10 times this month."

Troubleshooting Pydantic Resolve

ImportError: cannot import name 'create_mcp_server' from 'pydantic_resolve'

You need the mcp extra: run pip install "pydantic-resolve[mcp]". The create_mcp_server function is only available when the MCP SDK is installed alongside the base package.

N+1 queries still occurring despite using Loader

Ensure your loader function accepts a list of ids and returns results for all of them in a single batch call. If each loader call only fetches one record, the batching is not being triggered — verify you are using Loader(your_loader_fn) not calling the function directly.

Pydantic v1 compatibility errors

Pydantic Resolve v5+ requires Pydantic v2. Run pip install "pydantic>=2.0" to upgrade. If your project depends on Pydantic v1, consider pinning to an older version of pydantic-resolve compatible with v1, or migrate your models to v2 syntax.

Frequently Asked Questions about Pydantic Resolve

What is Pydantic Resolve?

Pydantic Resolve is a Model Context Protocol (MCP) server that build declarative and ai native application from day 1 It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Pydantic Resolve?

Follow the installation instructions on the Pydantic Resolve GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Pydantic Resolve?

Pydantic Resolve works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Pydantic Resolve free to use?

Yes, Pydantic Resolve is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "pydantic-resolve": { "command": "npx", "args": ["-y", "pydantic-resolve"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Pydantic Resolve?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides