How to Use the Constructor MCP in Pydantic AI
Enforce type-safe e-commerce searches with Pydantic AI and Constructor validation.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Constructor MCP to Pydantic AI
Create your Vinkius account to connect Constructor to Pydantic AI and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Validate catalog payloads at runtime using Pydantic AI
Validating catalog payloads at runtime relies on calling `search_products` to pull CRM records into your schema. This MCP Server ensures that every payload returned is validated against strict Pydantic models before your agent can act on it. If Constructor returns a modified CRM record that doesn't match your schema, the system raises a validation error immediately. This prevents your agent from passing corrupt data down to your checkout or ordering pipelines.
Enforce strict sorting rules for billing exports
Exporting billing rules to external systems requires calling `search_sorted` to enumerate structured rules. The returned data is immediately parsed and validated against your local Python types. This runtime check guarantees that active billing structures match your database schemas. If a rule fails the type check, the execution halts, protecting your financial systems from bad data.
Type-check recommendations and cloud vault limits
Fetching personalized recommendations relies on calling `get_recommendations` to trace explicit vault limits. Pydantic AI converts these logs into typed Python objects, ensuring your application gets clean data. This setup guarantees that your recommendation logic never processes null values or malformed objects. Pydantic AI handles the type safety, leaving your agent to focus on recommending the right products based on clean data.
Set up Constructor MCP in Pydantic AI
Prerequisites
- Python 3.10+ installed
-
pydantic-ai-slim[fastmcp]package - Active Vinkius subscription with a valid endpoint token
- 1
Install Pydantic AI with FastMCP
Run
pip install "pydantic-ai-slim[fastmcp]". The FastMCP toolset replaces the deprecatedMCPServerHTTPclass with full protocol support. - 2
Configure the FastMCPToolset
Pass a JSON-style config dict to
FastMCPToolsetwith your Vinkius URL. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. Supports Streamable HTTP, SSE, and Stdio transports. - 3
Create and run your agent
Pass the toolset to
Agent(toolsets=[toolset])and callagent.run(). Swapopenai:gpt-4ofor any supported model — Anthropic, Google, Mistral, or Groq.
from pydantic_ai import Agent
from pydantic_ai.toolsets.fastmcp import FastMCPToolset
toolset = FastMCPToolset({
"mcpServers": {
"constructor-mcp": {
"url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
}
}
})
agent = Agent(
"openai:gpt-4o",
toolsets=[toolset],
system_prompt="You have access to Constructor tools.",
)
result = await agent.run("List recent Constructor transactions")
print(result.output) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Constructor. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Constructor MCP in Pydantic AI
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Constructor MCP today
We host it, we monitor it, we maintain it. You just paste one token.