Deterministic SQL compiler for AI agents. Your agent stops guessing SQL.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
The semantic safety layer for agentic database workflows. Boyce connects LLMs to live database context with built-in safety rails.
Named for Raymond F. Boyce, co-inventor of SQL (1974) and co-author of Boyce-Codd Normal Form (BCNF).
AI agents querying databases without proper context generate unreliable SQL β working from incomplete schemas, inferring column names, guessing join paths. Boyce gives agents the structured database intelligence they need to generate correct, safe SQL every time β through three interconnected systems:
| Layer | What it does |
|---|---|
| SQL Compiler | ask_boyce β NL β StructuredFilter β deterministic SQL. Zero LLM in the SQL builder. Same inputs, same SQL, byte-for-byte, every time. |
| Database Inspector | query_database / profile_data β Live Postgres/Redshift adapters let your agent see real schema and real data distributions before writing a single filter. |
| Query Verification | Pre-flight EXPLAIN loops on every generated query. Bad SQL is caught at planning time, not at 2am in your on-call rotation. |
Why does this matter? β The Null Trap: Your AI Agent's SQL Is Correct. The Answer Is Still Wrong.
Requires Python 3.10+
From source:
After installing, run boyce init to configure your MCP host automatically:
The wizard detects Claude Desktop, Cursor, Claude Code, and JetBrains (DataGrip, IntelliJ, etc.), and writes the correct config block for each.
Developing from source? The repo includes a setup script:
The fastest path is boyce init β it detects your MCP host and writes the config automatically:
Or configure manually. There are two setup paths depending on your host:
If you're using Claude Desktop, Cursor, Claude Code, Codex, Cline, Windsurf, JetBrains (DataGrip,
IntelliJ), or any MCP-compatible host, you do not need to configure an LLM provider for Boyce.
The host's own model handles reasoning β Boyce supplies the schema context and deterministic SQL
compiler via get_schema and ask_boyce. Only BOYCE_DB_URL is needed (and even that is optional).
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
Cursor (.cursor/mcp.json in project root):
If you're using the CLI (boyce ask), HTTP API, or a non-MCP client (e.g., the VS Code
extension), configure Boyce's internal query planner with your LLM provider:
Boyce supports any LLM provider available through LiteLLM: Anthropic, OpenAI, Ollama (local), vLLM (local), Azure, Bedrock, Vertex, Mistral, and more.
BOYCE_DB_URL is optional on both paths. Without it, Boyce runs in schema-only mode β SQL
generation still works; EXPLAIN pre-flight and live query tools return "status": "unchecked".
| Variable | When needed | Example | Purpose |
|---|---|---|---|
BOYCE_PROVIDER | Path 2 only (CLI/HTTP/non-MCP) | anthropic | LiteLLM provider name |
BOYCE_MODEL | Path 2 only (CLI/HTTP/non-MCP) | claude-sonnet-4-6 | Model ID passed to LiteLLM |
ANTHROPIC_API_KEY | When using Anthropic | sk-ant-... | Anthropic credentials |
OPENAI_API_KEY | When using OpenAI | sk-... | OpenAI credentials |
BOYCE_DB_URL | Optional (either path) | postgresql://user:pass@host:5432/db | asyncpg DSN β enables EXPLAIN pre-flight + live query tools |
BOYCE_HTTP_TOKEN | Path 2 HTTP API only | my-secret-token | Bearer token for boyce serve --http |
BOYCE_STATEMENT_TIMEOUT_MS | Optional | 30000 | Per-statement timeout in ms (default: 30s) |
| Tool | Description |
|---|---|
ingest_source | Parse a SemanticSnapshot from dbt manifest, dbt project, LookML, DDL, SQLite, Django, SQLAlchemy, Prisma, CSV, or Parquet. |
ingest_definition | Store a certified business definition β injected automatically at query time. |
get_schema | Return full schema context + StructuredFilter format docs. Used by MCP hosts so the host LLM can construct queries without a Boyce API key. |
ask_boyce | Full NL β SQL pipeline: query planner (LiteLLM) β deterministic kernel β NULL trap check β EXPLAIN pre-flight. |
validate_sql | Validate hand-written SQL β EXPLAIN pre-flight, Redshift lint, NULL risk β without executing. |
query_database | Execute a read-only SELECT against the live database. Write operations rejected at two independent layers. |
profile_data | Null %, distinct count, min/max for any column β surface data quality issues before they affect query results. |
check_health | Operational health check β DB connectivity, snapshot freshness, actionable fix commands. Call when queries fail unexpectedly. |
Dialect support: redshift, postgres, duckdb, bigquery
Redshift safety rails (safety.py): Automatic linting for LATERAL, JSONB, REGEXP_COUNT, lookahead regex patterns, and numeric cast rewrites for Redshift 1.0 (PG 8.0.2).
10 parsers: dbt manifest, dbt project, LookML, SQLite, DDL, CSV, Parquet, Django, SQLAlchemy, Prisma.
The ingest_source tool accepts a SemanticSnapshot JSON dict. Minimal example:
See boyce/tests/live_fire/mock_snapshot.json for a complete field/entity example.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/boyce)<a href="https://allmcps.com/mcp/boyce"><img src="https://allmcps.com/api/badge/boyce?style=directory" alt="Boyce on AllMCPs" /></a>