Skip to main content

RAW Model Context Protocol

Project description

MXCP: Instantly Serve Your Operational Data to LLMs โ€” Safely

Python 3.11+ License

Transform your data into AI-ready interfaces in minutes, not months

โœจ Why MXCP?

MXCP (Model eXecution + Context Protocol) is a developer-first tool that bridges the gap between your operational data and AI applications. It lets you:

  • ๐Ÿš€ Go from data to AI in minutes โ€” Define interfaces in YAML + SQL, serve instantly
  • ๐Ÿ”’ Keep control of your data โ€” Run locally, with full observability and type safety
  • ๐ŸŽฏ Build production-ready AI tools โ€” Combine real-time data, caching, and business logic
  • ๐Ÿ› ๏ธ Use familiar tools โ€” DuckDB for execution, dbt for modeling, Git for versioning

๐Ÿš€ Quick Start

# Install globally
pip install mxcp

# Install with Vault support (optional)
pip install "mxcp[vault]"

# Or develop locally
git clone https://github.com/raw-labs/mxcp.git && cd mxcp
python -m venv .venv && source .venv/bin/activate
pip install -e .

Try the included Earthquakes example:

cd examples/earthquakes
mxcp serve

๐Ÿ’ก Key Features

1. Declarative Interface Definition

# tools/summarize_earthquakes.yml
mxcp: "1.0.0"
tool:
  name: summarize_earthquakes
  description: "Summarize earthquakes for a given date"
  parameters:
    - name: date
      type: string
      format: date
      description: "Date to summarize earthquakes for"
  return:
    type: object
    properties:
      summary:
        type: string
        description: "Summary of earthquakes for the date"
  source:
    code: |
      SELECT 'Summary for ' || $date || ': ' || COUNT(*) || ' earthquakes' AS summary
      FROM earthquakes
      WHERE event_date = $date
  • Type-safe โ€” Strong typing for LLM safety and schema tracing
  • Fast restart โ€” Quick server restarts for development
  • dbt integration โ€” Directly use your dbt models in endpoints

2. Powerful Data Engine

  • DuckDB-powered โ€” Run instantly, with no infrastructure
  • Rich integrations โ€” PostgreSQL, Parquet, CSV, JSON, HTTP, S3, and more
  • Full SQL support โ€” Joins, filters, aggregations, UDFs

3. Production-Ready Features

  • dbt integration โ€” Use your data models directly
  • Git-based workflow โ€” Version control and collaboration
  • Validation tools โ€” Type checking, SQL linting, and testing
  • Drift detection โ€” Monitor schema and endpoint changes across environments

๐Ÿ› ๏ธ Core Concepts

Tools, Resources, Prompts

Define your AI interface using MCP (Model Context Protocol) specs:

  • Tools โ€” Functions that process data and return results
  • Resources โ€” Data sources and caches
  • Prompts โ€” Templates for LLM interactions

Project Structure

your-project/
โ”œโ”€โ”€ mxcp-site.yml    # Project configuration
โ”œโ”€โ”€ tools/           # Tool definitions
โ”œโ”€โ”€ resources/       # Data sources
โ”œโ”€โ”€ prompts/         # LLM templates
โ””โ”€โ”€ models/          # (Optional) dbt transformations & caches

CLI Commands

mxcp serve           # Start local MCP server
mxcp list            # List all endpoints
mxcp validate        # Check types, SQL, and references
mxcp test            # Run endpoint tests
mxcp query           # Execute SQL queries
mxcp init            # Initialize new project
mxcp dbt-config      # Configure dbt integration
mxcp dbt             # Run dbt commands
mxcp drift-snapshot  # Create drift detection baseline
mxcp drift-check     # Check for schema and endpoint drift
mxcp log             # Query audit logs

๐Ÿ”Œ LLM Integration

MXCP implements the Model Context Protocol (MCP), making it compatible with:

  • Claude Desktop โ€” Native MCP support
  • OpenAI-compatible tools โ€” Via MCP adapters
  • Custom integrations โ€” Using the MCP specification

For specific setup instructions, see:

๐Ÿ“š Documentation

๐Ÿค Contributing

We welcome contributions! See our development guide to get started.

๐Ÿง  About

MXCP is developed by RAW Labs, combining the best of:

  • dbt's modular data modeling
  • DuckDB's speed and connectors
  • Python MCP official server
  • Modern AI-native workflows

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mxcp-0.1.0.tar.gz (109.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mxcp-0.1.0-py3-none-any.whl (108.2 kB view details)

Uploaded Python 3

File details

Details for the file mxcp-0.1.0.tar.gz.

File metadata

  • Download URL: mxcp-0.1.0.tar.gz
  • Upload date:
  • Size: 109.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for mxcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e89f66ff77ca6e9590722f2f35b6c915359bb6b90be7f719951d61c047f0b49f
MD5 6f70ec4205ae30e51040781be52ab029
BLAKE2b-256 39e5c60f35cdb501981980ff2951a32c775281dbe44201bf3d6731e890552dcc

See more details on using hashes here.

File details

Details for the file mxcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mxcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 108.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for mxcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c454c9cb73070a9316ac993e522bb6ed6a30866f38ff9bfc422f2a2091868d3c
MD5 d28afb7dcacff31620980fa20127d3ed
BLAKE2b-256 bd40a67c3007b4bca2d5acd46332dd177e791d9f634f9f18ca2c0e919975ca2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page