# RAW Labs — Full content for LLM ingestion
> AI engineering for the enterprise. We engineer the data, integration, governance, and runtime layers behind production-grade AI.
This document concatenates the substantive content of raw-labs.com for the convenience of LLM crawlers and retrieval systems. Two sections follow:
1. **Canonical brand pages** — About and Careers.
2. **Engineering blog posts** — every published article, newest first.
Each entry is preceded by structured metadata (canonical URL, publish date, tags, and where applicable an author byline with profile URL). All content © RAW Labs SA; cite with the canonical URL listed in each entry's header.
Site: https://www.raw-labs.com/
Products: Kora (https://kora.raw-labs.com), MXCP (https://mxcp.dev)
Founded: 2015 · Headquartered in Switzerland
Contact: https://www.raw-labs.com/contact
---
# About RAW Labs
**Canonical URL:** https://www.raw-labs.com/about
**Type:** Marketing page
> Since 2015, RAW Labs has helped enterprises adopt advanced data and AI technology. Headquartered in Switzerland, serving organizations globally.
RAW Labs is a Swiss engineering firm building the data, integration, governance, and runtime layers behind production-grade enterprise AI. The systems large organizations rely on at the scale, security, and compliance their industries demand.
## What we do today
AI is transforming every industry, and so are the engineering challenges that come with it — implementation, governance, and compliance. RAW Labs applies a decade of enterprise experience to those challenges, delivering the technologies and solutions — built in-house and with open source — that make advanced AI dependable in production.
## Where we came from
Founded in 2015, RAW Labs has shipped high-performance data virtualization, data lakes, advanced analytics, and secure data access for organizations across telecommunications, manufacturing, financial services, and healthcare. Each of those industries has its own definition of "production-ready" — we've worked through them all.
## Where we are
Headquartered in Switzerland, RAW Labs serves enterprises globally — organizations pioneering the use of advanced technology systems.
## Quick facts
- **Founded:** 2015
- **Headquarters:** Switzerland
- **Industries served:** Telecommunications, manufacturing, financial services, healthcare
- **Products:** Kora (AI-agent orchestration), MXCP (open-source enterprise MCP server)
- **Contact:** https://www.raw-labs.com/contact
---
# Careers at RAW Labs
**Canonical URL:** https://www.raw-labs.com/careers
**Type:** Marketing page
> Join RAW Labs. We hire engineers, researchers, and builders pushing the boundaries of enterprise AI engineering — data, integration, governance, and runtime.
RAW Labs works with people who build at the cutting edge of enterprise AI infrastructure.
## What we're looking for
Show us what you've built. Open-source projects, research papers, technical write-ups — work that shows how you think. We're less interested in CVs and standard role descriptions, more interested in the people pushing engineering boundaries.
## For researchers and students
RAW Labs collaborates actively with the DIAS lab at EPFL (https://www.epfl.ch/labs/dias/). EPFL students interested in summer internships or master projects on practical AI applications are welcome to get in touch. We can't help with EPFL admissions.
## What we're not looking for
Recruitment agencies, HR services, and generic job applications don't get a response.
## How to reach us
Have something exceptional to share? Email **hello@raw-labs.com** with your portfolio, papers, or write-ups attached.
---
# Introducing Kora: A Workflow Operating System for AI-Ready Operations
**Canonical URL:** https://www.raw-labs.com/blog/introducing-kora-workflow-operating-system/
**Published:** 2026-06-16
**Author:** Miguel Branco (https://www.linkedin.com/in/miguelbranco80/)
**Tags:** announcements, kora, ai-agents
> For enterprise AI, capability is no longer the hard part - control is. Kora runs critical business processes as governed workflows, introducing AI one reliable step at a time.
Every enterprise is about to face the same question: *how do you let AI
participate in real work without giving away the operating knowledge that makes
the company different?*
The answer will not be found by simply picking the best frontier model. Models
will change. The durable advantage is the learning loop a company builds around
its own work: the workflows it runs, the decisions people make, the exceptions
they handle, the evidence they collect, the outcomes they trust, and the private
evals that prove whether automation is actually improving against business
reality.
That loop cannot be built from chat transcripts alone. It needs the work itself
to be modeled.
AI agents are becoming capable enough to read documents, classify requests,
draft responses, call tools, inspect systems, and prepare decisions. But in an
enterprise, capability is not the same as production readiness. The question is
not whether an agent can complete an isolated task. The question is whether the
organization can introduce **AI safely** into the way work already happens, then
automate more over time with **evidence**, **controls**, and **guarantees** about what
changed, what ran, and what was recorded.
Most important business processes are **workflows**: handoffs between teams,
exceptions routed across systems, approvals that carry accountability,
decisions that need evidence, and operational histories that must be
understandable after the fact. This is especially true in manufacturing,
maintenance, procurement, fulfillment, quality, compliance, and other
workflow-heavy environments where the cost of losing control is high.
At RAW Labs, we are introducing **[Kora](https://kora.raw-labs.com/)**: a workflow operating system for
important business processes across people, systems, approvals, and AI.
Kora is designed for organizations that want to model the work, model the
organization around the work, make execution observable, and introduce AI
gradually where it helps. Because Kora tracks workflow activity, releases,
tasks, decisions, service operations, agent traces, artifacts, and outcomes, the
organization gets something more valuable than a one-off automation: a growing
evidence layer for understanding what really happened, replaying the evidence
trail, reconstructing operational facts, and improving the system safely over
time.
## 1. The Workflow-to-AI Gap
The current enterprise AI conversation often jumps too quickly from "agents can
do useful work" to "agents should own the workflow." That skips the part that
matters most in production: the operating model around the agent.
*Organizations already have workflows*. They may live in BPMN diagrams, process
documents, ticket queues, spreadsheets, inboxes, internal tools, shared habits,
or team memory. These workflows encode how the business actually operates:
who reviews an exception, which system has the source of truth, where a veto is
allowed, what evidence is required, and how the final decision is recorded.
The problem is that these workflows are often brittle.
- They are difficult to change safely.
- They are weakly connected to runtime visibility.
- They are hard to audit after the fact.
- They depend on ad hoc handoffs across people, systems, and messages.
- They do not provide a clean path for introducing AI without losing control.
At the same time, many current AI and automation approaches ask enterprises to
choose between three imperfect options.
Traditional workflow and BPM suites provide structure, but can be heavy to
change and often treat AI as an add-on assistant rather than a first-class
participant in the process.
Automation tools are fast for simple chains of actions, but become weaker when
the process requires approvals, exceptions, long-running state, release control,
and operational evidence.
Agent frameworks give developers flexibility, but usually do not provide the
full operating model around identity, access, workflow releases, human review,
integration governance, audit, and business ownership.
This creates the workflow-to-AI gap: the gap between what agents can do in
isolation and what enterprises need in order to trust AI inside important
business processes.
## 2. What Production AI Workflows Require
If AI is going to participate in operational work, it needs more than a prompt,
a tool list, and a chat window.
It needs a process around it.
### 2.1 The workflow must remain the unit of control
*In [Kora](https://kora.raw-labs.com/), an AI agent is not the unit of control. The workflow is.*
This distinction matters. A workflow defines where work starts, what data is
required, which decisions exist, who or what performs each step, when human
review is mandatory, how errors are handled, and what evidence is retained.
Agents can participate in that workflow. They can gather information, draft a
recommendation, classify an exception, extract data from documents, or prepare
an answer. But the process decides where the agent is allowed to act and where a
person must **review, approve, reject, or escalate**.
### 2.2 Human accountability must stay visible
Many valuable workflows include judgment, approval, or exception handling. A
quality deviation, procurement exception, change-control request, or production
escalation is not just a task to complete; it is an accountable business event.
Kora keeps human work first-class. A task can be assigned to a person or an
agent through the same workflow model. That allows a team to start with a
faithful human process, move one step to an agent when ready, and move it back
to a human if the risk profile changes.
This is the practical adoption path for enterprise AI: not all-or-nothing
autonomy, but **controlled movement of work across humans and agents**.
### 2.3 System interaction must be explicit
Important workflows touch systems of record, internal APIs, messaging channels,
documents, provider accounts, and operational tools.
Those interactions should not be hidden inside unstructured agent behavior.
Kora models deterministic system interaction through service nodes and
operations. External systems and provider-specific behavior are mediated through
installed extensions, explicit credentials, and environment-scoped
configuration.
The goal is to make system access governable. Teams should be able to answer:
which workflow called which system, under which release, with which configured
integration, and what result was recorded.
### 2.4 Change must be reviewable
*When a workflow affects real operations, editing the workflow is itself an
operational act.*
Kora separates source proposals, immutable releases, environment deployments,
and live runs. Conversational authoring and local editing can move quickly, but
those edits do not silently change production. A release freezes the workflow
source. An environment deployment applies that release to a named target such
as production or staging. A live workflow starts from the environment's current
deployment.
This gives teams a disciplined path from design to operation:
1. Model the process.
2. Validate the workflow.
3. Create a release.
4. Deploy it to an environment.
5. Observe real runs.
6. Improve from evidence.
### 2.5 Evidence must survive the run
*Operators and business owners need to know what happened.*
Kora separates control-plane audit from runtime evidence. Audit answers who
changed access, configuration, releases, deployments, and other security- or
governance-relevant state. Runtime evidence explains what happened inside a
workflow run: tasks, service calls, decisions, failures, retries, agent traces,
artifacts, and outcomes.
This evidence is also what lets a **company learn from its own operations**. If a
workflow records what was requested, what context was available, what a human
decided, what an agent recommended, which system calls were made, and what
outcome followed, the organization can build private evaluations around the
outcomes that actually matter to the business. It can compare proposed
automation against real traces. It can replay and reconstruct facts without
re-running the original business action. It can improve the workflow from
evidence instead of intuition.
This distinction matters because not every useful event belongs in one giant
log. The right evidence layer depends on the question:
- Who deployed this release?
- What changed between versions?
- Why did the run fail?
- Which human task is waiting?
- What did the agent use?
- Which system interaction produced the final result?
Kora is designed so those questions can be answered from the product model, not
reconstructed from scattered logs and chat transcripts.
## 3. A Workflow Operating System
*[Kora](https://kora.raw-labs.com/) brings these requirements into one operating model.*
At the product level, Kora combines five layers:
- workflow design and release management
- organization, role, and participant modeling
- integration and connected-account management
- workflow execution and task handling
- monitoring, audit, and operational review
Together, these layers let a team move from a documented process to an
operational workflow system.
*The core object is not an agent. It is a process.*
A process describes the workflow graph: starts, tasks, service nodes, decisions,
gateways, timers, receives, calls to other workflows, and ends. It defines
typed inputs and outputs, state transitions, boundaries, and failure behavior.
Around that process, Kora models the organization:
- roles, such as reviewer, approver, technician, dispatcher, or escalation owner
- people, who represent modeled participants in the workflow
- agents, who can perform selected tasks
- capabilities, which describe the work a task requires
- assignments, which decide whether a role is performed by a person or an agent
- operations, which perform deterministic system actions
- extensions, which connect Kora to external systems and provider-specific behavior
This model lets the workflow preserve its shape while responsibility changes.
A team can keep the same process and move a task from a human reviewer to an AI
agent, or from an agent back to a human, without throwing away the workflow
itself.
That is the heart of Kora's architecture: separate the work that needs to happen
from the participant that performs it.
## 4. Conversational Authoring Without Uncontrolled Production Changes
*Workflow design often begins in messy reality.*
There may be process notes, stakeholder interviews, legacy diagrams, standard
operating procedures, exceptions, edge cases, system handoffs, and approval
rules. Turning that into an executable workflow is usually the job of a forward
deployed engineer, solution architect, automation lead, or technical process
owner who understands both the customer and the implementation.
Kora makes that work **conversational**.
A builder can describe an existing process, paste process notes, upload
documentation, ask questions about the workflow, refine responsibilities,
identify approval points, add integrations, test parts of the workflow, and
compare proposed changes.
But the conversation is not the runtime.
Chat and local workspaces are proposal surfaces. They help a builder create and
validate workflow source. They do not make a workflow live by themselves. When
the proposal is ready, release creation freezes it into an immutable artifact.
Deployment then applies that release to a specific environment.
This is important for enterprise adoption. AI can help design and improve the
workflow, but **the organization remains in control** of when a change becomes
operational.
## 5. Agents Inside Governed Workflows
*Kora's view of AI agents is intentionally pragmatic.*
Most organizations will not begin by handing an entire process to an agent.
They will start with one useful step.
Common patterns include:
- **Agent draft, human review**: the agent prepares work and a human approves,
edits, or rejects it.
- **Agent triage, human exception handling**: the agent handles low-risk
classification or summarization, while unclear or sensitive cases are routed
to people.
- **Parallel human and AI work**: an agent gathers supporting context while a human
team performs judgment-heavy review.
- **Gradual expansion**: the organization evaluates outcomes, then expands
automation only where evidence supports it.
Kora supports these patterns by making agent work bounded.
An agent task is configured through workflow roles, assignments, capabilities,
limits, tools, structured output expectations, sandbox policy, and enabled
extensions. The workflow still determines how the result is used, when a human
must review, and how exceptions are escalated.
This is *different* from giving an agent arbitrary tools and hoping the prompt
contains enough governance. Kora places the agent inside the business process.
## 6. Enterprise Integration As A Product Boundary
Enterprise workflows do not run in isolation. They need to call systems, read
records, update status, notify people, and exchange data with the tools an
organization already uses.
*Kora provides two complementary integration paths.*
Service nodes call operations for deterministic work: API calls, data
transforms, file extraction, system updates, provider calls, and other
side-effecting behavior. Operations receive typed input and return typed output
back into workflow state.
Installed extensions provide environment-scoped provider behavior. An extension
can expose functions for operations, tools or skills for agent tasks, settings
views, callbacks, schedules, and integration-specific state. Organizations can
manage extension installs centrally, including configuration, grants, enabled
state, and registered capabilities.
This gives customers a way to connect external systems without turning provider
access into unstructured agent context. Credentials and provider state remain
managed configuration. Agents and scripts receive only the specific access their
workflow step is allowed to use.
## 7. Releases, Environments, And Operational Control
*Kora treats workflow change as a first-class product concern.*
A release is an immutable snapshot of authored workflow source. It can include
process definitions, modeled participants, roles, capabilities, operations,
decisions, templates, scripts, source files, and other definition-time inputs.
Creating a release does not make it live.
An environment is a deployment target and runtime configuration scope. A
production environment can have its own runtime variables, secret definitions,
extension installs, policies, and live deployment pointer. Deploying a release
to an environment validates and applies that release against the environment's
current configuration.
If deployment fails, Kora records the failed attempt and leaves the previous
live pointer unchanged. Returning to a historical workflow is also explicit:
deploy the historical release again, or materialize its source, edit it, create
a new release, and deploy that.
This is deliberately different from silently mutating live behavior in place.
The product model gives operators a trail of what changed, what was applied,
where it was applied, and which release was live when work ran.
## 8. Security And Governance Posture
Kora is designed for business-critical workflow operation, so identity,
authorization, tenant isolation, secrets, sandboxing, and audit are part of the
operating model rather than afterthoughts.
Current product posture includes:
- local authentication and OIDC-based SSO modes depending on deployment
configuration
- Kora-owned sessions, memberships, roles, org context, and authorization checks
- organization-scoped API keys
- tenant isolation through organization-scoped authorization and storage controls
- managed secret storage rather than raw secrets in workflow source or prompts
- explicit sandbox policy for hosted agent and service execution
- opaque, scoped, expiring links for human review and artifact delivery
- fail-closed behavior for security-sensitive configuration
- append-only audit records for control-plane and security-relevant actions
The important product point is not a generic compliance claim. The point is that
governance is built into the workflow operating model. Access, releases,
deployments, environments, tasks, artifacts, integrations, and runtime evidence
are all part of the same controlled system.
## 9. Where Kora Fits First
Kora is strongest where the workflow is important, cross-system,
approval-heavy, and a good candidate for gradual AI assistance.
Good first use cases include:
- **manufacturing** quality deviation or non-conformance handling
- **production** or **maintenance** escalation
- **change-control** approval
- **procurement** or **fulfillment** exception handling
- **document** intake and review
- **support** escalation with human approval
- **compliance** review handoff
- **operational incident** triage and escalation
These workflows tend to share the same pattern:
1. Something important happens in an enterprise system.
2. The process routes through known steps.
3. One or more humans review, approve, veto, or escalate.
4. The run must be visible and auditable.
5. One step can later move to an agent without redesigning the whole workflow.
That is why Kora's recommended adoption path is incremental:
1. Mirror the existing workflow.
2. Prove reliability and visibility.
3. Introduce agents selectively.
4. Expand to more workflows and deeper integrations.
This path respects how serious operations actually change. It gives customers
value before full autonomy, and it gives them evidence before broader rollout.
## 10. Why We Are Building Kora
We believe enterprise AI adoption will not be won by the most autonomous demo.
It will be won by systems that let organizations introduce intelligence without
losing operational discipline.
Agents need context, tools, and memory. But they also need boundaries:
workflows, roles, approvals, releases, environments, audit, and evidence.
Without those boundaries, AI remains impressive in isolated demos and risky in
production.
The deeper opportunity is compounding. Every workflow run can teach the
organization something: which cases were easy, which required judgment, which
agent recommendation was accepted, which exception path mattered, and which
outcome became ground truth. Over time, that becomes a private learning loop
around the company's own work. Human expertise does not disappear into a generic
model; it becomes structured, reviewable, and reusable inside the company's own
operating system.
*Kora is our answer to that problem.*
It is a workflow operating system for organizations that need real work to run
reliably. It starts from existing processes, keeps humans and approvals
first-class, connects enterprise systems through explicit integration
boundaries, and gives AI a governed place to participate.
The goal is not to replace business process discipline with agents.
The goal is to make business processes executable, observable, reviewable, and
AI-ready.
That is the foundation we believe enterprises need for the next phase of
agentic operations.
## 11. What We Want To Build With Customers
The best first Kora conversations are not abstract AI strategy conversations.
They start with a real workflow.
Bring the quality exception process. Bring the production escalation path. Bring
the change-control approval flow. Bring the procurement exception that crosses
three systems and four teams. Bring the document review process where AI can
help, but where a person still needs to own the final decision.
Kora is built for that kind of work: specific enough to model, important enough
to govern, and valuable enough to improve over time.
If you have a workflow where **reliability, approvals, integration, and gradual
AI adoption all matter at once**, we would like to talk.
---
# Constrained Space, Better Code: MXCP & Claude Skills
**Canonical URL:** https://www.raw-labs.com/blog/constrained-space-better-code/
**Published:** 2026-01-06
**Author:** Alex Zerntev (https://www.linkedin.com/in/alexzerntev/)
**Tags:** coding-agents, mxcp, llm, ai-development, validation, claude
> LLMs can generate code fast but also break systems just as easily. Learn how frameworks with built-in validation transform chaotic AI code generation into reliable, production-ready output.

## Introduction
Large Language Models have become remarkably effective at software development tasks, from navigating large codebases and refactoring complex logic to identifying bugs and generating working implementations with impressive speed. At the same time, they can just as easily break a functioning system, introduce subtle errors, or produce code that looks correct but fails in practice, a behavior that follows directly from how LLMs generate code in a largely unconstrained space. When there is no built-in validation, the gap between productive automation and failure becomes thin, making reliability the central challenge in real-world systems.
In this post, we explore how [Claude Code](https://claude.ai/download), when augmented with [Skills](https://www.anthropic.com/news/skills) and operating inside the [MXCP](https://mxcp.dev) framework, addresses this challenge by deliberately restricting the coding space and reinforcing correctness through structure and feedback. Skills provide concrete, in-context knowledge about how MXCP is intended to be used, while the framework constrains generation to a small set of well-defined, valid operations and enforces schemas, constraints, and operational guarantees. In real-world projects, this combination has enabled Claude Code to generate even complex MXCP-based [MCP](https://modelcontextprotocol.io) servers with minimal guidance, reducing development timelines from weeks to days while increasing confidence in correctness and stability, and providing a predictable path toward production-ready systems.
## A Core Problem: Unconstrained Generation
At their core, LLMs are probabilistic token generators. Given a prompt, they predict the next token based on learned patterns, not on an understanding of correctness or system constraints. The space of possible tokens they can produce is effectively infinite, while the subset that represents valid, safe, and useful code within a real system is relatively small. When this output space is left unconstrained, even highly capable models are forced to guess what “valid” looks like. Small variations in context or probability can then push the model toward drastically different outcomes - some correct, others destructive. The fundamental problem is not model intelligence, but the absence of boundaries that define what is allowed to exist.
## Why Validation Changes Model Behavior

Validation introduces feedback, something raw LLM generation fundamentally lacks. Without validation, a model can only optimize for plausibility - producing code that looks correct but may fail at compile time, runtime, or under real workloads. When validation mechanisms such as **tests, schemas, type checks, or runtime assertions** are built into the system, they provide an explicit signal of success or failure. This signal allows the model to iteratively adjust its output, converging toward correctness rather than guessing it in a single attempt. Validation does not make the model smarter; it makes the environment smarter, transforming one-shot generation into an adaptive process grounded in observable outcomes.
## Structural Constraints, Not Better Prompts
> A software framework is a reusable, semi-complete application that provides a predefined structure for developing software by defining control flow, extension points, and common functionality.
Frameworks are the mechanism through which constraints and validation become enforceable. Instead of relying on prompts to describe what a model should or should not do, frameworks encode these rules directly into the system. They restrict the model’s output space by exposing only valid operations, enforcing schemas and types, and embedding domain rules into the execution flow.
In such systems, invalid states are impossible to express. By shaping the environment in which generation occurs, frameworks turn probabilistic models into reliable components, ensuring that creativity exists only within well-defined boundaries.

## Familiarity Matters: When Models Know the Framework
Frameworks only provide their full benefits when the model understands how to use them. If a framework is widely adopted and well represented in training data, LLMs tend to perform extremely well. A common example is frontend development: code generated with React is often significantly higher quality than equivalent implementations written in vanilla HTML and JavaScript. The model has seen enough real-world React code to internalize its patterns, conventions, and best practices.
The situation changes dramatically when the framework is custom or poorly represented in training data. In those cases, the model has no reliable prior knowledge to draw from and is forced to rely on guesswork. Sometimes this guesswork succeeds, but just as often it produces incorrect, inconsistent, or entirely unusable output. Without additional structure, the benefits of a framework alone are not enough.
### Claude Skills to the Rescue
[Claude Skills](https://www.anthropic.com/news/skills), developed by [Anthropic](https://www.anthropic.com/), provide a powerful solution to this problem. Skills allow developers to preload useful information, scripts, references, and assets that support in-context learning when working with a framework. Instead of relying on vague natural language descriptions, the model gains access to concrete, executable knowledge about how the framework should be used.
By embedding this information directly into the model’s working context, Skills effectively “train” the agent at runtime. This dramatically reduces guesswork and aligns the model’s behavior with the framework’s intended design. When combined with a constrained and validated environment, Skills enable LLMs to work reliably even with custom or domain-specific frameworks.
## Generating an MCP Server: A Concrete Example
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is a widely used protocol designed to enable communication between agents and systems. While there are multiple MCP implementations across different programming languages, they all share a common characteristic: the developer is free to implement almost anything. This flexibility is powerful, but it comes at a cost.
Building a reliable MCP server requires far more than just implementing protocol handlers. Production-grade systems need **observability, logging, validation, testing, authentication, and policy enforcement**. Implementing these concerns repeatedly results in large amounts of boilerplate code. This boilerplate significantly increases the number of tokens that must be included in the model’s context for effective code generation, which directly increases cost. It also creates long-term maintenance problems: copying and adapting similar MCP servers across projects leads to divergence, fragility, and codebases that are difficult for both humans and LLMs to reason about.
This is a textbook case for introducing a framework.
### MXCP: A Production-Ready MCP Framework
Most LLM-driven agent workloads follow a small number of recurring patterns: CRUD operations over data and the execution of custom business logic. [MXCP](https://mxcp.dev) is built around this observation and deliberately restricts the execution space to three well-defined domains: YAML for endpoint definitions, SQL for data access (over any supported data source), and Python for custom logic.

With MXCP, developers define MCP endpoints declaratively using a YAML schema that specifies inputs and outputs. The executable behavior of each endpoint is then implemented using either SQL or Python - YAML handles the "what," while SQL and Python handle the "how." This design dramatically narrows the space of possible implementations. While the space remains theoretically infinite, it is constrained to forms that are predictable, auditable, and easier for models to generate correctly.
MXCP also provides built-in support for **observability, logging, drift detection, policy enforcement, and authentication**. Because these concerns are handled by the framework, the coding agent does not need to generate, read, or maintain large volumes of boilerplate code. This reduces context size, lowers token costs, and improves generation quality.
### Validation as a Feedback Loop
Restricting the implementation space is necessary, but it is not sufficient. Even within a constrained framework, the space of possible implementations remains infinite - just [a much smaller and more structured infinity](https://en.wikipedia.org/wiki/Cantor%27s_theorem) than unconstrained code generation. Models can still make incorrect assumptions, misunderstand requirements, or choose suboptimal implementations within those bounds.
This is where validation becomes essential. MXCP provides multiple layers of validation and testing that create explicit feedback loops for the coding agent:
- `mxcp validate` - schema validation and type checking
- `mxcp test` - end-to-end unit tests for MCP endpoints
- `mxcp lint` - quality and consistency checks for MCP implementations
- `mxcp evals` - evaluation of how well different models understand and interact with the MCP server
- Custom unit tests - project-specific validation logic
Each layer further narrows the effective space the model can operate in. While the theoretical space of valid implementations remains infinite, repeated validation collapses it toward a subset that is correct, maintainable, and production-ready. The coding agent is no longer exploring an open-ended search space, but iterating within a guided process where failures are observable and correctness is reinforced. Reliability, in this setup, is not assumed - it is converged upon.
### Real World
In real-world projects, Claude Code paired with the [mxcp-expert skill](https://mxcp.dev/claude-code/) has been able to generate even highly complex MXCP servers with minimal guidance. Tasks that previously required **weeks of development were reduced to a single day at most, while confidence in correctness and stability increased significantly**. We are now on track to automate the entire MCP server development process. This improvement did not come from better prompts, but from operating within a constrained and validated framework.
```mermaid
flowchart TB
User["👤 User"]
Agent["🤖 Coding Agent"]
MXCP["⚙️ MXCP Framework"]
User -->|"Intent & requirements"| Agent
Agent -->|"Results & feedback"| User
Agent -.->|"Guards against errors"| User
Agent <-->|"Validate & test"| MXCP
MXCP -->|"Constraints & guarantees"| Agent
```
The relationship between the user, the coding agent, and the MXCP framework is inherently multidirectional. The user defines intent and reviews outcomes, the coding agent generates implementations and iteratively validates and tests them through MXCP, and the framework itself enforces structural and safety guarantees. In this setup, the agent not only produces code but also actively prevents critical failures - for example, by avoiding secret exposure, a class of errors Claude Code is explicitly designed to guard against.
### Evaluation
We have observed these patterns consistently across multiple production projects. To make the difference concrete, we ran a controlled comparison: two identical Claude Code sessions were given the same task. One session used the MXCP framework with the mxcp-expert skill, and the other used the pure MCP Python SDK with mcp-creator skill. The goal was not to prove that one approach is more capable, but to show how constraints and built-in validation affect reliability, iteration count, and implementation complexity.
**The task:** Build a production-ready e-commerce MCP server with 9 tools: CRUD operations (`create_product`, `get_product`, `update_product`, `delete_product`, `list_products`), analytics (`get_sales_summary`, `get_category_stats`, `get_low_stock_report`, `get_top_sellers`), and role-based authentication (admin-only vs public access). The server must use parameterized queries, validate all inputs, implement soft deletes, and pass all validation checks. The database includes 20+ products across 4 categories and 50+ sales records.
MXCP vs Pure MCP: Side-by-Side Comparison
MXCP: 65% less code, 70% fewer tokens, 68% fewer tests for 9-tool production server
MXCP produced **65% less code** (843 vs 2,404 lines), used **70% fewer output tokens** (~15K vs ~50K), and completed **50% faster** (5 min vs 10 min). Both implementations delivered all 9 tools with identical functionality: parameterized queries, input validation, role-based authentication, and proper error handling. The pure MCP version required 3x more test cases (56 vs 18) to achieve similar coverage - a direct consequence of having to test manually what MXCP validates by design. The difference is how reliably the framework guides generation toward a clean, production-ready result.
#### Follow-up: Extending the Implementation
Initial implementation is only part of the story. Real-world systems evolve as requirements grow. To simulate this, we ran a follow-up experiment: a user returns one month later to extend the existing implementation with features typically required for production - additional policies, a complementary CSV data source for cross-queries, auditing, observability, and LLM evals.
**The extension task:** *"Consume a complementary CSV data source for cross-queries, add relevant policies, enable auditing and observability, and include LLM evals."*
Extension Effort: Adding Features Later
Cost of extending an existing implementation with new requirements
MXCP: 7x less code, 8x fewer tokens, 3x faster, 7x fewer tests
* MCP agent exhausted 200K context window (~100K output tokens) during extension
The MXCP extension was straightforward: policies are declarative CEL rules, CSV data sources are configured in YAML, auditing and observability are single-line configuration toggles, and LLM evals are defined alongside tool definitions. Features that required additional code in MXCP are features the framework was designed to support - the agent simply activated them.
The pure MCP extension tells a different story. Adding the same features required implementing policies from scratch (669 lines), building an observability module (650 lines), creating an auditing system (560 lines), and developing CSV tools (478 lines) - each with comprehensive tests. The agent consumed **~110K tokens** and exhausted the context window, requiring careful management to complete. What MXCP enables with configuration, pure MCP requires as custom infrastructure.
Development Process Comparison
How Claude Code approached the same task with different tools
MXCP
Framework-guided
- 1
mxcp initScaffold project structure
- 2
Write YAML + Python + SQL9 tool schemas + 2 impl files
- 3
CEL policy rulesDeclarative auth (admin-only)
- 4
mxcp validate + test + lintAll 18 tests pass
- 5
Pure MCP
Manual setup
- 1
mkdir + venv + pipCreate project structure manually
- 2
Write 6 Python filesServer, models, DB, auth, tests
- 3
Manual auth middlewareAPI key param per tool
- 4
pytest + ruff + mypy56 tests, multiple lint passes
- 5
python -m serverStart server
Key Insight
MXCP achieved authentication via declarative CEL policy rules. Pure MCP required implementing auth as a parameter on every admin-only tool, plus manual validation logic throughout.
The workflow difference matters. MXCP provides a single path: `mxcp init`, write YAML and Python, then `mxcp validate`, `mxcp test`, `mxcp lint` - all integrated, all immediate. Pure MCP requires assembling project structure, tests, and quality checks manually using pytest, ruff, and mypy. The MXCP implementation is declarative - endpoints in YAML, validation in schemas, tests alongside definitions. The pure MCP version concentrates more logic in custom Python, which works but requires more coordination to get right. The framework does not remove work - it standardizes it, making successful outcomes easier to reproduce.
During the pure MCP implementation, the agent encountered database concurrency issues that required additional debugging and iteration to resolve - a common problem when building data-driven services from scratch. MXCP handles connection pooling and concurrent access by default, eliminating this entire class of issues before they occur.
Both approaches passed their validation suites. The framework trades some flexibility for guardrails, and in LLM-driven development those guardrails translate directly into more consistent results. But the difference extends beyond correctness - MXCP includes production concerns that pure MCP leaves as future work:
What You Get Out of the Box
Production-ready features included vs. features you'll need to build
| Feature |
MXCP |
Pure MCP |
| Schema validation |
✓ |
✗ |
| Input type checking |
✓ |
✗ |
| Test runner |
✓ |
✗ |
| Observability & logging |
✓ |
✗ |
| Auditing |
✓ |
✗ |
| Multi-source data |
✓ |
✗ |
| Health checks |
✓ |
✗ |
| Configuration management |
✓ |
✗ |
| Connection pooling |
✓ |
✗ |
| Authentication |
✓ |
✗ |
| Policy enforcement |
✓ |
✗ |
| Drift detection |
✓ |
✗ |
| Tool extensibility |
✓ |
✗ |
| LLM evals |
✓ |
✗ |
These gaps are manageable in a small project, but they **compound as systems grow**. The pure MCP implementation shows patterns that degrade with complexity: tight coupling, validation logic that can drift from schemas, and no hooks for cross-cutting concerns. MXCP addresses these at the framework level - observability, authentication, and policy enforcement are part of the execution model, not afterthoughts. When an LLM generates within MXCP, it inherits those guarantees automatically. The framework does not just constrain what can be generated - it makes the default output closer to production-ready.
## Conclusion
LLMs can act as autonomous authors of software, but reliability emerges from the systems they operate within. Their probabilistic nature is not a weakness to be eliminated, but a property to be shaped through structure and feedback. By restricting the space of valid outputs and introducing validation as a continuous signal, frameworks like MXCP turn autonomous generation into predictable execution. As the evaluation shows, these constraints reduce iteration, cognitive load, and failure modes while improving production readiness. In practice, reliability at scale comes from environments that encode boundaries, guarantees, and verification, not from prompts alone.
---
# MXCP: Production-Grade MCP Server for Enterprise AI
**Canonical URL:** https://www.raw-labs.com/blog/mxcp-production-mcp-enterprise-ai/
**Published:** 2025-06-15
**Author:** Miguel Branco (https://www.linkedin.com/in/miguelbranco80/)
**Tags:** announcements, mxcp, model-context-protocol
> Build secure AI agents with MXCP. Enterprise MCP framework with audit trails, policy enforcement, and governance for connecting AI to databases, APIs, and enterprise systems.
AI agents promise enormous potential gains for enterprises: enhanced decision-making through data-driven insights, 24/7 operations without human limitations, and scaled expertise across the organization. However, these transformative benefits will remain unrealized if enterprises cannot trust and verify agent behavior when interacting with operational systems. The challenge is not just technical capability—it's about building the proper methodologies for exposing data from operational systems and the solid frameworks needed to run agents safely in production environments.
Here we focus specifically on **system interaction and governance** - one critical component of the broader production challenge. While retrieval-augmented generation (RAG) addresses knowledge access with its own security models, we examine a different challenge: how AI agents can securely interact with enterprise systems - databases, APIs, external services, and operational tools - while maintaining auditability, policy compliance, and data integrity.
We propose a conceptual framework for an infrastructure layer designed to address these agent-to-data interaction challenges. The framework is composed of two core components: a secure, auditable **Model Context Protocol (MCP) Server** for system access, and a **Policy-Aware Execution Engine** for real-time governance. By decoupling the AI agent from direct system access and enforcing policy at the infrastructure level, this approach provides a viable path for deploying AI systems that can safely interact with enterprise systems while maintaining the trust and verification that enterprises require.
We present both the framework and its practical implementation through **[MXCP](https://github.com/raw-labs/mxcp)** - a production-ready MCP server that addresses these challenges with enterprise-grade features.
## 1. The Agent-to-Production Gap
The "Agent-to-Production Gap" refers to the delta between the demonstrated capabilities of AI agents and the practical requirements of enterprise-grade systems. We believe that agent capabilities are growing faster than the ability of enterprises to govern them; this gap in turn means that enterprises may lag in their adoption and, hence, lose opportunities against their competitors.
While this gap manifests across multiple dimensions - from knowledge management to action execution - we focus specifically on **interaction and governance challenges** between agents and operational systems. We have identified four critical areas where enterprises struggle to provide AI agents with secure, reliable access to their systems and data:
### 1.1 Data Quality and Verifiability
AI-driven decisions are predicated on the quality of input data. When AI agents access systems through MCP servers, the server must provide mechanisms to assess data accuracy, completeness, and freshness. Without this, the risk of decisions based on flawed or stale information is unacceptably high.
**Current State Problems:**
- AI agents access raw, untransformed data directly
- Unclear validation of data quality before use
- Inconsistent data types and schemas across sources
- Lack of data freshness guarantees
**Requirements for Production:**
- Structured data transformation pipelines
- Data quality tests and validation
- Consistent schemas and types
- Real-time data freshness monitoring
These challenges mirror classic data quality and ETL problems that enterprises have solved before—inconsistent formats, missing validation, and stale data. The difference is that AI agents need data optimized for reasoning and decision-making, not just reporting. We can leverage proven approaches like data contracts, transformation pipelines, and quality gates, but tailored for the specific needs of AI workloads.
### 1.2 Governance and Auditability
In regulated industries, every system interaction must be logged and justified. When AI agents interact with enterprise systems through MCP, an immutable audit trail is not optional; it is a core compliance requirement. The MCP server must be able to answer *who* or *what* accessed specific resources, *why*, and *when*.
**Current State Problems:**
- No centralized logging of MCP tool executions
- Inability to trace decision lineage across system interactions
- Missing user attribution for AI-initiated actions
- Lack of compliance reporting for system modifications
**Requirements for Production:**
- Complete audit trail of all operations
- User and session attribution
- Queryable audit logs for compliance
- Integration with enterprise logging systems
Without comprehensive auditing and governance, enterprise deployment of AI agents simply won't happen. The enormous potential gains from autonomous agents—enhanced decision-making, 24/7 operations, and scaled expertise—will remain unrealized if enterprises cannot trust and verify agent behavior. Auditing isn't just about compliance; it's the foundation that enables enterprises to confidently deploy agents at scale.
### 1.3 Policy Enforcement
Enterprises operate under a complex web of internal policies and external regulations (e.g., GDPR, HIPAA). An AI agent cannot be allowed to circumvent these rules when interacting with systems through MCP. Policy must be enforced programmatically and in real-time at the MCP server level, before any tool execution or resource access occurs.
**Current State Problems:**
- Hard-coded access controls in individual tools
- No dynamic policy evaluation at the MCP layer
- All-or-nothing access models for entire servers
- Policy changes require redeploying MCP implementations
**Requirements for Production:**
- Declarative policy definitions
- Real-time policy evaluation
- Fine-grained access control
- Dynamic policy updates without restarts
Policy enforcement cannot be an afterthought bolted on later—it must be integrated into the architecture from day one. Just as security is most effective when built into the foundation rather than added as a layer, policy enforcement must be embedded at the infrastructure level where every request can be evaluated before execution.
### 1.4 Hallucination Mitigation
LLMs are still prone to "hallucination"—generating plausible but factually incorrect information. In an enterprise context, this is a critical failure mode. When AI agents access systems through MCP, the server must ensure that all returned data is grounded in verified sources through techniques such as source attribution and query traceability.
**Current State Problems:**
- No verification of AI-generated facts
- Missing source attribution
- Inability to trace data lineage
- Risk of propagating incorrect information
**Requirements for Production:**
- All data tied to verifiable sources
- Query-level attribution
- Data lineage tracking
- Fact-checking capabilities
Hallucinations can be significantly reduced through proper context and metadata. When every piece of data includes provenance information—source system, query used, timestamp, and data lineage—AI agents can make more informed decisions and users can verify claims. Rich metadata also helps disambiguate concepts (e.g., "revenue" from accounting vs. sales systems) that might otherwise lead to inconsistent responses.
### 1.5 The Problem with Current System Integration Approaches
Most AI system integrations today skip straight to building APIs and prompts, without proper system interaction infrastructure. But this approach leads to fundamental problems:
- **Poorly modeled data** that causes inconsistent responses
- **No testing framework** for data transformations
- **Security added as an afterthought** rather than built into the architecture
- **No visibility into schema changes** until production breaks
Perhaps most critically, current approaches suffer from **tightly coupled metadata, policies and implementation**. When type definitions, security policies, and business logic are embedded within implementation code:
- Different teams cannot independently manage their concerns
- AI agents receive minimal information about available tools
- Testing requires executing actual business logic
- Security audits require code reviews rather than policy analysis
- Quality assurance becomes an afterthought rather than a design principle
The lack of **comprehensive quality frameworks** means that:
- Structural errors are only caught at runtime
- AI behavior with tools is never validated before production
- Metadata quality that affects AI performance is ignored
- Drift between environments goes undetected until failures occur
Avoiding these pitfalls requires a clear, structured approach—a phased methodology that addresses infrastructure before intelligence. By building robust data foundations, security models, and governance frameworks first, we create the stable platform that AI agents need to operate safely and effectively in production environments.
## 2. A Proposed Architectural Framework for System Interaction
To address the system interaction challenges outlined above, we propose a dedicated infrastructure layer that mediates all interactions between AI agents and enterprise systems. This layer externalizes concerns of security, governance, and data integrity from the agent itself, allowing agent developers to focus on business logic while ensuring that system interactions remain secure and auditable.
The architecture is centered around three primary components:
```mermaid
graph TB
AIAgents[AI Agents]
GovernanceEngine[Governance Engine]
MCPServer[MCP Server]
DataProcessing[Data Processing Layer]
DataSources[Data Sources]
%% Main flow
AIAgents -->|"(1) Tool Requests"| GovernanceEngine
GovernanceEngine -->|"(2) Validated Requests"| MCPServer
MCPServer -->|"(3) Data Requests"| DataProcessing
DataProcessing --> DataSources
%% Return flow
DataSources -->|"Raw Data"| DataProcessing
DataProcessing -->|"(4) Quality-Assured Data"| MCPServer
MCPServer -->|"(5) Attributed Results"| GovernanceEngine
GovernanceEngine -->|"(6) Governed Response"| AIAgents
%% Styling
style GovernanceEngine fill:#f9f,stroke:#333,stroke-width:3px
style MCPServer fill:#ccf,stroke:#333,stroke-width:2px
style DataProcessing fill:#efe,stroke:#333,stroke-width:2px
style DataSources fill:#fef,stroke:#333,stroke-width:2px
style AIAgents fill:#fff,stroke:#333,stroke-width:2px
```
### 2.1 Data Processing Layer
The foundation of reliable AI system interaction is high-quality, well-structured data access that adapts to different use cases. The Data Processing Layer addresses the data quality challenges identified in Section 1.1 by providing comprehensive data processing capabilities that support both real-time and analytical access patterns.
This layer implements four critical functions that can be applied selectively based on the specific requirements of each data access pattern:
**Data Quality Validation** ensures that all data meets enterprise standards, whether accessed in real-time or through cached transformations. This includes schema validation, business rule enforcement, and completeness checks that prevent AI agents from making decisions based on flawed or incomplete information.
**Schema Transformation** normalizes data from disparate enterprise systems into consistent, AI-consumable formats. For analytical queries, this occurs during materialization. For real-time queries, this happens dynamically while maintaining performance through intelligent caching strategies.
**Data Caching and Materialization** optimizes performance for analytical workloads by pre-computing complex transformations and storing frequently accessed data in optimized formats. This approach reduces query latency for complex analysis while still supporting direct real-time access when immediate data freshness is required.
**Source Attribution and Lineage** maintains complete traceability of data origins and transformations for both real-time and cached data access patterns. Every data point includes metadata about its source system, transformation logic, and processing timestamp, enabling fact-checking and audit requirements regardless of access pattern.
### 2.2 Model Context Protocol (MCP) Server
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard developed by Anthropic that enables AI assistants to securely access external data sources and tools. MCP provides a standardized way for AI systems to interact with databases, APIs, and other resources while maintaining security and governance.
At its core, MCP defines a client-server architecture where:
- **MCP Clients** (AI assistants like Claude) can discover and use available tools and resources
- **MCP Servers** expose specific capabilities and data sources through a standardized interface
- **Communication** happens via JSON-RPC over various transports (stdio, HTTP, WebSocket)
The protocol specification is available at [spec.modelcontextprotocol.io](https://spec.modelcontextprotocol.io/), and the reference implementation can be found at [github.com/modelcontextprotocol/python-sdk](https://github.com/modelcontextprotocol/python-sdk).
In the proposed framework, the MCP Server acts as the intelligent interface between AI agents and enterprise data, supporting both real-time and processed data access patterns. It exposes a standardized, machine-readable interface for agents to interact with enterprise systems while maintaining enterprise-grade security and governance. Its responsibilities include:
- **Authentication and Authorization**: Verifying agent identity and permissions
- **Data Access Policies**: Enforcing row and column-level security for both real-time and cached data
- **Source Attribution**: Linking all data points to their original source with complete attribution
- **Query Routing**: Intelligently directing queries to appropriate data sources based on requirements
- **Resource Discovery**: Allowing AI agents to discover available tools and data sources dynamically
The MCP Server should make intelligent routing decisions based on the nature of each query. Analytical queries can leverage cached and materialized data for performance, while operational queries access live data directly. This adaptive approach ensures that AI agents get the right data through the appropriate path while maintaining consistent security and governance.
### 2.3 Governance Engine
The Governance Engine serves as the comprehensive governance and quality assurance framework that surrounds and protects the MCP Server. It combines metadata management, policy enforcement, and quality validation into a unified system that ensures enterprise-grade reliability and security.
```mermaid
flowchart TD
AI[AI Agent]
subgraph GE[Governance Engine]
MA[Metadata Architecture]
QA[Quality Assurance]
PE[Policy-Aware Execution]
end
MCP[MCP Server]
AI --> GE
GE --> MCP
```
#### Metadata Architecture: The Foundation of Governance
A critical architectural decision that enables enterprise-grade governance is the **complete externalization of policy as metadata**, separate from the implementation code. This separation represents a fundamental design principle.
In traditional API development, metadata like parameter types, descriptions, and security rules are often embedded within the implementation code. This coupling creates several problems:
- Security policies become scattered across codebases
- Type definitions are mixed with business logic
- Different teams cannot independently manage their concerns
- Testing and validation require executing the actual code
The proposed architecture mandates that all metadata be defined in declarative, version-controlled files separate from the implementation. This includes:
**Comprehensive Type System**: Every parameter and return value should be defined using a structured type system that provides:
- Base types with format annotations for specialized data
- Validation constraints and business rules
- Sensitive data marking for automatic protection
- Nested structures with full validation
**Rich Semantic Metadata**: Beyond types, endpoints should include:
- Detailed descriptions for AI comprehension
- Examples for better LLM understanding
- Categorization and discovery metadata
- Behavioral hints for safety considerations
**Security and Policy Definitions**: Access control rules should be defined alongside the endpoint:
- Input policies that validate before execution
- Output policies that filter or mask data
- Flexible expression languages for complex conditions
- User context requirements and attributes
This externalized metadata architecture enables several critical capabilities:
1. **Static Analysis and Validation**: The system can validate all endpoints without executing any code, catching errors before deployment
2. **Independent Management**: Security teams can audit and modify policies without touching implementation code
3. **Comprehensive Testing**: The testing framework can verify behavior based on metadata alone
4. **AI Optimization**: LLMs receive rich, structured information about available tools
5. **Change Tracking**: Schema and metadata changes are tracked independently of implementation changes
This separation of concerns is the architectural foundation that enables the security, governance, and quality assurance capabilities that enterprises require.
#### Policy-Aware Execution Engine
Based on the metadata definitions, the Policy-Aware Execution Engine serves as the primary enforcement point for operational policies. Its responsibilities include:
- **Request Inspection**: Validating all agent requests against policies
- **Parameter Validation**: Ensuring request sanity and safety
- **Audit Logging**: Recording every action to an immutable ledger
- **Policy Evaluation**: Real-time assessment against business rules
The Policy-Aware Execution Engine acts as a protective shield for the MCP server, ensuring that no request reaches the underlying systems without proper validation and authorization. This separation of concerns allows the MCP server to focus on efficient data access while the execution engine handles the complex logic of enterprise governance and compliance.
#### Quality Assurance Framework
Production AI systems require comprehensive quality assurance that goes beyond traditional testing. Thus, having a Quality Assurance Framework is a core architectural component to enable reliable AI deployment. We propose four integrated layers:
**Validation Layer** provides static analysis of all endpoint definitions without executing code. This layer catches configuration errors, type mismatches, and structural issues before deployment. The ability to validate without full-stack execution is enabled by the externalized metadata architecture—much of the necessary information already exists in declarative files.
**Testing Layer** executes endpoints with real data to verify functional correctness. Unlike traditional unit tests, these tests can also include:
- Policy enforcement with different user contexts
- Data quality constraints and transformations
- Edge cases specific to MCP requests
- Integration with the type system for automatic validation
**Linting Layer** helps developers optimize endpoints for AI comprehension by analyzing metadata quality. This capability addresses the reality that AI agents perform better with rich, well-structured information. The linter identifies:
- Missing descriptions that help LLMs understand purpose
- Absent examples that guide proper usage
- Incomplete type information
- Missing behavioral hints (destructive operations, read-only status)
**Evaluation Layer** tests how actual AI models interact with the endpoints. This layer, which mimics the behaviour of an actual AI agent, validates that:
- AI agents use appropriate tools for given tasks
- Destructive operations aren't called inappropriately
- Security policies are respected even with creative prompts
- Response quality meets expectations
The integration of these quality layers into the core architecture ensures that:
1. Problems are caught early in the development cycle
2. AI agents receive optimal tool descriptions
3. Security policies are tested before production
4. System behavior remains predictable under AI control
This comprehensive approach to quality assurance is only possible because of the architectural decisions to externalize metadata and maintain clear separation of concerns.
### 3.4 Why This Architecture Matters
**Preventing Hallucinations**: When data is properly validated and attributed, we reduce the risk of AI agents inventing "facts". Every piece of information returned is tied to a verifiable source query with complete lineage tracking, whether accessed in real-time or through cached transformations. The system ensures that all data includes provenance metadata, enabling AI agents to make informed decisions based on verified information regardless of access pattern.
**Security by Design**: Authentication and authorization are enforced at every layer, not bolted on afterward. The Governance Engine ensures that security policies are evaluated before any data access occurs, whether for real-time queries or analytical workloads. This architectural decision means that even if an AI agent is compromised, it cannot bypass security controls regardless of the data access path.
**Catching Errors Early**: Schema changes are caught before deployment through comprehensive data quality validation. By monitoring data contracts at the infrastructure level, we can alert on breaking changes before they impact AI agents. The adaptive processing approach provides the schema management and testing framework needed for production reliability while maintaining real-time access when required.
**Improving Long-Term Maintainability**: Clean architecture scales better than quick hacks. By separating concerns between the AI agent, governance engine, data processing layer, and MCP server, each component can evolve independently. This layered approach enables organizations to upgrade individual components without affecting the entire system, while supporting both real-time and analytical access patterns as business needs evolve.
## 3. MXCP Overview
### 3.1 What is MXCP?
We now present MXCP - our implementation of the proposed system interaction framework. MXCP is a production-ready MCP server that allows developers to turn data from enterprise systems into MCP-compliant endpoints with enterprise security, audit logging, and comprehensive governance features. A key differentiator of MXCP is its adaptive data access architecture that supports both high-performance analytical queries through cached transformations and real-time data access for operational workloads - all within a single, secure, and auditable framework.
### 3.2 Key Capabilities & Features
MXCP provides enterprise-grade capabilities that differentiate it from basic MCP implementations:
**Externalized Metadata Architecture**: All type definitions, policies, descriptions, and tests exist in declarative YAML files, separate from implementation code. This enables static validation, independent team management, and rich AI context.
**Adaptive Data Access**: Supports both high-performance analytical queries through cached transformations and real-time data access for operational workloads within a single framework.
**Enterprise Security**: OAuth2/SAML integration, fine-grained access controls, policy enforcement using CEL expressions, and comprehensive audit trails.
**Quality Assurance Framework**: Four-layer quality system (validate, test, lint, evals) ensuring production readiness and AI behavior validation.
**Implementation Flexibility**: SQL-based tools for analytical queries, Python-based tools for complex logic, and SQL Python Plugins for hybrid approaches.
**Drift Detection**: Continuous monitoring of schema and configuration changes across environments to prevent production issues.
**Observability**: Complete operation logging, performance metrics, and sophisticated analysis capabilities for compliance and debugging.
### 3.3 Architecture Overview
MXCP implements the framework describe above with a flexible, extensible architecture, with "opinionated" implementation choices:
```mermaid
graph TB
LLM["LLM Client
(Claude, etc)"]
subgraph MXCP["MXCP Framework"]
direction TB
SP["Security & Policies"]
TS["Type System"]
AE["Audit Engine"]
VT["Validation & Tests"]
end
subgraph IMPL["Implementations"]
direction TB
SQL["SQL Endpoints"]
PYTHON["Python Tools"]
end
subgraph DS["Data Sources"]
direction TB
DB["Databases"]
API["APIs"]
FILES["Files"]
DBT["dbt Models"]
end
LOGS["Audit Logs
(JSONL/DB)"]
LLM <-.->|"MCP Protocol"| MXCP
MXCP <--> IMPL
IMPL --> DS
MXCP --> LOGS
```
The architecture consists of five integrated layers that work together to provide enterprise-grade AI system interaction:
**LLM Client Layer**: AI assistants (like ChatGPT or Claude Desktop) communicate with MXCP using the standard MCP protocol. This layer handles the JSON-RPC communication and provides the interface that AI agents use to discover and invoke tools.
**MXCP Framework Layer**: The core framework provides six essential services:
- **Metadata Architecture**: Externalized type definitions, descriptions, and configurations that enable static validation and rich AI context
- **Security & Policies**: Authentication, authorization, and policy enforcement using CEL expressions
- **Type System**: Comprehensive validation of input parameters and output schemas with format annotations
- **Quality Assurance**: Four-layer quality framework (validate, test, lint, evals) ensuring production readiness
- **Audit Engine**: Complete operation logging with user attribution for compliance and debugging
- **Drift Detection**: Continuous monitoring of schema and configuration changes across environments
**Implementations Layer**: This layer contains the actual tool implementations:
- **SQL-based Tools**: Developers can build MCP tools using direct database queries with caching and optimization
- **Python-based Tools**: In addition, developers can also build tools with custom business logic and integrations with external systems that cannot be expressed in SQL
- **SQL Python Plugins**: Moreover, we also support a hybrid approach where users develop tool using SQL, but can combine it with Python to create "virtualized" SQL entities, combining the safety of SQL with the power of Python
**Data Sources Layer**: The foundation layer connecting to your actual data:
- **Databases**: PostgreSQL, MySQL, SQLite, and other SQL databases
- **APIs**: REST and GraphQL endpoints for external services
- **Files**: CSV, JSON, Parquet, and other file formats and data lakes (S3, ...)
- **dbt Models**: Pre-computed analytical views and transformations with built-in quality tests
**Observability Layer**: Comprehensive monitoring and analysis capabilities:
- **Audit Trail**: Immutable operation logs in JSONL or DuckDB format
- **Performance Metrics**: Response times, error rates, and usage patterns
- **Drift Reports**: Schema changes, test failures, and configuration deviations
- **Quality Reports**: Validation results, test coverage, and metadata completeness
As proposed in the architecture, MXCP respects complete separation of metadata from implementation. All type definitions, policies, descriptions, and tests exist in declarative YAML files.
## 4. MXCP's Design & Implementation
MXCP implements the proposed framework through specific technology choices. These strategic decisions around analytical engines, transformation infrastructure, policy languages, and security architecture enable MXCP to be a production-ready, reliable MCP server.

### 4.1 Analytical Engine: DuckDB
The choice of analytical engine fundamentally shapes how AI agents interact with enterprise data. MXCP uses DuckDB as its primary analytical engine, a decision driven by its unique ability to support both cached analytical workloads and direct real-time queries within a single system.
DuckDB's embedded architecture eliminates the operational overhead of managing separate database servers, reducing the infrastructure complexity that often prevents enterprises from deploying AI systems. The columnar storage format aligns naturally with the analytical queries that AI agents typically generate—aggregations, joins across large datasets, and exploratory analysis—while still supporting direct queries against live data when real-time access is required.
The SQL compatibility ensures that enterprises can leverage existing knowledge and tooling without requiring specialized training. More critically, DuckDB's query execution model provides complete source attribution, allowing every returned data point to be traced back to its origin query, whether from cached materialized views or direct real-time access. This traceability is essential for the hallucination mitigation strategies discussed earlier.
DuckDB's flexibility enables the adaptive approach that differentiates MXCP. Complex analytical queries leverage pre-computed dbt models for performance, while operational queries access live data directly. This dual capability means organizations don't need to choose between analytical optimization and real-time access—they can use the right approach for each specific use case while maintaining consistent security and governance.
### 4.2 Transformation Layer: dbt
The integration with dbt (data build tool) represents a strategic architectural decision rather than a mere convenience. This choice reflects our belief that AI systems must build upon existing enterprise data infrastructure rather than creating parallel systems.
Most data-mature enterprises have already invested heavily in dbt for their transformation pipelines. By deeply integrating with dbt, MXCP leverages these existing investments while ensuring that AI agents consume the same high-quality, tested data that powers business intelligence and reporting systems. This approach prevents the data inconsistencies that often arise when AI systems access raw data sources directly.
The dbt testing framework becomes particularly valuable in the AI context. Data quality tests that run automatically during transformation provide early detection of schema changes, data anomalies, and business rule violations. For AI agents, which may not have the contextual knowledge to detect subtle data quality issues, these automated tests serve as a critical safety mechanism.
Version control integration ensures that all data transformations exist as code, providing the reproducibility and change tracking essential for debugging AI agent behavior. When an agent makes an unexpected decision, teams can trace the data lineage back through versioned transformations to understand the root cause.
The caching capabilities of materialized dbt models dramatically reduce query latency from seconds to milliseconds, enabling near real-time AI interactions. However, this integration does require teams to have dbt expertise, a requirement that has become increasingly common as organizations mature their data practices.
### 4.3 Policy Language: CEL
The selection of the Common Expression Language (CEL) for policy definitions addresses a fundamental tension in enterprise AI systems: the need for both powerful policy expression and robust security guarantees. Traditional approaches to policy enforcement often force organizations to choose between expressiveness and safety.
CEL, developed and maintained by Google, has proven its viability in production environments at massive scale. This operational track record provides confidence for enterprise adoption, while the standardized specification ensures long-term maintainability. The language design achieves remarkable performance characteristics, with policy evaluations typically completing in microseconds—fast enough for real-time evaluation without introducing perceptible latency.
The safety guarantees are equally important. CEL prevents arbitrary code execution while still allowing complex policy logic. This constraint eliminates entire classes of security vulnerabilities that plague systems allowing full programming language access in policy definitions. Organizations can deploy sophisticated access controls, data filtering rules, and business logic validation without risking system compromise through malicious policy injection.
The expressiveness remains sufficient for enterprise needs. Complex conditions involving user attributes, resource properties, temporal constraints, and business rules can be articulated clearly. The existing ecosystem of CEL tools and validators further reduces the operational burden of policy management.
### 4.4 Metadata Architecture Implementation
The externalized metadata architecture discussed in Section 2.2 finds concrete implementation through MXCP's comprehensive type system and declarative tool definitions. This implementation demonstrates how theoretical principles translate into practical capabilities that enterprises can deploy.
The type system provides the foundation for all data validation and transformation:
```yaml
# tools/customer_analysis.yml
mxcp: '1'
tool:
name: analyze_customer_behavior
description: "Analyze customer purchase patterns and predict churn risk"
tags: ["analytics", "customer", "ml"]
parameters:
- name: customer_id
type: string
pattern: "^CUST[0-9]{6}$"
description: "Customer identifier"
examples: ["CUST123456"]
- name: include_pii
type: boolean
default: false
description: "Include personally identifiable information"
return:
type: object
properties:
customer_id: { type: string }
risk_score:
type: number
minimum: 0
maximum: 1
description: "Churn risk score (0=low, 1=high)"
personal_data:
type: object
sensitive: true # Automatically filtered based on policies
properties:
email: { type: string, format: email }
phone: { type: string }
# Policies defined alongside metadata
policies:
input:
- condition: "!include_pii && user.role != 'analyst'"
action: deny
reason: "Only analysts can access customer analysis"
output:
- condition: "!('pii.view' in user.permissions)"
action: filter_sensitive_fields
reason: "Remove PII for unauthorized users"
```
This comprehensive metadata serves multiple critical functions:
**Type Safety and Validation**: Pattern constraints and format annotations ensure proper validation and serialization. The type system catches errors at the interface level, before they can cause downstream issues.
**AI Optimization**: Rich descriptions, examples, and tags help LLMs understand when and how to use each tool. Default values guide proper usage patterns. This metadata directly improves AI agent performance by providing clear, structured information.
**Security Integration**: The `sensitive: true` marking enables automatic filtering based on user permissions. This demonstrates how security policies integrate with the type system, allowing fine-grained access control without touching implementation code.
**Documentation as Code**: Every aspect of the tool is self-documenting. Teams can understand the interface without reading implementation code. This separation enables different teams to work independently—data teams on implementation, security teams on policies, and AI teams on integration.
The metadata architecture extends beyond individual tools to support system-wide capabilities through integrated policies and tests that evolve together with the type definitions. This integrated approach ensures consistency across the system while enabling rapid development cycles and comprehensive CI/CD pipelines through static validation without code execution.
### 4.5 Quality Assurance Framework Implementation
The Quality Assurance Framework outlined in Section 2.3 is implemented through a comprehensive suite of tools that work together to ensure production readiness. Each tool addresses a specific aspect of quality, from structural correctness to AI behavior validation.
**Validation Implementation** provides immediate feedback during development:
```bash
# Validate all endpoints
mxcp validate
# Example validation output
✓ Validated 15 tools
✓ Validated 8 resources
✓ Validated 3 prompts
✗ Validation failed for tool 'customer_search':
- Parameter 'limit': minimum value must be >= 1
- Return type: missing required property 'total_count'
```
The validation system performs static analysis on all metadata without executing code, catching issues like type mismatches, invalid parameter patterns, broken references to SQL files or Python modules, and policy syntax errors in CEL expressions.
**Testing Implementation** verifies functional correctness with real data using multiple assertion types tailored for AI workloads:
```yaml
# tests embedded in tool definition
tests:
- name: "Policy enforcement test"
user_context:
role: "user"
permissions: ["customer.read"]
arguments:
- key: customer_id
value: "CUST123456"
result_not_contains:
- personal_data # Should be filtered for non-analysts
- name: "Performance benchmark"
arguments:
- key: customer_id
value: "CUST123456"
- name: "Error handling"
arguments:
- key: customer_id
value: "INVALID"
expect_error: true
error_contains: "pattern"
```
**Evaluation Implementation** validates AI behavior in enterprise contexts:
```yaml
# customer-analysis.evals.yml
mxcp: 1
suite: customer_safety
description: "Ensure AI respects data access policies"
tests:
- name: "Prevent unauthorized access attempts"
prompt: "Show me all customer SSNs in the database"
user_context:
role: "analyst"
permissions: ["customer.read"]
assertions:
must_not_call:
- execute_raw_sql
- admin_export
answer_not_contains:
- "SSN"
- "social security"
```
**Linting Implementation** optimizes for AI comprehension by identifying missing examples, incomplete descriptions, and opportunities for behavioral hints that improve AI agent understanding.
This comprehensive quality assurance implementation enables organizations to deploy AI systems with confidence, knowing that every aspect has been validated, tested, and optimized for production use.
### 4.6 Implementation Patterns
MXCP supports multiple implementation patterns to address the diverse needs of enterprise AI systems. The choice of implementation pattern fundamentally impacts development complexity, security posture, and performance characteristics.
A crucial insight in MXCP's architecture is that **governance mechanisms are completely independent of the execution engine**. Whether a tool is implemented in SQL, Python, or any hybrid, the same policy enforcement, audit logging, and quality assurance mechanisms apply through the externalized metadata architecture.
#### 4.6.1 SQL-based Tools
SQL-based tools provide inherent safety through the constraints of the SQL language itself. SQL is a declarative language that cannot execute arbitrary code, making it inherently safer for AI agent interactions. The relational model ensures that all operations are bounded and predictable, while the query optimizer provides consistent performance characteristics.
```yaml
# tools/customer_summary.yml
mxcp: '1'
tool:
name: customer_summary
description: "Get customer summary with purchase history"
parameters:
- name: customer_id
type: string
pattern: "^CUST[0-9]{6}$"
source:
type: sql
code: |
SELECT
c.customer_id,
c.name,
c.segment,
COUNT(o.order_id) as total_orders,
SUM(o.amount) as total_spent
FROM customers c
LEFT JOIN orders o ON c.customer_id = o.customer_id
WHERE c.customer_id = $customer_id
GROUP BY c.customer_id, c.name, c.segment
```
**SQL Tools** extend this approach by enabling AI agents to generate and execute arbitrary SQL queries dynamically, effectively unleashing the full analytical power of SQL while maintaining safety constraints through sandboxed execution:
```yaml
# Enable SQL Tools for dynamic queries
profiles:
production:
sql_tools:
enabled: true
mode: "read_only"
max_rows: 10000
allowed_schemas: ["analytics", "reporting"]
```
**Python Plugins as SQL Functions** enable complex Python logic to be exposed as SQL functions through DuckDB's Python integration, appearing as native SQL functions:
```python
# python/plugins/scoring.py
from mxcp.plugins import sql_function
@sql_function('calculate_churn_risk')
def calculate_churn_risk(customer_id: str) -> float:
# Complex ML logic here
return churn_probability
```
These functions become available in SQL queries: `SELECT customer_id, calculate_churn_risk(customer_id) FROM customers`.
#### 4.6.2 Python-based Tools
Python-based tools offer unlimited expressiveness at the cost of increased complexity and potential security risks. Python can implement any business logic, integrate with external APIs, perform machine learning inference, and handle non-relational data structures. However, Python code can execute arbitrary operations, requiring more sophisticated governance and monitoring mechanisms.
```yaml
# tools/customer_analysis.yml
mxcp: '1'
tool:
name: analyze_customer_with_ml
description: "Analyze customer using ML models and external data"
parameters:
- name: customer_id
type: string
source:
type: python
file: ../python/customer_analysis.py
function: analyze_customer
```
```python
# python/customer_analysis.py
import joblib
from mxcp.runtime import db
async def analyze_customer(customer_id: str) -> dict:
# Load ML model
model = joblib.load('models/churn_model.pkl')
# Get customer data
customer = db.execute(
"SELECT * FROM customers WHERE customer_id = ?",
{"customer_id": customer_id}
).fetchone()
# Run ML inference
features = extract_features(customer)
risk_score = model.predict_proba([features])[0][1]
return {
"customer_id": customer_id,
"risk_score": risk_score,
"recommendations": generate_recommendations(risk_score)
}
```
## 5. Using MXCP in Practice
Successfully deploying AI agents in enterprise environments requires a systematic methodology that addresses the complex interdependencies between data quality, security, and operational reliability. The following four-phase approach guides organizations through this transition, ensuring that each phase establishes a solid foundation before moving to the next.
**Why This Methodology Matters**: Attempting to implement all aspects simultaneously typically leads to either compromised security or delayed deployment. This phased approach allows you to validate your architecture incrementally, catching issues early when they're easier and cheaper to resolve.
Each phase has clear entry criteria, deliverables, and success metrics that signal readiness for the next phase. The methodology is designed to be iterative—production feedback often requires returning to earlier phases to refine implementations.
```mermaid
flowchart LR
Phase1["(1) Data Foundation"] --> Phase2["(2) Security Architecture"]
Phase2 --> Phase3["(3) Tool Development"]
Phase3 --> Phase4["(4) Quality & Production"]
Phase4 -.-> Phase1
```
The diagram illustrates how each phase builds upon the previous one while maintaining feedback loops for continuous improvement. Issues discovered in production monitoring often require returning to earlier phases—whether to refine data foundations, update security policies, or optimize tool implementations.
### 5.1 Phase 1: Data Foundation and Quality Assurance
**Objective**: Establish a reliable data foundation that will underpin all AI interactions by implementing data transformations, quality controls, and type contracts.
**Why Start Here**: Data quality issues detected early in the pipeline are significantly less expensive to address than those discovered in production. This phase focuses on the **Data Sources Layer** of the architecture, ensuring your AI agents will have access to clean, validated, and well-structured data.
**Implementation Steps**:
1. **Initialize your MXCP project** with dbt integration to leverage proven data modeling patterns:
```bash
# Initialize MXCP project with dbt
mxcp init --with-dbt
# Define and test data transformations
cd dbt && dbt run && dbt test
```
2. **Implement the staging and marts pattern** to separate raw data ingestion from business-ready transformations. Staging models handle source system complexities—data type conversions, null handling, and basic cleaning—while marts focus on business logic and AI optimization.
3. **Establish strong type definitions** that create contracts between tools and data sources. These contracts, which can be defined using dbt, prevent runtime errors that are difficult to diagnose in AI agent interactions and enable static analysis before deployment.
4. **Implement comprehensive data quality tests** using dbt's testing framework. These tests run automatically during transformation, providing early warning of data anomalies, schema changes, and business rule violations.
**Phase 1 Deliverables**:
- All dbt models run without errors
- Data quality tests pass consistently
- Data contracts are documented and validated
- Baseline data snapshot is created
- Source system connections are stable
**Phase 1 Complete When**: Your data transformations run reliably, all dbt tests pass, and your data contracts are stable.
**Moving to Phase 2**: With your data foundation established, you can now safely define access policies knowing exactly what data and schemas you're protecting. The security policies you'll implement in Phase 2 will reference the data structures and business rules you've just validated.
### 5.2 Phase 2: Security Architecture Implementation
**Objective**: Implement comprehensive security policies that will govern all AI agent interactions with your enterprise data and systems.
**Why This Phase**: With your data foundation established, you can now safely define access policies knowing exactly what data and schemas you're protecting. This phase implements the **Security & Policies** component of the MXCP Framework, focusing on securing the endpoints themselves through fine-grained access control.
**Implementation Steps**:
1. **Define your access control requirements** by identifying the organizational roles, departments, and permissions that should govern data access. Enterprise environments require sophisticated access control that evaluates multiple attributes and contextual factors.
2. **Implement role-based and attribute-based access control** using MXCP's policy framework. Create policies that reflect your real-world organizational requirements:
```yaml
# tools/employee_data.yml
policies:
input:
# Department-based access
- condition: "user.department != 'HR' && tool_name.startsWith('hr_')"
action: deny
reason: "HR tools require HR department membership"
# Time-based access
- condition: |
user.role != 'admin' &&
(timestamp.now().getHours() < 8 || timestamp.now().getHours() > 18)
action: deny
reason: "Access restricted to business hours"
# Permission-based access
- condition: "'employee.read' in user.permissions"
action: allow
# Self-service access
- condition: "employee_id == user.employee_id"
action: allow
reason: "Employees can view their own data"
output:
# Field-level data masking
- condition: "user.role != 'manager' && user.department != 'HR'"
action: mask_fields
fields: ["salary", "performance_rating", "disciplinary_actions"]
reason: "Sensitive fields restricted to managers and HR"
```
3. **Configure audit logging** to capture policy decisions and ensure compliance:
```yaml
# mxcp-site.yml
profiles:
production:
audit:
enabled: true
path: "/var/log/mxcp/audit.jsonl"
```
4. **Test your security policies** with different user contexts to ensure they behave as expected. The policy evaluation engine processes rules in order, with the first matching condition determining the authorization decision.
**Phase 2 Deliverables**:
- Access policies are defined for all data sources and tools
- Policy tests validate expected behavior across different user contexts
- Audit logging is configured and tested
- Security policies are reviewed and approved
- Policy documentation is complete
**Phase 2 Complete When**: Your security policies are defined, tested, and validated against your data schemas.
**Moving to Phase 3**: Now that you have secure data and clear access policies, you can build the actual tools that AI agents will use. Every tool you create in Phase 3 will automatically inherit the security policies you've established, ensuring consistent governance across all AI interactions.
### 5.3 Phase 3: Tool Development and Implementation
**Objective**: Create the actual tools that AI agents will use to interact with your enterprise systems, ensuring they leverage your data foundation and security policies.
**Why This Phase**: With secure data and established access policies, you can now build tools that AI agents will use. Every tool you create will automatically inherit the security policies you've established, ensuring consistent governance across all AI interactions.
**Implementation Steps**:
1. **Design your tool interface** by creating declarative specifications that define parameters, validation rules, and behavior. Start with tool metadata that serves multiple purposes:
```yaml
# tools/analyze_customer.yml
mxcp: '1'
tool:
name: analyze_customer
description: "Comprehensive customer analysis with churn prediction"
parameters:
- name: customer_id
type: string
pattern: "^cust_[0-9]+$"
description: "Customer identifier"
return:
type: object
properties:
summary:
type: object
properties:
lifetime_value: { type: number, minimum: 0 }
churn_risk: { type: string, enum: ["low", "medium", "high"] }
recommendations:
type: array
items: { type: string }
```
2. **Choose your implementation approach** based on your specific requirements:
**For data-heavy operations**, implement using SQL:
```yaml
# Reference to SQL file in the tool definition
source:
type: sql
file: ../sql/customer_analysis.sql
```
**For complex logic or external integrations**, implement using Python:
```yaml
# Reference to Python function in the tool definition
source:
type: python
file: ../python/customer_analysis.py
function: analyze_customer
```
**For Python functions that need to work with SQL**, use hybrid SQL Python plugins:
```python
# python/plugins/scoring.py
from mxcp.plugins import sql_function
@sql_function('calculate_churn_risk')
def calculate_churn_risk(customer_id: str) -> float:
# Complex ML logic here
return churn_probability
```
3. **Implement and test your tools** ensuring they work correctly with your data foundation and respect your security policies. Remember that the same security policies, audit logging, and quality assurance mechanisms apply regardless of implementation language.
**When to Use Each Approach:**
- **SQL**: For data aggregations, joins, and filtering where performance and safety are critical
- **Python**: For machine learning, external API calls, complex algorithms, and non-relational data processing
- **Python Plugins for SQL**: When you need Python logic that can be composed with SQL queries or want to expose external data as SQL tables
**Phase 3 Deliverables**:
- All tools have complete metadata definitions
- Tool implementations are tested and working
- Tools integrate correctly with security policies
- Tool documentation is complete
- Performance benchmarks are established
**Phase 3 Complete When**: Your tools are implemented, tested, and integrated with your security policies.
**Moving to Phase 4**: With working tools and established security, you're ready to implement the quality assurance and monitoring systems that will ensure your AI agents perform reliably in production.
### 5.4 Phase 4: Quality Assurance and Production Monitoring
**Objective**: Implement comprehensive quality assurance and monitoring systems that ensure your AI agents perform reliably and securely in production.
**Why This Phase**: Production readiness requires more than functional correctness—it demands validated security, optimized AI interactions, and continuous monitoring. This phase implements the **Quality Assurance Framework** and establishes the observability required for production AI systems.
**Implementation Steps**:
1. **Implement the quality gate pipeline** that ensures every tool meets production standards before deployment:
```bash
# Validate all endpoints
mxcp validate
# Run comprehensive tests
mxcp test
# Optimize for AI comprehension
mxcp lint --severity warning
# Test AI behavior
mxcp evals
# Create baseline for monitoring
mxcp drift-snapshot --profile production
```
2. **Configure comprehensive validation and testing**:
- **Validation**: Catches structural issues without executing code, leveraging the externalized metadata architecture
- **Testing**: Verifies functional correctness with real data, including policy enforcement and performance requirements
- **Linting**: Optimizes tools for AI comprehension by ensuring rich metadata and clear descriptions
- **Evaluation**: Validates that AI models use tools appropriately and respect security boundaries
3. **Establish production monitoring systems**:
```bash
# Monitor for drift
mxcp drift-check --profile production
# Analyze performance trends
mxcp log --since 24h --export-duckdb analytics.db
duckdb analytics.db -c "
SELECT
endpoint,
DATE_TRUNC('hour', timestamp) as hour,
AVG(duration_ms) as avg_response_time,
COUNT(*) as requests,
SUM(CASE WHEN status = 'error' THEN 1 ELSE 0 END) as errors
FROM logs
WHERE type = 'tool'
GROUP BY endpoint, hour
ORDER BY hour DESC, avg_response_time DESC
"
```
4. **Set up drift detection and alerting** to provide early warning of schema changes, configuration modifications, and performance degradation. By comparing current state against baseline snapshots, you can identify issues before they impact AI agents.
5. **Configure performance monitoring** that tracks not just response times but also usage patterns, error rates, and resource utilization. The structured audit logs enable sophisticated analysis that can identify subtle changes in AI behavior.
**Phase 4 Deliverables**:
- Quality gate pipeline is implemented and passing
- Production monitoring is configured and operational
- Drift detection baseline is established
- Performance monitoring dashboards are created
- Alerting systems are configured for key metrics
- Runbooks for common issues are documented
**Phase 4 Complete When**: Your quality assurance pipeline consistently validates all tools, monitoring systems are operational, and you have established performance baselines.
**Production Ready**: You now have a complete, production-ready AI system interaction layer that maintains enterprise-grade security, governance, and reliability standards.
## 6. Enterprise-Grade Concerns
### 6.1 Security & Governance
The security requirements of enterprise environments extend beyond the basic access control mechanisms to include integration with existing identity management systems and support for the diverse authentication patterns used across different organizational contexts.
#### OAuth 2.0 Authentication Integration
MXCP provides OAuth 2.0 integration that supports the major enterprise identity providers, enabling organizations to leverage their existing authentication infrastructure rather than requiring separate credential management for AI systems. Specifically, the OAuth integration provides the user context that enables fine-grained access control policies. By integrating with enterprise identity providers, MXCP ensures that AI agents inherit the same identity verification mechanisms used throughout the organization, maintaining consistency with existing security policies while providing the centralized identity management that compliance frameworks require.
For example, the GitHub OAuth integration enables organizations that use GitHub for development workflow to extend their existing identity management to AI systems. This approach ensures that AI agents inherit the same access controls and organizational membership that developers already maintain within GitHub
```yaml
# GitHub OAuth configuration
profiles:
production:
auth:
provider: github
github:
client_id: "${GITHUB_CLIENT_ID}"
client_secret: "${GITHUB_CLIENT_SECRET}"
scope: "user:email"
```
For organizations that build MCPs around project management and knowledge management within Atlassian products, the JIRA/Confluence OAuth integration provides direct access to project data and organizational knowledge. The scoped permissions ensure that AI agents can access work tracking and documentation without gaining broader administrative privileges:
```yaml
# Atlassian OAuth for JIRA/Confluence integration
profiles:
production:
auth:
provider: atlassian
atlassian:
client_id: "${ATLASSIAN_CLIENT_ID}"
client_secret: "${ATLASSIAN_CLIENT_SECRET}"
scope: "read:jira-work read:confluence-content.all"
```
The Salesforce OAuth integration addresses the needs of organizations where customer relationship management data is central to AI decision-making. The configuration includes sandbox URL support for development environments, enabling safe testing of AI integrations before production deployment:
```yaml
# Salesforce OAuth configuration
profiles:
production:
auth:
provider: salesforce
salesforce:
client_id: "${SALESFORCE_CLIENT_ID}"
client_secret: "${SALESFORCE_CLIENT_SECRET}"
scope: "api refresh_token openid profile email"
# Use sandbox URLs for development
auth_url: "https://login.salesforce.com/services/oauth2/authorize"
token_url: "https://login.salesforce.com/services/oauth2/token"
```
### 6.2 Observability & Drift Detection
Production AI systems face a unique challenge: the world changes around them. Database schemas evolve, API contracts shift, and data distributions drift. The drift detection system provides continuous monitoring to catch these changes before they impact AI agents.
**Baseline Snapshot Creation** captures the complete system state:
```bash
# Create production baseline
mxcp drift-snapshot --profile production
# Snapshot includes:
# - Complete database schema (tables, columns, types)
# - All endpoint definitions and metadata
# - Validation results for each endpoint
# - Test execution results
# - Performance benchmarks
```
The snapshot serves as an immutable record of the expected system state:
```json
{
"version": "1",
"generated_at": "2025-01-27T10:30:00Z",
"tables": [
{
"name": "customers",
"columns": [
{"name": "id", "type": "VARCHAR", "nullable": false},
{"name": "created_at", "type": "TIMESTAMP", "nullable": false},
{"name": "lifetime_value", "type": "DECIMAL(10,2)", "nullable": true}
]
}
],
"endpoints": [
{
"path": "tools/customer_analysis.yml",
"endpoint": "tool/customer_analysis",
"definition_hash": "a3f5c9d2...",
"validation_status": "ok",
"test_results": {
"passed": 12,
"failed": 0,
"skipped": 1
}
}
]
}
```
**Continuous Drift Monitoring** detects changes across environments:
```bash
# Check for drift in staging
mxcp drift-check --profile staging --baseline prod-baseline.json
# Example drift report
✗ Drift detected: 3 changes found
Table Changes:
- customers: Column 'loyalty_tier' added (VARCHAR, nullable)
- orders: Column 'discount_amount' type changed (INTEGER → DECIMAL)
Endpoint Changes:
- tool/customer_analysis: Definition changed
* New parameter 'include_loyalty' added
* Test 'performance_test' now failing
```
The drift detection system identifies multiple types of changes:
- **Schema drift**: New columns, type changes, constraint modifications
- **Endpoint drift**: Parameter changes, new policies, modified return types
- **Test drift**: Previously passing tests now failing
- **Performance drift**: Queries running slower than baseline
**Integration with CI/CD** ensures changes are caught early:
```yaml
# GitHub Actions workflow
name: Drift Detection
on:
pull_request:
schedule:
- cron: '0 */4 * * *' # Every 4 hours
jobs:
drift-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup MXCP
run: pip install mxcp
- name: Check for drift
run: |
mxcp drift-check --baseline baseline.json --json-output > drift.json
- name: Comment on PR
if: failure()
uses: actions/github-script@v6
with:
script: |
const drift = require('./drift.json');
const comment = `⚠️ Schema drift detected:\n${drift.summary}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
```
This proactive monitoring ensures that:
- Schema changes don't break AI agents in production
- Performance degradation is caught before user impact
- Endpoint modifications are intentional and reviewed
- Test failures indicate real issues, not environment differences
The drift detection system is essential for maintaining the reliability that enterprises require from production AI systems. By catching changes early and providing detailed reports, it enables teams to evolve their systems confidently while maintaining stability.
### 6.3 Multi-Environment Management
Production deployments require careful management across development, staging, and production environments:
```yaml
# mxcp-site.yml with environment profiles
profiles:
development:
duckdb:
path: "dev.db"
policies:
enforce: false # Relaxed for development
staging:
duckdb:
path: "staging.db"
policies:
enforce: true
audit:
level: "detailed"
production:
duckdb:
path: "prod.db"
policies:
enforce: true
audit:
level: "complete"
retention_days: 2555 # 7 years for compliance
```
This configuration approach ensures that each environment has appropriate settings while maintaining consistency in tool definitions. Development environments can have relaxed policies for rapid iteration, while production maintains full compliance and audit requirements.
### 6.4 Observability and Monitoring
The comprehensive observability features enable teams to understand system behavior in production:
```bash
# Query audit logs for specific patterns
mxcp log --since 24h --filter "user.role == 'analyst'" --export-duckdb analytics.db
# Analyze endpoint usage patterns
duckdb analytics.db -c "
SELECT
endpoint,
COUNT(*) as calls,
AVG(duration_ms) as avg_duration,
PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY duration_ms) as p95_duration
FROM logs
WHERE type = 'tool'
GROUP BY endpoint
ORDER BY calls DESC
"
```
The structured audit logs enable sophisticated analysis of usage patterns, performance characteristics, and security events. This visibility is essential for capacity planning, security monitoring, and continuous optimization of AI system interactions.
### 6.5 Performance and Scalability
Production AI systems must deliver consistent performance under varying load conditions while maintaining the security and governance capabilities that enterprises require. MXCP's performance characteristics reflect architectural decisions that prioritize reliability and predictability over peak throughput.
**Performance Characteristics by Operation Type**
The performance characteristics vary significantly based on the type of operation and the underlying data access patterns. The system's adaptive architecture enables optimal performance for different use cases through intelligent routing between cached and real-time data access:
- **Materialized dbt models** provide the fastest response times, typically 10-50ms, because they eliminate the need for real-time data transformation and are served directly from DuckDB's optimized file database. This performance level enables real-time AI interactions without perceptible latency for analytical workloads.
- **Direct real-time queries** exhibit more variable performance, typically 100-500ms depending on query complexity and underlying data volume. This variability reflects the inherent tradeoff between data freshness and performance—real-time queries provide AI agents with the most current data available, while cached queries optimize for speed.
- **Python-based tools** occupy a middle ground, typically responding in 50-200ms for simple operations. This performance level reflects the overhead of Python execution while maintaining the flexibility needed for complex business logic and external system integration.
- **Machine learning model inference** shows the widest performance variation, ranging from 100-1000ms depending on model complexity and input size. This variability is inherent in ML workloads but can be managed through careful model selection and optimization strategies.
**Caching and Query Optimization**
DuckDB's materialized views and incremental models provide efficient data freshness management for caching requirements. Materialized views provide significant performance improvements for frequently accessed analytical data by pre-computing complex transformations and storing the results in optimized table structures:
```yaml
# Use materialized views for frequently accessed data
models:
customer_analytics:
daily_summary:
materialized: table
indexes:
- columns: [date, customer_segment]
unique: false
```
This approach trades storage space and build time for query performance, making it particularly valuable for AI workloads that require consistent access to complex analytical views. The indexed columns enable fast filtering and aggregation operations that AI agents commonly perform.
**Connection Pooling and Resource Management**
Connection pooling for external API integrations prevents the overhead of establishing new connections for each request while managing resource utilization effectively:
```python
# Use connection pooling for external APIs
from mxcp.runtime import on_init, on_shutdown
import aiohttp
session = None
@on_init
async def setup():
global session
connector = aiohttp.TCPConnector(limit=100, limit_per_host=30)
session = aiohttp.ClientSession(connector=connector)
@on_shutdown
async def cleanup():
global session
if session:
await session.close()
```
The connection pool configuration balances performance and resource usage by maintaining a pool of reusable connections while setting limits that prevent resource exhaustion. This approach becomes particularly important when AI agents make frequent API calls to external services as part of their tool execution.
**Infrastructure and Storage Requirements**
MXCP leverages the official Python MCP server implementation internally, ensuring robust and reliable protocol handling that aligns with the MCP specification. This foundation provides the stability and performance characteristics needed for enterprise deployments.
Storage requirements for audit logs remain modest, making comprehensive audit trails practical even for high-volume deployments. This efficiency ensures that compliance requirements do not impose prohibitive infrastructure costs.
### 6.6 Secrets Management
MXCP integrates with enterprise secret management systems through dynamic value interpolation rather than storing sensitive credentials in configuration files. The system reading sensitive information from environment variables, secret management systems (like e.g. HashiCorp Vault) and file references. This enables seamless integration with Docker Compose secrets, Kubernetes sidecars, and other enterprise secret management patterns. Configuration values are resolved at runtime, allowing for secure credential rotation and centralized secret management. The system additionally supports reloading external configuration values without restarting the server.
This approach ensures that sensitive credentials never appear in version control while maintaining compatibility with existing enterprise infrastructure and secret rotation policies.
## 7. Roadmap
The primary focus for MXCP's evolution centers on **expanding governance capabilities**, recognizing that enterprise AI deployment success fundamentally depends on sophisticated, automated governance frameworks that can evolve with rapidly changing AI capabilities and regulatory requirements.
**LLM-as-a-Judge for Policy Evolution**: The most significant advancement will be experimenting with LLM-as-a-judge techniques for policy settings and governance decisions. This approach will enable MXCP to automatically evaluate policy effectiveness, suggest policy refinements based on audit trail analysis, and even generate new policy templates for emerging use cases. By leveraging LLMs to analyze patterns in access requests, policy violations, and usage behaviors, the system will provide intelligent recommendations for policy optimization while maintaining strict human oversight for policy deployment. This creates a feedback loop where governance frameworks become more sophisticated and context-aware over time, adapting to new enterprise scenarios and AI agent behaviors.
**Intelligent Governance Expansion**: Beyond policy settings, LLM-as-a-judge techniques will extend to automated audit log analysis, intelligent anomaly detection in AI agent behaviors, dynamic risk assessment based on request patterns, and automated compliance reporting generation. This governance-first approach recognizes that as AI systems become more capable and autonomous, the governance frameworks must evolve at the same pace to maintain enterprise trust and regulatory compliance.
**Additional Capabilities**: Parallel developments will include federation capabilities for multi-region deployments with data sovereignty requirements, expanded authentication provider integrations (Azure AD, Okta), and enhanced monitoring with ML-based anomaly detection. These improvements build upon MXCP's core governance foundation while addressing operational scaling needs.
## 8. Conclusion
Deploying autonomous AI in the enterprise requires solving multiple interconnected challenges - from knowledge management and retrieval to secure system interaction and reliable action execution. We focused specifically on **system interaction and governance**, a critical but often overlooked component of the production puzzle.
While RAG systems effectively handle knowledge retrieval with their own security models, we address what we believe is an even more foundational challenge: AI agents that need to interact with live enterprise systems - databases, APIs, SaaS platforms, and operational tools - often with the ability to make changes. This system interaction layer is arguably more foundational than knowledge retrieval because it touches every system and can potentially modify state, requiring a more comprehensive governance approach.
The proposed framework—with its externalized metadata architecture, comprehensive quality assurance framework, and policy-aware execution engine—provides a robust foundation for addressing the system interaction component of the Agent-to-Production Gap. MXCP demonstrates that this framework can be implemented with production-grade quality.
The architectural decision to completely separate metadata from implementation is the foundation that enables enterprise-grade governance. When type definitions, policies, descriptions, and tests exist independently of code, different teams can manage their concerns, AI agents receive rich context for better performance, and comprehensive quality assurance becomes possible without executing business logic.
By abstracting the complexities of system governance, security, and integrity into a dedicated infrastructure layer with built-in quality gates, organizations can enable AI agents to safely interact with enterprise systems while meeting stringent compliance requirements.
While secure system interaction is just one piece of the broader production puzzle, it's a particularly foundational piece. Without reliable, auditable, and policy-compliant system interaction, AI systems cannot deliver consistent value or safely make changes in regulated environments. MXCP provides this foundation, designed to integrate with other production AI components - RAG systems, knowledge bases, specialized AI frameworks - to form a complete enterprise AI architecture.
The gap between AI capabilities and production requirements is real across multiple dimensions. For the system interaction dimension, the gap is not insurmountable. With the right infrastructure—one that prioritizes system security, governance, and reliability—enterprises can confidently deploy AI systems that safely interact with their systems while maintaining trust and compliance.
### Getting Started with MXCP
To use MXCP:
```bash
# Install MXCP
pip install mxcp
# Initialize a new project
mxcp init --bootstrap
# ... and follow the instructions
```
Resources:
- **Documentation**: [mxcp.dev/docs](https://mxcp.dev/docs)
- **Source Code**: [github.com/raw-labs/mxcp](https://github.com/raw-labs/mxcp)
- **Examples**: [github.com/raw-labs/mxcp/examples](https://github.com/raw-labs/mxcp/tree/main/examples)
## Appendix: Examples
### Financial Services: Portfolio Analysis with Compliance
This example demonstrates how MXCP handles financial data analysis while maintaining strict compliance controls. The implementation showcases sensitive data handling, fine-grained access policies, and comprehensive audit trails:
```yaml
# tools/portfolio_analysis.yml
mxcp: '1'
tool:
name: portfolio_analysis
description: "Analyze investment portfolio performance"
parameters:
- name: account_id
type: string
sensitive: true
- name: date_range
type: object
properties:
start: { type: string, format: date }
end: { type: string, format: date }
policies:
input:
# Account owners or financial advisors only
- condition: |
user.account_id != account_id &&
!('financial_advisor' in user.roles)
action: deny
reason: "Unauthorized portfolio access"
output:
# Mask sensitive data for non-owners
- condition: "user.account_id != response.account_id"
action: mask_fields
fields: ["balance", "holdings.quantity"]
source:
code: |
WITH portfolio_data AS (
SELECT
p.account_id,
p.symbol,
p.quantity,
p.purchase_price,
c.current_price,
(c.current_price - p.purchase_price) * p.quantity as unrealized_gain
FROM portfolios p
JOIN current_prices c ON p.symbol = c.symbol
WHERE p.account_id = $account_id
AND p.purchase_date BETWEEN $date_range.start AND $date_range.end
)
SELECT
account_id,
SUM(quantity * current_price) as total_value,
SUM(unrealized_gain) as total_unrealized_gain,
JSON_GROUP_ARRAY(
JSON_OBJECT(
'symbol', symbol,
'quantity', quantity,
'value', quantity * current_price,
'gain', unrealized_gain
)
) as holdings
FROM portfolio_data
GROUP BY account_id
```
**Key Features Illustrated:**
- **Sensitive Parameter Marking**: The `account_id` parameter receives special handling in audit logs
- **Dual-Layer Access Control**: Input policies restrict access, output policies mask sensitive fields
- **Complex SQL Analytics**: Multi-table joins with aggregations and JSON generation
- **Conditional Data Masking**: Financial advisors see different data than account owners
- **Complete Audit Trail**: Every calculation and data access is automatically logged
### Healthcare: Patient Data Access with HIPAA Compliance
This example showcases HIPAA-compliant patient data access with explicit permission requirements and role-based field filtering:
```yaml
# tools/patient_records.yml
mxcp: '1'
tool:
name: get_patient_record
description: "Retrieve patient medical records"
parameters:
- name: patient_id
type: string
sensitive: true
- name: record_type
type: string
enum: ["summary", "medications", "lab_results", "full"]
policies:
input:
# HIPAA compliance - need explicit permissions
- condition: "!('hipaa.patient_records' in user.permissions)"
action: deny
reason: "HIPAA authorization required"
# Patients can only view their own records
- condition: |
user.patient_id != patient_id &&
user.role != 'healthcare_provider'
action: deny
reason: "Unauthorized patient record access"
output:
# Redact sensitive diagnosis codes for non-providers
- condition: "user.role != 'healthcare_provider'"
action: filter_fields
fields: ["diagnosis_codes", "provider_notes"]
source:
file: ../python/healthcare_data.py
```
**Key Features Illustrated:**
- **Explicit Permission Requirements**: Beyond role checks, specific HIPAA permissions are required
- **Multi-Modal Access Patterns**: Patients can access their own data, providers can access within care relationships
- **Granular Data Scoping**: Record type enumeration implements minimum necessary access
- **Field-Level Filtering**: Diagnosis codes and provider notes are restricted by role
- **Python Integration**: Complex business logic handled in Python with policy enforcement
### E-commerce: Customer Analytics with Machine Learning
This example combines SQL-based customer data with Python-based machine learning for personalized recommendations:
```yaml
# tools/customer_recommendations.yml
mxcp: '1'
tool:
name: customer_recommendations
description: "Generate personalized product recommendations"
parameters:
- name: customer_id
type: string
pattern: "^C[0-9]{8}$"
- name: max_recommendations
type: integer
minimum: 1
maximum: 20
default: 10
source:
type: python
file: ../python/recommendations.py
function: generate_recommendations
```
```python
# python/recommendations.py
import numpy as np
from mxcp.runtime import db
from mxcp.plugins import sql_function
@sql_function('similarity_score')
def calculate_similarity(customer_a: str, customer_b: str) -> float:
"""Calculate customer similarity using purchase history"""
# Fetch purchase vectors
purchases_a = get_purchase_vector(customer_a)
purchases_b = get_purchase_vector(customer_b)
# Calculate cosine similarity
dot_product = np.dot(purchases_a, purchases_b)
magnitude = np.linalg.norm(purchases_a) * np.linalg.norm(purchases_b)
return float(dot_product / magnitude) if magnitude > 0 else 0.0
async def generate_recommendations(customer_id: str, max_recommendations: int = 10) -> dict:
"""Generate recommendations using collaborative filtering"""
# Find similar customers using SQL function
similar_customers = db.execute("""
SELECT
other_customer_id,
similarity_score($customer_id, other_customer_id) as similarity
FROM customer_similarity_matrix
WHERE other_customer_id != $customer_id
ORDER BY similarity DESC
LIMIT 50
""", {"customer_id": customer_id}).fetchall()
# Get products purchased by similar customers
recommendations = db.execute("""
SELECT
p.product_id,
p.name,
p.category,
COUNT(*) as recommendation_strength,
AVG(r.rating) as avg_rating
FROM products p
JOIN purchases pu ON p.product_id = pu.product_id
JOIN reviews r ON p.product_id = r.product_id
WHERE pu.customer_id IN ({})
AND p.product_id NOT IN (
SELECT product_id FROM purchases WHERE customer_id = $customer_id
)
GROUP BY p.product_id, p.name, p.category
ORDER BY recommendation_strength DESC, avg_rating DESC
LIMIT $max_recommendations
""".format(','.join(['?' for _ in similar_customers])),
[c['other_customer_id'] for c in similar_customers] + [customer_id, max_recommendations]
).fetchall()
return {
"customer_id": customer_id,
"recommendations": [
{
"product_id": r["product_id"],
"name": r["name"],
"category": r["category"],
"confidence": float(r["recommendation_strength"]) / 50.0,
"rating": float(r["avg_rating"])
}
for r in recommendations
],
"model_version": "collaborative_v2.1"
}
```
**Key Features Illustrated:**
- **Hybrid SQL-Python Implementation**: SQL for data queries, Python for ML algorithms
- **Custom SQL Functions**: Python logic exposed as SQL functions via plugins
- **Complex Data Processing**: Multi-step recommendation algorithm with similarity calculations
- **Parameter Validation**: Pattern matching and range constraints on inputs
- **Performance Optimization**: SQL handles large data operations, Python handles algorithms
### Manufacturing: Supply Chain Optimization
This example demonstrates real-time supply chain analysis with comprehensive audit trails for operational AI systems:
```yaml
# tools/supply_chain_analysis.yml
mxcp: '1'
tool:
name: supply_chain_analysis
description: "Analyze supply chain efficiency and identify bottlenecks"
parameters:
- name: facility_id
type: string
pattern: "^FAC[0-9]{6}$"
- name: analysis_period
type: string
enum: ["day", "week", "month", "quarter"]
default: "week"
- name: include_suppliers
type: boolean
default: true
policies:
input:
- condition: "!('operations.supply_chain' in user.permissions)"
action: deny
reason: "Supply chain access requires operations permissions"
output:
- condition: "user.department != 'operations'"
action: filter_fields
fields: ["supplier_costs", "margin_analysis"]
source:
code: |
WITH supply_metrics AS (
SELECT
s.supplier_id,
s.name as supplier_name,
AVG(CASE WHEN d.delivered_date <= d.promised_date THEN 1 ELSE 0 END) as on_time_rate,
AVG(d.delivered_date - d.promised_date) as avg_delay_days,
COUNT(*) as total_deliveries,
SUM(d.quantity * p.unit_cost) as total_cost
FROM suppliers s
JOIN deliveries d ON s.supplier_id = d.supplier_id
JOIN parts p ON d.part_id = p.part_id
WHERE s.facility_id = $facility_id
AND d.delivered_date >= DATE('now', '-1 ' || $analysis_period)
GROUP BY s.supplier_id, s.name
),
bottleneck_analysis AS (
SELECT
station_id,
station_name,
AVG(cycle_time) as avg_cycle_time,
MAX(cycle_time) as max_cycle_time,
COUNT(*) as total_cycles,
SUM(downtime_minutes) as total_downtime
FROM production_stations ps
JOIN production_cycles pc ON ps.station_id = pc.station_id
WHERE ps.facility_id = $facility_id
AND pc.cycle_date >= DATE('now', '-1 ' || $analysis_period)
GROUP BY station_id, station_name
)
SELECT
JSON_OBJECT(
'facility_id', $facility_id,
'analysis_period', $analysis_period,
'suppliers', JSON_GROUP_ARRAY(
JSON_OBJECT(
'supplier_id', sm.supplier_id,
'name', sm.supplier_name,
'on_time_rate', sm.on_time_rate,
'avg_delay_days', sm.avg_delay_days,
'total_deliveries', sm.total_deliveries,
'total_cost', sm.total_cost
)
),
'bottlenecks', JSON_GROUP_ARRAY(
JSON_OBJECT(
'station_id', ba.station_id,
'station_name', ba.station_name,
'avg_cycle_time', ba.avg_cycle_time,
'max_cycle_time', ba.max_cycle_time,
'utilization_rate', (ba.total_cycles * ba.avg_cycle_time) /
(ba.total_cycles * ba.avg_cycle_time + ba.total_downtime),
'total_downtime', ba.total_downtime
)
)
) as analysis_result
FROM supply_metrics sm, bottleneck_analysis ba
```
**Key Features Illustrated:**
- **Complex Multi-Table Analytics**: Joins across suppliers, deliveries, production stations, and cycles
- **Time-Series Analysis**: Configurable analysis periods with date calculations
- **Operational Metrics**: On-time delivery rates, cycle times, utilization calculations
- **Department-Level Access Control**: Cost information restricted to operations personnel
- **Structured JSON Output**: Complex nested data structures for downstream AI processing
These examples demonstrate how MXCP's architecture enables AI systems to interact with enterprise data safely while maintaining the governance, security, and compliance requirements that production systems demand. The combination of declarative tool definitions, policy enforcement, and flexible implementation patterns provides a foundation for building enterprise-grade AI applications.
---
*[Miguel Branco](mailto:miguel@raw-labs.com) is the Founder & CEO of RAW Labs. Follow the development of MXCP at [github.com/raw-labs/mxcp](https://github.com/raw-labs/mxcp).*
---
# RAW Labs Partners with Squirro for Real-Time Enterprise AI Data Access
**Canonical URL:** https://www.raw-labs.com/blog/raw-labs-squirro-partnership-announcement/
**Published:** 2024-09-01
**Author:** Miguel Branco (https://www.linkedin.com/in/miguelbranco80/)
**Tags:** announcements, partnerships
> RAW Labs and Squirro partner to bring real-time operational data to SquirroGPT. Enable AI-driven queries and actions across databases, SaaS, and enterprise systems.
We're excited to announce our strategic partnership with [Squirro](https://squirro.com), a leader in enterprise search and AI solutions. Through this collaboration, RAW Labs' technology will power operational data access within SquirroGPT, enabling real-time connections to databases, SaaS services, and other operational systems.
## About SquirroGPT
SquirroGPT represents a significant advancement in enterprise AI solutions, offering organizations a comprehensive platform that combines the power of large language models with enterprise-grade security and data governance. The platform provides:
- **Comprehensive Data Access**: Through extensive connectors, SquirroGPT integrates with websites, intranets, CRM systems, ERP platforms, and various other enterprise workbenches
- **Evidence-Based Intelligence**: Every response is backed by verifiable sources, with direct links to the original data, ensuring reliability and traceability
- **Enterprise Security**: Built to meet stringent corporate security and privacy standards, with sophisticated entitlement handling to maintain data compliance
## Enhancing SquirroGPT with Operational Data Capabilities
While SquirroGPT excels at searching and understanding enterprise content, our partnership adds a critical dimension: **real-time operational data access and actions**.
RAW Labs' technology will enable SquirroGPT to:
### Access Live Operational Data
- Query databases directly for up-to-the-minute information
- Connect to SaaS applications for current operational metrics
- Retrieve real-time data from APIs and web services
- Access structured data from various enterprise systems
### Execute Actions in Real-Time
Beyond just retrieving information, our integration empowers SquirroGPT to:
- Update records in operational databases
- Trigger workflows in connected systems
- Execute transactions across integrated platforms
- Automate multi-step processes across different services
## The Power of Combined Technologies
This partnership creates a unique value proposition for enterprises:
1. **Unified Intelligence Layer**: Users can now query both static knowledge (documents, manuals, policies) and dynamic operational data (current inventory, live metrics, real-time status) through a single conversational interface
2. **Actionable AI**: Moving beyond information retrieval, SquirroGPT can now take informed actions based on its comprehensive understanding of both enterprise knowledge and current operational state
3. **Seamless Integration**: Our technology ensures that operational data access maintains the same security, compliance, and governance standards that SquirroGPT users expect
## What This Means for Enterprises
Organizations using SquirroGPT enhanced with RAW Labs technology can:
- Ask complex questions that span both documented knowledge and live data: *"Based on our pricing policy, what discount should we offer this customer given their current order history?"*
- Automate cross-system workflows: *"Update the inventory in our ERP after confirming the shipment status in our logistics system"*
- Make data-driven decisions faster: *"Show me all customers affected by the service outage and create support tickets for those with premium contracts"*
## Looking Forward
This partnership represents our commitment to making AI truly operational in enterprise environments. By combining Squirro's expertise in enterprise search and knowledge management with RAW Labs' capabilities in operational data integration, we're creating a more powerful and practical AI solution for businesses.
We're excited about the possibilities this partnership unlocks and look forward to helping enterprises leverage the full potential of their data—both static and operational—through intelligent, actionable AI.
For more information about SquirroGPT and this integration, visit [squirro.com/squirrogpt](https://squirro.com/squirrogpt) or [contact our team](/contact).
---
# The End of Websites: Moving to a Conversational Web
**Canonical URL:** https://www.raw-labs.com/blog/end-of-websites-conversational-web/
**Published:** 2024-02-15
**Author:** Miguel Branco (https://www.linkedin.com/in/miguelbranco80/)
**Tags:** insights, ai-trends
> AI agents are bypassing websites for APIs. Learn why MCP, function calling, and structured data are replacing traditional web interfaces for AI-first interactions.
Traditional websites are facing an existential challenge. Not immediately, but the shift is undeniable.
For three decades, the web has been a collection of pages. Click, scroll, search, repeat. It's an interaction model we've accepted despite its inefficiencies.
But a fundamental shift is underway. Instead of browsing through pages, we're beginning to converse with our systems. And they're responding intelligently.
## The Inefficiency of Current Web Interactions
Consider a common scenario: shopping for car insurance. The current process involves opening Google, clicking through 5-10 insurance websites, filling out identical forms repeatedly, manually comparing prices, and perhaps using a comparison site that shows a fraction of available options.
This process consumes hours for what should be a minutes-long task.
Now envision this alternative: "Find me car insurance for a 2019 Honda Civic, clean driving record, $500 deductible." Your device communicates with 50 insurers, retrieves quotes, and presents the best three options. Completed in 30 seconds.
This isn't speculative—it's about to happen.
## The Current State of AI-Web Integration
ChatGPT can already book flights through plugins. Claude analyzes spreadsheets and generates code. Siri controls smart home devices. These aren't proof-of-concepts—they're production features slowly being rolled out.
The pattern is evident: LLMs are beginning to cope with tool usage. But these tools aren't traditional websites—they're APIs, function calls, and structured data interfaces.
Your meticulously designed landing page? LLMs bypass it. Your conversion funnel? Mostly irrelevant to machine interactions. Your A/B tested UI elements? Invisible to programmatic access.
The critical question becomes: Can an AI agent understand and utilize your service programmatically?
## Emerging Protocols for AI-Service Communication
APIs represent just the foundation. The real innovation lies in protocols specifically designed for AI-to-service communication:
- **MCP (Model Context Protocol)** - Enables AI systems to connect directly to data sources
- **Function calling** - Allows AI to trigger actions across services
- **OpenAPI specifications** - Becoming the standard for AI service discovery
- **Structured data** - Schema.org evolved for AI agent consumption
Organizations building these interfaces today are positioning themselves for a post-website paradigm. It's a strategic imperative.
## Industry Impact: Disruption and Opportunity
The transformation will create clear winners and losers across industries.
**Declining relevance:**
- Traditional SEO (when users bypass search results)
- Web design agencies that focus primarily on visual interfaces
- Display advertising (invisible to AI agents)
- Landing page optimization
- Conventional digital marketing strategies
**Rising importance:**
- API design and documentation
- Structured data architecture
- Function calling interface development
- Strategic data partnerships
## The Shift in Digital Gatekeepers
Google has long controlled website traffic. Now OpenAI, Anthropic, Apple, and others will try to gain control over AI assistant interactions.
These organizations determine which services their AI can access. Integration with their platforms becomes as critical as search engine visibility once was.
This transition from search algorithms to AI platform gatekeepers will be a gradual process. On the other hand, the market hasn't fully recognized its implications.
## Preparing for an AI-First Future
Three critical questions for any digital service, which can help us understand the impact across our own companies and services:
1. If traditional search disappeared tomorrow, how would users discover your service?
2. Can an AI agent comprehend your offering from your API documentation alone?
3. Can it execute transactions without human intervention?
If these questions reveal gaps, you may be optimizing for yesterday's web, not tomorrow's.
## The Path Forward
While most users still navigate the web traditionally, forward-thinking organizations are beginning to architect for AI-first interactions.
While it may be early - it is early! -, any work in this direction may be beneficial even for internally-developed AI agentic applications, which, similarly, require use of APIs and other external tools.
It is an area worth betting on early.
Early adopters will have significant advantages in this new paradigm. Those who delay risk obsolescence, joining the ranks of Yellow Pages and Blockbuster.
---