Dory is an AI-native SQL client for humans and agents.
Query databases, explore schemas, visualize results, and turn agent database work into editable SQL workspaces.
Dory combines a familiar SQL workspace with AI assistance and MCP support. You can write SQL manually, ask AI to help with queries, or let external agents like Claude and Codex explore your database through Dory MCP.
Unlike a plain database MCP server, Dory does not just return query results back to a chat. It records the SQL, results, tabs, and charts generated by agents, so you can open the work as a real workspace, verify it, edit it, and continue the analysis.
π Try Live Demo Β β’ Β πΊ Install via Homebrew Β β’ Β π Download for macOS Β β’ Β Download for Windows Β β’ Β π¦ Quick Start Β β’ Β π Self-Hosting Β β’ Β π€ Contributing Β β’ Β β Star
No signup required. Click "Enter as Demo" to start instantly.
π Live Playground: https://app.getdory.dev
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.
An AI assistant grounded in real database schema and current query context.
- Ask β Generate SQL from natural language
- Action β Fix or rewrite the current SQL
- Context β Explain query logic and field semantics
AI that understands your database β not just text completion.
- SQL completion based on real database schema
- Suggests tables, columns, functions, and aliases
- Supports multi-table joins and subqueries
- Multi-tab SQL workspace with support for multiple result sets
- Save and organize frequently used queries
- AI-powered SQL Copilot for writing, explaining, and optimizing queries
- Instant query visualization with built-in charts
- Built-in conversational AI assistant
- Automatically understands connected database schema
- Ask questions directly about tables and SQL
- Quickly locate field meanings and query ideas
- Desktop MCP endpoint for local agent clients
- No manual token copy/paste in the desktop app
- Supports schema discovery, saved queries, read-only SQL, table previews, monitoring summaries, and analysis tools
A native observability interface designed specifically for ClickHouse.
- Real-time metrics:
- Total queries
- Slow queries
- Error queries
- Active users
- Query latency trends (P50 / P95)
- Query throughput trends (QPM)
- Multi-dimensional filtering:
- User
- Database
- Query type
- Time range
Native ClickHouse user and role management UI.
- Create, edit, and delete database users
- Create roles and configure grant relationships
- Configure:
- Login username and password
- Allowed host addresses
- Granted roles and default roles
- Supports cluster-level privilege operations (On Cluster)
- No need to manually write GRANT / CREATE USER SQL
| 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 is built with a pluggable AI provider architecture. You can freely switch between different model vendors by changing environment variables β 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. |
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.
See the latest roadmap here:
- Next.js + React + Tailwind
- Drizzle ORM
- Multi-model AI SDK integration
- PGLite
- Resend
- Shadcn UI
- Monaco Editor
- Data engineers
- Data analysts
- Database platform teams
- ClickHouse operations teams
Your data stays yours. Except for AI requests sent through Cloudflare Gateway, everything β connections, tabs, and saved queries β is stored locally on your device.
Apache-2.0


