What is EnrichMCP?
EnrichMCP is a powerful Python framework designed to help AI agents understand and interact with your data more effectively. By adding a semantic layer built on the Model Context Protocol (MCP), EnrichMCP transforms your existing data models into typed, discoverable tools, functioning much like an ORM specifically tailored for AI applications. It provides a robust and reliable way for AI agents to navigate and utilize your data with clarity and precision.
Key Features
EnrichMCP equips you with essential tools to create intelligent data interfaces for AI agents:
🔍 Automatic Schema Discovery: Empower AI agents to instantly explore and understand your entire data model structure. This feature provides a complete schema detailing entities, fields, types, and relationships through a single, simple call.
🔗 Relationship Navigation: Define relationships between your data entities (like
User
toOrder
orOrder
toProduct
) once, and EnrichMCP enables AI agents to traverse these connections naturally and efficiently.🛡️ Type Safety & Validation: Ensure data integrity and reliability with comprehensive Pydantic validation applied to all inputs and outputs. You can define strict data types, constraints (e.g., minimum values, specific formats like
EmailStr
), and allowed literal values, ensuring that data handled by agents meets your requirements.✏️ Mutability & CRUD: Control how AI agents can modify data. Fields are immutable by default, but you can explicitly mark them as mutable. EnrichMCP then automatically generates patch models, streamlining the process for creating, updating, and deleting data records securely.
📄 Pagination Built-in: Effortlessly handle large datasets by implementing built-in pagination. This allows AI agents to retrieve data in manageable chunks, improving performance and usability when dealing with extensive data collections.
🔐 Context & Authentication: Pass essential context, such as authentication details, database connections, or other required resources, to your data operations. This enables you to implement fine-grained access control and integrate custom logic based on the agent's context.
Use Cases
EnrichMCP provides flexible pathways to integrate AI agent data access into your existing architecture or build new, sophisticated data layers:
Transforming Existing SQLAlchemy Models: Quickly expose your current SQLAlchemy data models as an AI-navigable API. Simply add a mixin to your declarative base, and EnrichMCP automatically generates the necessary tools and resolvers, allowing agents to query, filter, and traverse relationships defined in your ORM.
Wrapping Existing REST APIs: Add a semantic layer on top of your existing REST APIs without modifying their core logic. Define your data entities using EnrichMCP models, specify relationships, and write simple resolver functions that call your APIs. EnrichMCP then provides a structured, type-safe interface for AI agents to interact with your API data.
Building a Custom Data Layer: Construct a bespoke data layer with complex business logic and computed fields. Define entities with standard and computed fields (e.g.,
lifetime_value
,churn_risk
). Implement custom resolvers for fetching data, calculating values, or integrating external services like machine learning models, providing a rich, intelligent data interface for agents.
Why Choose EnrichMCP?
EnrichMCP enhances the core Model Context Protocol (MCP) with three critical layers, specifically designed for robust AI agent interaction:
Semantic Layer: Enables AI agents to understand the meaning of your data and its relationships, moving beyond mere structural awareness.
Data Layer: Provides type-safe models, built-in validation via Pydantic, and clear relationship definitions for reliable data handling.
Control Layer: Incorporates essential functionalities like authentication, pagination, and the ability to embed custom business logic, giving you precise control over data access and manipulation.
The result is a framework that allows AI agents to work with your data as naturally and effectively as a developer uses a traditional Object-Relational Mapper (ORM).
Conclusion
EnrichMCP delivers a structured, type-safe, and semantically rich framework for connecting AI agents to your data. Whether you're leveraging existing databases or building custom data interfaces, EnrichMCP provides the tools to make your data discoverable and usable for intelligent applications.
