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

Uploaded Python 3

File details

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

File metadata

  • Download URL: duckquery_mcp-0.3.1.tar.gz
  • Upload date:
  • Size: 90.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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 duckquery_mcp-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8bf8de9cb57bb2bbefa224fd776c14f7d3c0a99587a69fd86f076d986fff80af
MD5 f4f395dbd4e40279c4d70b2387be4b19
BLAKE2b-256 3373b2c5c2b48f451db758eb24260fdab80e5b72dada372eda13cad6f837f6e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: duckquery_mcp-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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 duckquery_mcp-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f5163d74b2e9af0879ed28f9944259871c82f9daa5c198155c2a301504b2efd
MD5 678e880f41d3776f6f4e36da6f20be89
BLAKE2b-256 2bd09a6be26dcbc64e0d43d8dc3dfdd8b7616f3d8e83ed4e7f6aa1439007e4bd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 files

0.3.0

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