
Dolt 的 MCP 服务器
概览
一个模型上下文协议(MCP)服务器,为AI助手提供直接访问多尔特和多尔特格雷SQL数据库的机会. 这个服务器可以让克洛德等AI工具在MySQL或PostgreSQL线条协议上与多尔特的版本所控制的SQL数据库进行交互,允许数据库操作,版本控制工作流程,以及数据管理任务. Dolt MCP 服务器充当了AI助手和Dolt数据库之间的桥梁,揭示了一套用于: - :创建、下放和管理数据库 - :创建、修改、下放、描述和查询表格 - :分支管理、承诺、合并和diffs - :插入、更新、删除和查询数据 - :克隆、获取、推取和从远程存储库中拉出 Dolt(MySQL-兼容)和DoltgreSQL(PostgreSQL-兼容)都支持后端. SQL方言在启动时以 -- dolt或 --doltgres 旗来选择.
概述(AI 翻译)
一个模型上下文协议(MCP)服务器,为AI助手提供直接访问多尔特和多尔特格雷SQL数据库的机会. 这个服务器可以让克洛德等AI工具在MySQL或PostgreSQL线条协议上与多尔特的版本所控制的SQL数据库进行交互,允许数据库操作,版本控制工作流程,以及数据管理任务.
□ 概览
Dolt MCP 服务器充当了AI助手和Dolt数据库之间的桥梁,揭示了一套用于:
- 数据库管理:创建、减少和管理数据库
- 表操作: 创建、修改、放出、描述和查询表格
- ** 质量控制**:部门管理、承诺、合并和监管
- 数据操作: 插入、更新、删除和查询数据
- ** 远程操作**: 克隆,取出,推出,取出远程存储器
Dolt(MySQL-兼容)和DoltgreSQL(PostgreSQL-兼容)都支持后端. SQL方言在起动时以--dolt或--doltgres旗来选择. 嵌入式多尔特利特后端([[T2])也可用特制二进制,运行在完全没有服务器的本地数据库文件上——参见多尔特利特模式.
□ 安装
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Dolt MCP Server
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.
Overview
The Dolt MCP Server acts as a bridge between AI assistants and Dolt databases, exposing a comprehensive set of tools for:
- Database Management: Create, drop, and manage databases
- Table Operations: Create, alter, drop, describe, and query tables
- Version Control: Branch management, commits, merges, and diffs
- Data Operations: Insert, update, delete, and query data
- Remote Operations: Clone, fetch, push, and pull from remote repositories
Both Dolt (MySQL-compatible) and DoltgreSQL (PostgreSQL-compatible) backends are supported. The SQL dialect is selected at startup with the --dolt or --doltgres flag. An embedded DoltLite backend (--doltlite) is also available in specially built binaries, running against a local database file with no server at all — see DoltLite Mode.
Installation
Prerequisites
- Go 1.25 or later
- A running Dolt or DoltgreSQL SQL server instance (not needed for DoltLite mode)
Building from Source
The default build is pure Go (no cgo) and cross-compiles freely:
git clone https://github.com/dolthub/dolt-mcp
cd dolt-mcp
go build -o dolt-mcp-server ./mcp/cmd/dolt-mcp-server
Binaries built this way do not include DoltLite support (--doltlite returns an error). Building with embedded DoltLite requires cgo and libdoltlite; see Building with DoltLite Support.
Docker Installation
Pull the official Docker image:
docker pull dolthub/dolt-mcp:latest
Usage
The Dolt MCP Server can run in two modes and supports multiple deployment methods:
Docker Usage (Recommended for Production)
HTTP Server with Docker
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
Stdio Server with Docker
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
Connecting to DoltgreSQL from Docker
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 \
安装
docker run -d \配置
{
"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"
}
}
}
}