Are you the author? Sign in to claim
The MCP server for Dolt
A Model Context Protocol (MCP) server that provides AI assistants with direct access to Dolt and DoltgreSQL databases. This server enables AI tools like Claude to interact with Dolt's version-controlled SQL databases over either the MySQL or PostgreSQL wire protocol, allowing for database operations, version control workflows, and data management tasks.
The Dolt MCP Server acts as a bridge between AI assistants and Dolt databases, exposing a comprehensive set of tools for:
Both Dolt (MySQL-compatible) and DoltgreSQL (PostgreSQL-compatible) backends are supported. The SQL dialect is selected at startup with the --dolt or --doltgres flag.
git clone https://github.com/dolthub/dolt-mcp
cd dolt-mcp
go build -o dolt-mcp-server ./mcp/cmd/dolt-mcp-server
Pull the official Docker image:
docker pull dolthub/dolt-mcp:latest
The Dolt MCP Server can run in two modes and supports multiple deployment methods:
docker run -d \
--name dolt-mcp-server \
-p 8080:8080 \
-e MCP_MODE=http \
-e DOLT_HOST=your-dolt-host \
-e DOLT_USER=root \
-e DOLT_DATABASE=your_database \
-e DOLT_PASSWORD=your_password \
dolthub/dolt-mcp:latest
docker run -it --rm \
-e MCP_MODE=stdio \
-e DOLT_HOST=your-dolt-host \
-e DOLT_USER=root \
-e DOLT_DATABASE=your_database \
-e DOLT_PASSWORD=your_password \
dolthub/dolt-mcp:latest
Set MCP_DIALECT=doltgres to point the container at a DoltgreSQL server. DOLT_PORT defaults to 5432 when the dialect is doltgres.
docker run -d \
--name dolt-mcp-server \
-p 8080:8080 \
-e MCP_MODE=http \
-e MCP_DIALECT=doltgres \
-e DOLT_HOST=your-doltgres-host \
-e DOLT_USER=postgres \
-e DOLT_DATABASE=your_database \
-e DOLT_PASSWORD=your_password \
dolthub/dolt-mcp:latest
The stdio server communicates over standard input/output, making it ideal for integration with AI assistants like Claude Desktop.
Against Dolt (MySQL dialect, the default):
./dolt-mcp-server \
--stdio \
--dolt \
--host 0.0.0.0 \
--port 3306 \
--user root \
--database mydb
Against DoltgreSQL (PostgreSQL dialect):
./dolt-mcp-server \
--stdio \
--doltgres \
--host 0.0.0.0 \
--port 5432 \
--user postgres \
--database mydb
If --port is omitted, it defaults to 3306 for Dolt and 5432 for DoltgreSQL.
Add this configuration to your Claude Desktop MCP settings:
{
"mcpServers": {
"dolt-mcp": {
"command": "/path/to/dolt-mcp-server",
"args": [
"--stdio",
"--dolt",
"--host", "0.0.0.0",
"--port", "3306",
"--user", "root",
"--database", "your_database_name"
],
"env": {
"DOLT_PASSWORD": "your_password_if_needed"
}
}
}
}
For a DoltgreSQL backend, swap --dolt for --doltgres and adjust the port/user to match your server.
When connecting to a Dolt MCP server running in HTTP mode, you can configure Claude to use the HTTP transport. Important: HTTP connections require the /mcp endpoint to be appended to the server URL.
claude mcp add --transport http dolt-mcp https://your-dolt-host:8080/mcp --header "Authorization: Bearer <token>"
Add this configuration to your Claude Desktop MCP settings:
{
"mcpServers": {
"dolt-mcp": {
"transport": "http",
"url": "https://your-dolt-host:8080/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}
Note: Replace your-dolt-host, the port, and <your-token> with your actual server details. The /mcp endpoint is required for HTTP connections.
The HTTP server exposes a REST API for MCP tool calls, useful for web applications and custom integrations.
./dolt-mcp-server \
--http \
--mcp-port 8080 \
--dolt \
--host 0.0.0.0 \
--port 3306 \
--user root \
--database mydb
Pass --doltgres in place of --dolt to connect to a DoltgreSQL server.
--host: Hostname of the Dolt or DoltgreSQL server--user: Username for server authentication--stdio or --http: Server mode selection--dolt: Use the Dolt (MySQL-compatible) dialect. This is the default when neither flag is passed.--doltgres: Use the DoltgreSQL (PostgreSQL-compatible) dialect.--dolt and --doltgres are mutually exclusive.
--database: Name of the database to connect to--port: Server port. Defaults to 3306 for Dolt and 5432 for DoltgreSQL.--password: Password for authentication (can also use environment variable)--tls: TLS mode for the database connection: true, false, skip-verify, or preferred--tls-ca: Path to a CA certificate file for the database TLS connection--mcp-port: HTTP server port (default: 8080, HTTP mode only)DOLT_PASSWORD: Set the password for Dolt server authenticationWhen using Docker, you can configure the server using environment variables:
DOLT_HOST: Hostname of the Dolt SQL serverDOLT_USER: Username for Dolt server authenticationDOLT_DATABASE: Name of the database to connect toDOLT_PASSWORD: Password for authenticationDOLT_PORT: Server port (default: 3306 for dolt, 5432 for doltgres)MCP_DIALECT: SQL dialect: dolt (MySQL-compatible) or doltgres (PostgreSQL-compatible). Default: doltMCP_MODE: Server mode: http or stdio (default: stdio)MCP_PORT: HTTP server port (default: 8080, HTTP mode only)version: '3.8'
services:
dolt-mcp-server:
image: dolthub/dolt-mcp:latest
ports:
- "8080:8080"
environment:
- MCP_MODE=http
- DOLT_HOST=dolt-server
- DOLT_PORT=3306
- DOLT_USER=root
- DOLT_DATABASE=myapp
- DOLT_PASSWORD=secret
depends_on:
- dolt-server
restart: unless-stopped
dolt-server:
image: dolthub/dolt-sql-server:latest
ports:
- "3306:3306"
volumes:
- dolt_data:/var/lib/dolt
environment:
- DOLT_ROOT_PATH=/var/lib/dolt
restart: unless-stopped
volumes:
dolt_data:
The Dolt MCP Server provides 40+ tools organized by functionality:
list_databases: List all available databasescreate_database: Create a new databasedrop_database: Remove a databaseselect_version: Get Dolt server version informationshow_tables: List tables in current databaseshow_create_table: Show table creation SQLdescribe_table: Show table schema and structurecreate_table: Create new tablesalter_table: Modify table structuredrop_table: Remove tablesquery: Execute SELECT queries (read operations)exec: Execute INSERT, UPDATE, DELETE queries (write operations)list_dolt_branches: List all branchesselect_active_branch: Show currently active branchcreate_dolt_branch: Create new branchescreate_dolt_branch_from_head: Create branch from current HEADdelete_dolt_branch: Remove branchesmove_dolt_branch: Rename brancheslist_dolt_commits: View commit historycreate_dolt_commit: Create commits with staged changesstage_table_for_dolt_commit: Stage specific tablesstage_all_tables_for_dolt_commit: Stage all modified tablesunstage_table: Remove tables from staging areaunstage_all_tables: Clear staging arealist_dolt_diff_changes_in_working_set: Show uncommitted changeslist_dolt_diff_changes_by_table_name: Show changes for specific tablelist_dolt_diff_changes_in_date_range: Show changes within date rangeget_dolt_merge_status: Check merge conflicts and statusmerge_dolt_branch: Merge branches (fast-forward when possible)merge_dolt_branch_no_fast_forward: Force merge commitdolt_reset_soft: Soft reset to a revision (table, branch, commit, working set, or '.')dolt_reset_hard: Hard reset to a revisionlist_dolt_remotes: List configured remotesadd_dolt_remote: Add new remote repositoriesremove_dolt_remote: Remove remote repositoriesclone_database: Clone remote databasesdolt_fetch_branch: Fetch specific branch from remotedolt_fetch_all_branches: Fetch all branches from remotedolt_push_branch: Push branch to remotedolt_pull_branch: Pull branch from remote# Start the MCP server
./dolt-mcp-server --stdio --dolt --host localhost --user root --database testdb
# Example AI interactions:
# "Show me all tables in the database"
# "Create a table called users with id, name, and email columns"
# "Insert some sample data into the users table"
# "Show me the current branch and recent commits"
# Example AI workflow:
# "Create a new branch called 'feature-users'"
# "Switch to the feature-users branch"
# "Create a users table with appropriate schema"
# "Stage and commit these changes"
# "Switch back to main and merge the feature branch"
# Example AI interactions:
# "Show me all data in the sales table"
# "Calculate total revenue by month from the orders table"
# "Show me what changed in the products table in the last week"
# "Create a branch to experiment with data transformations"
go test ./...
The repository includes comprehensive integration tests that validate tool functionality against a real Dolt server instance.
This project follows the same license as the main Dolt project.
For issues and questions:
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows