Skip to main content

duckquery-mcp

An MCP server that exposes a locally-running DuckQuery backend to MCP clients (Claude Code, Cursor, Codex). Start DuckQuery first (desktop app, Docker, or uvicorn main:app --port 48001); this server auto-discovers it.

Run

uvx duckquery-mcp            # zero-install
# or: pipx run duckquery-mcp

Env:

  • DUCKQUERY_API_BASE — explicit backend URL (e.g. http://127.0.0.1:48001). Optional; auto-discovered otherwise (runtime.json, then probes 48001/8000/8001).
  • DUCKQUERY_MCP_MODEread-only | normal (default) | full.

Add to a CLI

Claude Code:

claude mcp add duckquery -- uvx duckquery-mcp

Cursor / Codex (mcp.json):

{
  "mcpServers": {
    "duckquery": {
      "command": "uvx",
      "args": ["duckquery-mcp"],
      "env": { "DUCKQUERY_MCP_MODE": "normal" }
    }
  }
}

Claude Desktop — add the same mcpServers block to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "duckquery": {
      "command": "uvx",
      "args": ["duckquery-mcp"]
    }
  }
}

Tools

High-level tools (query, the AI agent tools below, discover, add sources, configure LLM, transform, export) plus a generic duckquery_request passthrough. Safety mode gates which tools are exposed:

The AI tools all call the backend's unified Agent Engine (POST /api/ai/agent/run, one thin tool per mode), replacing the removed single-purpose LLM services:

  • ask_agent (mode=data_qa) — conversational data agent. Runs bounded, read-only probe queries — inspecting schemas, verifying real column values, and dry-running row-capped SELECTs — over local tables and, when you pass attach_databases, attached MySQL/PostgreSQL/SQLite/DuckDB tables, before answering. Any returned sql is a draft; the agent never executes writes.
  • generate_sql (mode=generate_sql) — NL → an EXPLAIN-validated SQL draft (not executed).
  • repair_sql (mode=repair_sql) — error doctor: failing SQL + error → a fix.
  • explain_sql (mode=explain_sql) — plain-language explanation of a statement.
  • suggest_chart (mode=suggest_chart) — a chart spec for a result set.

All five are read-tier tools — exposed in every safety mode — and never execute writes.

  • read-only — hides all mutating tools; non-GET duckquery_request calls are hard-blocked (confirm cannot override).
  • normal (default) — mutating tools are exposed, but changing tables, saving connections, importing data, running mutating SQL, and non-GET duckquery_request calls each require confirm=true.
  • full — bypasses the MCP confirmation gates above; backend safeguards still apply.

The AI-settings tools (configure_llm, test_llm_provider) are write-tier: hidden in read-only, and in normal mode they take the same confirm=true parameter as every other write tool.

Download files

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

Source Distribution

duckquery_mcp-0.3.0.tar.gz (89.8 kB view details)

Uploaded Source

Built Distribution

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

duckquery_mcp-0.3.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: duckquery_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 89.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for duckquery_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b2b135bd48caf285ee7571560478041f72239f94be4f184706151ed6abf2d8ce
MD5 c6793a18990920e942ac5dc309f1f8f7
BLAKE2b-256 32ecc42359a49ef7b292a80af82c94f719c6f17cdade626798ce2d167c99c809

See more details on using hashes here.

File details

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

File metadata

  • Download URL: duckquery_mcp-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for duckquery_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39471c324ffcce6c8c2cf7fe4e5f49a10dd2d54b7b49f8fa2d5a29150640e68e
MD5 0e36b1dec075a1a0e1a3404f5eaf33ab
BLAKE2b-256 2c51501ab3f1e51501ffe1e7aa9ffffc7e362b0ad5a87ac59a34b14bc1bcf968

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.1

2 files

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

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