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.1.tar.gz (113.8 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.1-py3-none-any.whl (113.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mxcp-0.1.1.tar.gz
  • Upload date:
  • Size: 113.8 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.1.tar.gz
Algorithm Hash digest
SHA256 3ec7d0947694f98a2a87538f1856c9c8a4f68e19df0ec1b83ca7a89a1349d1d1
MD5 717494380365fe1c7654b585d9373820
BLAKE2b-256 80c6be10734b43ee393a06b351eb5ee8e3c5131b232800e79701c6f6a47d9311

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mxcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 113.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58827947cc2c41c972c4efa94e3f94e5f4a825e987e355e8d2692ef26bdc741c
MD5 173343d60edd6e6754e8e128cb1efb13
BLAKE2b-256 86cb0a8a434518ed66f6a19e092f290e4bc4957887c7a5bf354475ead85e362f

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