Skip to main content

MCP Blueprint

License CI

Build domain-oriented MCP servers without writing Python code for every project.

MCP Blueprint is a lightweight framework for creating Model Context Protocol (MCP) servers from configuration files, SQL queries and metadata instead of custom application code. Instead of exposing a generic SQL interface, it exposes a curated set of business-oriented tools that are easier for LLMs to understand, safer to use and simpler to maintain.


Why?

Many existing MCP database servers expose generic tools such as execute_sql() or query_database(). Although powerful, they require the LLM to understand the schema, write efficient SQL, know relationships between tables and respect business rules — a risky approach for production environments.

MCP Blueprint follows a different philosophy:

Don't expose the database. Expose the domain.

The LLM should ask for information, not write SQL.


Key features

  • Domain-oriented — expose curated business tools, not a generic SQL interface.
  • Configuration-driven — build MCP servers from YAML and SQL, without writing Python code for every project.
  • Multi-engine — one framework for PostgreSQL, MySQL, MariaDB, Oracle, ClickHouse, SQL Server, SQLite and DuckDB, with reference DBA packs already available.
  • Safe by default — read-only SQL, injection-proof parameters, writes only behind an explicit opt-in.
  • Built-in observability — structured JSON logging, an audit trail with trace_id, optional Prometheus metrics.
  • Per-tool caching — optional in-memory cache with a TTL configurable per tool (cache.ttl) and a server-wide default (server.default_ttl).
  • Production-ready — connection pooling, caching, parameter validation and error handling; Docker and Streamable HTTP support.
  • Reusable packs — independent, versionable tool collections.

Getting started

Install the framework and run the reference server:

uv sync --all-extras --dev
uv run blueprint serve --config config --transport stdio

Or run it in Docker with a bundled PostgreSQL over Streamable HTTP:

docker compose up --build

The server is then available at http://localhost:8000/mcp.

See docs/installation.md, docs/quickstart.md and docs/docker.md for the full walkthrough.


Architecture

                 +----------------+
                 |    LLM Agent   |
                 +--------+-------+
                          |
                     MCP Protocol
                          |
                  +-------+-------+
                  | MCP Blueprint |
                  +-------+--------+
                          |
          +---------------+----------------+
          |               |                |
      Tool Metadata     SQL Loader     Logging
          |               |
          +-------+-------+
                  |
            Target database

The framework is responsible for creating MCP tools, parameter validation, database connections, logging, error handling and optional caching. Application developers only provide configuration files.


Reference packs

This repository ships ready-to-use administration packs and one canonical domain pack.

The six server DBA packspacks/pg-dba (PostgreSQL 14+), packs/mysql-dba (MySQL 8+), packs/oracle-dba (Oracle 12c+), packs/clickhouse-dba (ClickHouse 23+), packs/sqlserver-dba (SQL Server 2016+) and packs/mariadb-dba (MariaDB 10.4+) — expose the same 13 tools: three KPI dashboards (operational, performance and security, each returning ok/warning/error rows) plus ten detail tools (version, users, connections, sizes, largest objects, replication, tuning, slow queries, maintenance, index health).

Two embedded packs target file databases that need no server:

  • packs/sqlite-dba (SQLite 3, standard library, 6 tools) — its largest-objects tool reads the dbstat virtual table and falls back to a pure sqlite_schema query when the module is unavailable (via per-tool fallback_sql/fallback_on).
  • packs/duckdb-dba (DuckDB, optional duckdb extra, 4 tools).

packs/sakila is the recommended first example of a domain pack: a DVD rental store chatbot that recommends films, checks stock and reviews customer accounts by name, without ever writing SQL. In an internal "model demotion" experiment this verticalized design reached 98% fully-correct answers across four small local models versus 0.711 for a generic read-only SQL agent; see docs/sakila.md.

Engine selection happens once in config: database.engine picks both the adapter and the packs that load (e.g. postgresql loads pg-dba and sakila, sqlite loads sqlite-dba). The aliases postgres, mssql and sql_server are also accepted.

The four server engines are optional: install their drivers with uv sync --extra oracle --extra clickhouse --extra sqlserver (or --extra databases for all three); MariaDB reuses the MySQL driver and needs no extra; DuckDB needs --extra duckdb; SQLite needs nothing. Bring the server databases up with docker compose -f docker-compose.databases.yaml up -d.

The packs do not expose SQL execution — only curated DBA operations, usable with least-privilege monitoring users (e.g. pg_monitor on PostgreSQL).

template/pack is the minimal skeleton for authoring a new pack, and examples/customers is a small customer pack; see docs/pack_development.md and template/README.md.


Tool design

An MCP server should look like a REST API, not like a SQL console: each tool represents a meaningful operation and hides all SQL complexity.

# Instead of
execute_sql(...)

# expose
get_customer()
search_customer()
get_database_sizes()
get_performance_kpis()

Beyond the tool API, MCP Blueprint owns the operational concerns — SQL safety (read-only by default, explicit opt-in for writes, injection-proof parameters), structured logging and telemetry — so pack authors never have to implement them; see the security model, logging, audit and tracing and Prometheus metrics.


Project structure

mcp-blueprint/
    blueprint/     # the framework
    config/        # server, database, logging, metrics YAML
    packs/         # the reference packs (8 DBA + sakila)
    examples/      # small example packs and client configs
    template/      # skeleton for authoring new packs
    docs/
    tests/

Each pack is self-contained: tools, SQL and metadata only, with the engine declared once in pack.yaml. No Python code is required to create a new tool.


Documentation


Long-term vision

MCP Blueprint aims to become for MCP what REST frameworks became for HTTP APIs: developers describe their domain, and an MCP server is assembled from reusable packs rather than developed from scratch.


License

Released under the Apache License 2.0.

Download files

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

Source Distribution

mcp_blueprint-0.3.0.tar.gz (876.9 kB view details)

Uploaded Source

Built Distribution

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

mcp_blueprint-0.3.0-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

Details for the file mcp_blueprint-0.3.0.tar.gz.

File metadata

  • Download URL: mcp_blueprint-0.3.0.tar.gz
  • Upload date:
  • Size: 876.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_blueprint-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9e0d91cde2f7e1d4b934d65fc93a8da52ba33f14bb99444ba152bbeec0154d22
MD5 fc358420a3e4af44f5ffbfa711023f60
BLAKE2b-256 75c9e0c0791cf237eccc62377d94b0b3f1720b3a28e1855381b59e9e1afbd014

See more details on using hashes here.

File details

Details for the file mcp_blueprint-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_blueprint-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 55.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_blueprint-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffe823a90d86a21dfd6d6f6e8845c35a99a95c9b3bfa86fb03f12600505095ca
MD5 4d6db066d7b8ab69539d244f5ed9c858
BLAKE2b-256 49376b5b619b4ea7a322bc110491b2e3fc3c6bca3dac77556355707e42831196

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

This release

0.3.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page