Dory is an AI-native SQL client for humans and agents.
Dory is a SQL workspace where humans can query, explore, and visualize data, and where AI agents can safely work with databases through MCP.
Unlike a plain database MCP server that only sends query results back to a chat, Dory turns agent work into editable SQL workspaces: SQL tabs, result sets, charts, saved queries, and execution context can all be opened, inspected, modified, and continued by humans.
Use Dory as your everyday SQL client, or as the database execution layer for agents like Claude Code, Codex CLI, and other MCP-compatible tools.
π Try Live Demo Β β’ Β πΊ Install via Homebrew Β β’ Β π Download for macOS Β β’ Β Download for Windows Β β’ Β π¦ Quick Start Β β’ Β π Self-Hosting Β β’ Β π€ Contributing Β β’ Β β Star
No signup required. Click "Sign in as demo" to start instantly.
π Live Playground: https://app.getdory.dev
AI agents can now write SQL, inspect schemas, and answer analytical questions. But raw agent output is not enough for real data work.
Teams still need to:
- see the exact SQL that was run
- inspect real result sets
- fix wrong queries
- turn results into charts or exports
- preserve context across multiple steps
- continue the work in a real SQL workspace
Dory is built for this workflow.
Dory provides the same underlying database actions to both the UI and agents:
- Humans use Dory as a SQL client: write SQL, browse schema, run queries, filter results, create charts, and save queries.
- Agents use Dory through MCP: list connections, explore schemas, run read-only SQL, create tabs, and organize database work.
- Agent-generated work becomes a real workspace that humans can review, edit, and continue.
| Capability | Plain DB MCP Server | Dory |
|---|---|---|
| Run SQL from agents | β | β |
| Explore schema | β | β |
| Editable SQL tabs | β | β |
| Persistent result sets | β | β |
| Charts and filters | β | β |
| Human review workflow | Limited | β |
| Saved queries and workspace context | Limited | β |
| Works as a daily SQL client | β | β |
Agent database work should not disappear into a chat transcript.
- Open agent-created SQL tabs as normal workspace tabs
- Inspect SQL, result sets, filters, charts, and saved context
- Edit generated SQL and rerun it yourself
- Continue an agent run from the same workspace instead of restarting from scratch
The Dory desktop app exposes a local MCP endpoint so external agents can use your Dory connections without manual token copy/paste.
- Works with Claude Code, Codex CLI, and other MCP-compatible clients
- Uses Dory's connection list, schema inspection, saved queries, and read-only SQL execution
- Keeps Desktop MCP grants managed by Dory instead of asking normal users to handle API tokens
- Multi-tab SQL editor with multiple result sets
- Schema browser for tables, columns, and database objects
- Saved queries for reusable analysis
- Built-in query execution history and workspace context
- Inspect real result sets in a table view
- Filter, search, and review returned rows
- Turn query output into charts directly inside the workspace
- Keep results attached to the SQL that produced them
An AI assistant grounded in real database schema and current query context.
- Generate SQL from natural language
- Rewrite, fix, and explain SQL in the current tab
- Use current database schema and query context
- Keep AI assistance inside the real SQL workspace
- Save useful SQL as reusable queries
- Organize query work across connections and workspaces
- Let humans and agents build on previous database work
- Preserve context beyond a single chat response
Dory is a multi-database SQL client, with broad driver support and deeper integrations where Dory can provide more than generic SQL execution.
| Database | Status |
|---|---|
| ClickHouse | β Deeply integrated |
| PostgreSQL | β Supported |
| Neon | β Supported |
| MySQL | β Supported |
| MariaDB | β Supported |
| SQLite | β Supported |
| DuckDB | β Supported |
| SQL Server | β Supported |
| Oracle | β Supported |
| Snowflake | π§ Planned |
Dory includes native ClickHouse operations surfaces for teams that need more than a generic SQL editor.
- Query monitoring with slow queries, errors, active users, latency, and throughput
- Multi-dimensional filtering by user, database, query type, and time range
- User and role management without hand-writing every
GRANTorCREATE USERstatement - Cluster-level privilege operations with On Cluster support
brew install dorylab/dory/doryMake sure Docker is installed, then run:
docker run -d --name dory \
-p 3000:3000 \
-e DS_SECRET_KEY="$(openssl rand -base64 32 | tr -d '\n')" \
-e BETTER_AUTH_SECRET="$(openssl rand -hex 32)" \
-e BETTER_AUTH_URL="http://localhost:3000" \
-e DORY_AI_PROVIDER=openai \
-e DORY_AI_MODEL=gpt-4o-mini \
-e DORY_AI_API_KEY=your_api_key_here \
-e DORY_AI_URL=https://api.openai.com/v1 \
-e NEXT_PUBLIC_REQUIRE_EMAIL_VERIFICATION=false \
-e DORY_INIT_USER_EMAIL=admin@getdory.dev \
-e DORY_INIT_USER_PASSWORD=admin \
dorylab/dory:latestThen:
Username: admin@getdory.dev
Password: admin
The initial administrator account is controlled by DORY_INIT_USER_EMAIL and DORY_INIT_USER_PASSWORD in .env.
To enable email verification, set RESEND_API_KEY to a valid resend key and EMAIL_FROM to a validated email.
For long-running self-hosted deployments, Docker Compose runs Dory with a dedicated PostgreSQL database and persistent volumes.
cp docker-compose.env.example .env
# Edit .env and replace all placeholder secrets/passwords.
docker compose up -dFor comprehensive self-hosting documentation, environment variables, and deployment guides, see the Self-Hosting Documentation.
The Dory desktop app includes local MCP (Model Context Protocol) support, so agent clients can use your Dory connections without manually copying API tokens.
To enable it:
- Open the Dory desktop app.
- Go to Settings β Agent Access.
- Turn on Enable.
- Add the displayed local endpoint to your MCP client.
By default, desktop MCP runs at:
http://127.0.0.1:3318/api/mcp
For Codex CLI:
codex mcp add dory --url http://127.0.0.1:3318/api/mcp
codex mcp listFor Claude Code:
claude mcp add --transport http dory http://127.0.0.1:3318/api/mcp
claude mcp listDory manages the desktop MCP grant automatically. The local MCP endpoint can list connections, inspect schemas, read saved queries, preview tables, run read-only SQL, and build analysis context for connected databases.
Dory is built with a pluggable AI provider architecture. You can freely switch between different model vendors by changing environment variables, with no code changes required.
Currently supported providers:
| Provider | Env DORY_AI_PROVIDER |
Description |
|---|---|---|
| OpenAI | openai |
Default provider. Uses official OpenAI API. |
| OpenAI-Compatible | openai-compatible |
Any service exposing an OpenAI-compatible API. |
| Anthropic | anthropic |
Claude models via Anthropic official API. |
google |
Gemini models via Google Generative AI API. | |
| Qwen (Alibaba) | qwen |
Qwen models via DashScope OpenAI-compatible endpoint. |
| xAI | xai |
Grok models via xAI API. |
See the latest roadmap here:
- Dory Roadmap
- Historical reference: GitHub Discussion #35
- Next.js + React + Tailwind
- Drizzle ORM
- Multi-model AI SDK integration
- PGLite
- Resend
- Shadcn UI
- Monaco Editor
- Data engineers
- Data analysts
- Database platform teams
- Agent builders who need a database execution layer
- ClickHouse operations teams
Your data stays yours. Except for AI requests sent through Cloudflare Gateway, everything β connections, tabs, results, and saved queries β is stored locally on your device.
Apache-2.0