mcp-server-dameng
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-dameng List all tables in the database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-dameng
达梦数据库 MCP Server — 通过 Model Context Protocol (MCP) 让 AI 助手(Claude、Trae、Cursor 等)直接连接和查询达梦 DM8 数据库。
功能
query_dameng — 执行 SQL 查询(SELECT/DML),返回结构化结果
list_tables — 列出数据库中所有用户表
describe_table — 查看指定表的列信息(类型、可空、默认值、注释)
Related MCP server: dameng-mcp-server
前置条件
Node.js >= 18
Java 8+(JDK 或 JRE)— 用于 JDBC 桥接
达梦 JDBC 驱动 —
DmJdbcDriver18.jar
安装
方式一:npx 直接运行(推荐)
# 首次运行会自动下载 npm 包
npx -y mcp-server-dameng@latest方式二:全局安装
npm install -g mcp-server-dameng@latest
mcp-server-dameng方式三:项目内安装
npm install mcp-server-dameng@latest
npx mcp-server-dameng@latest配置 JDBC 驱动
由于达梦 JDBC 驱动(DmJdbcDriver18.jar)是专有软件,无法通过 npm 自动分发,需要手动配置。
方式 A:通过环境变量指定路径
# 设置驱动路径环境变量
export DAMENG_DRIVER_PATH=/path/to/DmJdbcDriver18.jar方式 B:放置到 lib 目录
将 DmJdbcDriver18.jar 复制到包目录下的 lib/ 文件夹中:
# 全局安装时
cp DmJdbcDriver18.jar $(npm root -g)/mcp-server-dameng/lib/
# 项目内安装时
cp DmJdbcDriver18.jar node_modules/mcp-server-dameng/lib/方式 C:运行 setup 命令获取帮助
npx mcp-server-dameng@latest setup环境变量配置
必需
变量 | 说明 | 示例 |
| 完整 JDBC 连接 URL |
|
| 数据库用户名 |
|
| 数据库密码 |
|
或者使用拆分方式(替代 DAMENG_URL):
变量 | 说明 | 默认值 |
| 数据库主机地址 |
|
| 数据库端口 |
|
可选
变量 | 说明 |
| 默认模式名(连接后自动设置) |
| JDBC 驱动 JAR 文件路径 |
在 AI 工具中配置
Trae / Claude Desktop / Cursor
在 MCP 配置文件(mcp.json)中添加:
{
"mcpServers": {
"dameng": {
"command": "npx",
"args": ["-y", "mcp-server-dameng@latest"],
"env": {
"DAMENG_URL": "jdbc:dm://your-host:5236",
"DAMENG_SCHEMA": "YOUR_SCHEMA",
"DAMENG_USER": "your_username",
"DAMENG_PASSWORD": "your_password",
"DAMENG_DRIVER_PATH": "D:\\path\\to\\DmJdbcDriver18.jar"
}
}
}
}开发
# 克隆仓库
git clone https://github.com/SpringDamon/mcp-server-dameng.git
cd mcp-server-dameng
# 安装依赖
npm install
# 放置 JDBC 驱动
# 将 DmJdbcDriver18.jar 复制到 lib/ 目录
# 编译 Java 桥接类
npm run compile:java
# 编译 TypeScript
npm run build
# 开发模式(热重载)
npm run dev项目结构
mcp-server-dameng/
├── src/
│ ├── index.ts # MCP Server 入口
│ ├── lib/
│ │ └── java-bridge.ts # Java JDBC 桥接
│ └── tools/
│ ├── query.ts # query_dameng 工具
│ ├── tables.ts # list_tables 工具
│ └── schema.ts # describe_table 工具
├── java/
│ └── DamengJdbcBridge.java # Java JDBC 桥接实现
├── lib/ # JDBC 驱动目录(需手动放置)
├── scripts/
│ ├── setup.js # 环境配置工具
│ └── postinstall.js # 安装后检查
├── dist/ # 编译输出
└── package.json许可证
MIT
Available Tools
3 toolsdescribe_tableA
查看达梦数据库表的列信息(列名、类型、是否为空、默认值、注释)
Inputs: tableName (required), schema.
list_tablesA
列出达梦数据库中所有用户表(含表名、注释、行数估算)
Inputs: schema.
query_damengA
执行达梦数据库 SQL 查询(SELECT/DML),返回结构化结果
Inputs: sql (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct purpose: describe_table retrieves column details for a specific table, list_tables enumerates all user tables, and query_dameng executes arbitrary SQL. There is no overlap or ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case: describe_table, list_tables, query_dameng. The naming is uniform and predictable.
With 3 tools, the server is slightly lean but still well-scoped for its purpose of exploring a Dameng database. Each tool serves a necessary function without redundancy.
The tool set covers the core read operations for a database: listing tables, describing table structure, and executing queries. For a read-only exploration server, it is complete with no obvious gaps.
Maintenance
Related MCP Connectors
Cloud-hosted MCP server for secure AI access to enterprise data sources via CData Connect AI.
Draxlr's remote MCP server connects AI assistants to your SQL databases and dashboards. Explore schemas, run read-only queries, manage saved queries and dashboards, and export results, all with row-level security so each user sees only their own data.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Dameng databases through natural language or direct SQL operations. Provides a web interface for listing tables, executing queries, and viewing table structures with MCP protocol support for AI model integration.1-
- AlicenseNot gradedqualityDmaintenanceMCP server for DaMeng database, enabling AI assistants to execute SQL queries, list tables, describe table structures, and retrieve schema information.42 npm7MIT
- AlicenseAqualityDmaintenanceMCP server for KingBase (PostgreSQL-compatible) databases, enabling AI assistants to query and manage database schemas, tables, and data with configurable access control.1128 npm4MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Dameng database that enables querying and managing database objects via JDBC, including tools for schemas, tables, views, indexes, and more.MIT