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
Dory is building the data workspace for the Agent era.
As AI agents become capable of writing SQL, exploring schemas, debugging queries, and answering analytical questions, the bottleneck is no longer only whether an agent can generate a query. The harder problem is how humans and agents work together around real data: how queries are executed, how results are inspected, how mistakes are corrected, how context is preserved, and how useful work can continue after the first answer.
Dory is designed as an agent-first SQL workspace where every important operation is action-based and can be used by both humans and agents. Agents can list connections, explore schemas, run read-only SQL, create or update workspace tabs, and organize saved queries through the same underlying action system that powers the product UI.
We believe the future data workflow will not be a standalone chatbot beside a database. It will be a shared working environment where an agent can create a complete analytical workspace, produce SQL and result sets, and let the user open, inspect, filter, chart, edit, and continue the work directly.
In Dory, the result is not just text. SQL tabs, query results, filters, charts, saved queries, and workspace state are first-class parts of the workflow. This makes Dory different from simply connecting an LLM to a database through MCP: the agent does not just return an answer β it creates a real workspace that humans can trust, modify, and build on.
Our long-term goal is to make Dory the default data workbench for agentic data analysis:
- agents can understand database structure and execute safe analytical actions;
- humans can review and refine the agentβs work in a real SQL workspace;
- every meaningful step can be recorded, reopened, and continued;
- query results can become charts, dashboards, exports, or reusable analysis artifacts;
- external agents such as coding assistants can use Dory as their data execution layer through MCP.
Dory is not trying to replace SQL professionals with a black-box assistant. It is building the interface where humans and agents collaborate on data with transparency, control, and persistent context.
brew install dorylab/dory/dory
Make 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:latest
Then:
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
image
- 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
image
- 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 list
For Claude Code:
claude mcp add --transport http dory http://127.0.0.1:3318/api/mcp claude mcp list
Dory 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:
- 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
- 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