MXCP: Serve Secure, SQL-Based LLM Tools from Your dbt + DuckDB Stack

(First off, a big apology if this isn’t appropriate; I’m sharing/announcing below an open source tool we’ve built on top of dbt.)

MXCP (Model eXecution Context Protocol) lets you expose governed, testable, MCP servers directly from your dbt + DuckDB environment—optimized for fast, local serving and enterprise-grade control.

Unlike typical “SQL agents,” MXCP gives you full control:

  • :writing_hand: Write custom SQL or Python logic —not just expose dbt models
  • :brick: Integrates cleanly with dbt: your models become stable foundations for tools
  • :high_voltage: Uses DuckDB as the runtime engine—fast, embeddable, no server required
  • :shield: Enforces policies and contracts using CEL (mask fields, block access, require freshness)
  • :locked_with_key: Supports auth (GitHub, API keys, Vault), audit logging, and structured metadata
  • :robot: Outputs MCP-compatible tool specs—connects seamlessly to Claude Desktop or your own agent

Quick start:

  1. pip install mxcp
  2. mxcp init --bootstrap to scaffold an MXCP project, including dbt +DuckDB integration
  3. Run mxcp serve; your first API is ready for LLMs
  4. Define additional MCP tools in YAML + SQL, referencing your dbt models
  5. Add optional policies, test cases, etc

We built it for our own needs: building MCP servers that give you strict control, governance, and performance—all on top of the tools we already use.

:backhand_index_pointing_right: Try it at https://mxcp.dev

:thread: Ask questions, share feedback, and if helpful, star us on GitHub!