Dory
English · 简体中文 · Español · 日本語
Dory is an open-source, AI-native SQL client and an analytics workspace where people and AI agents work together.
Install via Homebrew · Download for macOS · Download for Windows · Quick start · Self-hosting · MCP guide · GitHub Knowledge Connector · Contributing · Star on GitHub
!Dory SQL IDE with database tables, the SQL editor, and query results
Use Dory to write SQL, explore databases, and inspect results. You can also ask an agent to investigate a question using your team’s metric definitions and verified queries.
When a finding in a report raises another question, open the SQL and results behind the chart. Adjust how the metric is calculated, rerun the query in the editor, and update the same report with your results.
Use Dory as your everyday SQL client or as the database execution layer for Claude Code, Codex CLI, and other MCP-compatible agents.
Why Dory?
AI agents can write SQL, inspect schemas, and answer questions about data. Teams can follow up on those answers in Dory.
- See exactly which SQL ran.
- Inspect the result sets.
- Correct a query.
- Chart or export the results.
- Keep the context from one step to the next.
- Continue the investigation in a SQL workspace.
How Dory works
Dory makes the same database capabilities available through its interface and to agents through MCP.
- In the SQL client, you can browse schemas, write and run queries, filter results, create charts, and save queries.
- Agents can list connections, explore schemas, run read-only SQL, create tabs, and organize their work through MCP.
- An agent’s queries and results stay in an editable workspace that you can open and continue working in.
!The Hacker News Rankings knowledge base showing how the rankings are calculated
Select Continue analysis in a report to ask a follow-up question in Work while keeping the chart in view. For example, BBC moved into second place in the final week. Which BBC posts made the top ten during those seven days?
See how to open a Hacker News chart’s SQL and update the report
The agent creates a report ranking domains across all snapshots. To see whether the same domains led in the final week, open the chart’s SQL, limit the query to the last seven days in the dataset, and rerun it. GitHub still leads with 19 distinct posts. BBC ranks second with 5, up from fifth across the full period.
!Hacker News report ranking domains across all snapshots
!SQL editor showing the final-seven-day filter and the resulting domain rankings
!The same report with its chart updated to show the final week’s rankings
Dory vs. a plain database MCP server
| Capability | Plain database MCP server | Dory | | --- | ---: | ---: | | Agents can run SQL | Yes | Yes | | Schema exploration | Yes | Yes | | Editable SQL tabs | No | Yes | | Persistent result sets | No | Yes | | Charts and filters | No | Yes | | Human review workflow | Limited | Yes | | Saved queries and workspace context | Limited | Yes | | Everyday SQL client | No | Yes |
Key features
Editable agent workspaces
An agent’s database work stays accessible after the chat ends.
- Open SQL tabs created by an agent.
- Inspect the SQL, result sets, filters, charts, and saved context.
- Edit generated SQL and rerun it yourself.
- Resume an Agent Run from the same workspace.
Desktop MCP for Claude Code and Codex CLI
Dory Desktop provides a local MCP endpoint that lets external agents use your existing database connections.
- Connect Claude Code, Codex CLI, and other MCP-compatible clients.
- List connections, explore schemas, read saved queries, and run read-only SQL.
- Dory manages authorization for the desktop endpoint automatically.
SQL workspace for everyday use
- Write SQL across multiple editor tabs and inspect multiple result sets.
- Browse tables, columns, and other database objects in the schema browser.
- Save queries to reuse in future analyses.
- Review query execution history and retain your workspace context.
Result sets, filters, and charts
- Inspect query results in a table.
- Filter and search the returned rows.
- Turn query results into charts in the workspace.
- Keep each result set linked to the SQL that produced it.
Schema-aware AI assistant
The built-in assistant uses your database schema and the query in your active tab.
- Generate SQL from a question in plain language.
- Rewrite, fix, or explain SQL in the current tab.
- Use the current schema and query as context for suggestions.
- Work with the assistant directly in the SQL workspace.
Saved queries and reusable context
- Save useful SQL.
- Organize queries by connection and workspace.
- Let people and agents build on previous investigations.
- Keep the context you need for follow-up questions after the chat ends.
Supported databases
Dory works with a range of database drivers and offers additional tools for specific databases.
| Database | Status |
| --- | --- |
| ClickHouse | ✅ Deep integration |
|
PostgreSQL | ✅ Supported |
|
Neon | ✅ Supported |
|
Supabase | ✅ Supported |
|
Cloudflare D1 | ✅ Supported |
|
MySQL | ✅ Supported |
|
MariaDB | ✅ Supported |
|
SQLite | ✅ Supported |
|
DuckDB | ✅ Supported |
|
SQL Server | ✅ Supported |
|
Oracle | ✅ Supported |
|
Snowflake | ✅ Supported |
ClickHouse integration
Dory includes an operations interface for teams running ClickHouse.
- Monitor slow queries, errors, active users, latency, and throughput.
- Filter query activity by user, database, query type, and time range.
- Manage users and roles from the interface, including operations such as
GRANTandCREATE USER. - Apply privilege changes across a cluster with
ON CLUSTER.
Quick start
Install on macOS with Homebrew
brew install dorylab/dory/dory
Run with Docker
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 [email protected] \
-e DORY_INIT_USER_PASSWORD=admin \
dorylab/dory:latest
Sign in with the default administrator account.
Username: [email protected]
Password: admin
Self-host with Docker Compose
cp docker-compose.env.example .env
Edit .env and replace all placeholder secrets and passwords.
docker compose up -d
See the self-hosting documentation for deployment details.
Desktop MCP
Dory Desktop includes a local MCP endpoint. Agent clients can use your Dory connections, and Dory handles API authorization for you.
The Dory MCP guide covers three setups.
- Desktop MCP runs a local HTTP endpoint in Dory Desktop with managed authorization.
- CLI MCP uses
@getdory/clito run a standalone stdio server or a headless HTTP service. - Hosted bridge connects to an existing Dory Web deployment through
mcp loginandmcp bridge.
- Open Dory Desktop.
- Go to Settings → Agent Access.
- Turn on Enable.
- Add the local endpoint shown in Dory to your MCP client.
http://127.0.0.1:3318/api/mcp
Connect Codex CLI with the following commands.
codex mcp add dory --url http://127.0.0.1:3318/api/mcp
codex mcp list
Connect Claude Code with the following commands.
claude mcp add --transport http dory http://127.0.0.1:3318/api/mcp
claude mcp list
Dory manages the Desktop MCP grant automatically. Agents can use the local endpoint to list connections, inspect schemas, read saved queries, preview tables, and run read-only SQL to gather context for an analysis.
For other deployments, including headless setups, use @getdory/cli and follow the Dory MCP guide.
Supported AI providers
Dory supports pluggable AI providers. Set the appropriate environment variables to switch model providers.
| Provider | DORY_AI_PROVIDER value | Description |
| --- | --- | --- |
| OpenAI | openai | Default provider using the official OpenAI API |
| OpenAI-compatible | openai-compatible | Any service with an OpenAI-compatible API |
| Anthropic | anthropic | Claude models from Anthropic |
| Google | google | Gemini models from Google |
| Qwen (Alibaba) | qwen | Qwen models through DashScope’s OpenAI-compatible endpoint |
| xAI | xai | Grok models from xAI |
Roadmap
License
Apache-2.0