Dolt MCP Server for Versioned SQL Access
Enable AI assistants to access and manage version-controlled Dolt SQL databases via an MCP server for database operations and version control.
npx -y @dolthub/dolt-mcpOverview
The Dolt MCP Server implements a Model Context Protocol (MCP) bridge that gives AI assistants direct, programmatic access to Dolt’s versioned SQL databases. By exposing Dolt operations as MCP “tools”, the server lets an assistant list schemas, run queries, mutate rows, and perform version-control actions (commits, branches, merges, diffs) without manual CLI steps.
This is useful when you want conversational agents or automation tools to inspect and modify a Dolt repository as part of data exploration, automated migrations, QA, or developer workflows. The server supports both stdio and HTTP transports so it can be run locally for tight integrations or in a container for networked services.
Repository: https://github.com/dolthub/dolt-mcp
Features
- Expose Dolt SQL/database operations to MCP-capable assistants
- Full table lifecycle support: create, alter, describe, drop
- Data operations: select, insert, update, delete
- Version control tools: branches, commits, merges, diffs
- Remote operations: clone, fetch, push, pull
- Two transport modes: stdio (ideal for local assistant integrations) and HTTP (REST endpoint for web integrations)
- Docker image and a Go-based binary for self-hosted deployments
Installation / Configuration
Prerequisites:
- Go 1.24.4+ for building from source
- A running Dolt SQL server (host and port)
Build from source:
Docker (official image):
Run as an HTTP server (Docker):
Run as a stdio server (Docker):
Native binary modes:
- Stdio mode (recommended when embedding in a local assistant):
- HTTP mode:
Important: HTTP clients must target the /mcp endpoint (for example, https://host:8080/mcp).
Environment variables (Docker / container-friendly):
| Variable | Required | Description |
|---|---|---|
| DOLT_HOST | yes | Dolt SQL server hostname |
| DOLT_USER | yes | Dolt username |
| DOLT_DATABASE | no | Default database to connect to |
| DOLT_PASSWORD | no | Password for authentication |
| DOLT_PORT | no | Dolt port (default 3306) |
| MCP_MODE | no | “http” or “stdio” (default: stdio) |
| MCP_PORT | no | HTTP port (default 8080 when using HTTP mode) |
Available Tools / Resources
The server exposes a collection of MCP tools organized by capability. Examples:
- Database management
- list_databases
- create_database
- drop_database
- select_version
- Table operations
- show_tables
- show_create_table
- describe_table
- create_table
- alter_table
- drop_table
- Data operations
- select
- insert_rows
- update_rows
- delete_rows
- Version control
- branch_list / branch_create / branch_delete
- commit
- merge
- diff
- Remote
- clone
- fetch
- push
- pull
Use the HTTP transport to call these tools via REST, or register the stdio process with an MCP-capable assistant (examples below).
Claude / MCP client example (stdio registration using a JSON config snippet):
HTTP client example (note the /mcp suffix):
Use Cases
- Schema exploration and automated query generation
- An assistant can list tables, describe columns, and suggest SELECT queries based on table metadata, then run those queries and present results to the user.
- Data edits with version control
- An assistant can create a branch, apply a set of INSERT/UPDATE operations, run tests or validations, and either merge the branch back or keep it for review—each change is a Dolt commit.
- Automated migration and rollout
- Use the MCP server in CI to let an automation bot apply schema migrations on a feature branch, produce diffs, and push changes to a remote repository when checks pass.
- Remote sync and audit
- Clone remote Dolt repos, fetch updates, and produce diffs that an assistant can summarize or include in a changelog.
Getting Started Tips
- For local development and assistant embedding, prefer stdio mode—it’s simpler to wire up and avoids HTTP auth complexity.
- For multi-user, web, or cloud deployments, use HTTP mode behind TLS and an authentication proxy.
- Store credentials via environment variables or a secrets manager; avoid hardcoding passwords in configs or source control.
This server allows AI-driven workflows to interact with Dolt repositories programmatically while preserving Dolt’s versioned history and collaboration primitives.