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_MODE—read-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 passattach_databases, attached MySQL/PostgreSQL/SQLite/DuckDB tables, before answering. Any returnedsqlis a draft; the agent never executes writes.generate_sql(mode=generate_sql) — NL → anEXPLAIN-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-GETduckquery_requestcalls are hard-blocked (confirmcannot override).normal(default) — mutating tools are exposed, but changing tables, saving connections, importing data, running mutating SQL, and non-GETduckquery_requestcalls each requireconfirm=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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2b135bd48caf285ee7571560478041f72239f94be4f184706151ed6abf2d8ce
|
|
| MD5 |
c6793a18990920e942ac5dc309f1f8f7
|
|
| BLAKE2b-256 |
32ecc42359a49ef7b292a80af82c94f719c6f17cdade626798ce2d167c99c809
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39471c324ffcce6c8c2cf7fe4e5f49a10dd2d54b7b49f8fa2d5a29150640e68e
|
|
| MD5 |
0e36b1dec075a1a0e1a3404f5eaf33ab
|
|
| BLAKE2b-256 |
2c51501ab3f1e51501ffe1e7aa9ffffc7e362b0ad5a87ac59a34b14bc1bcf968
|