Skip to main content
Glama
SpringDamon

mcp-server-dmdb

by SpringDamon

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DM_HOSTNoDatabase host. Defaults to 127.0.0.1.127.0.0.1
DM_PORTNoDatabase port. Defaults to 5236.5236
DM_USERYesDatabase username. Required.
DM_SCHEMANoLogin schema. Optional.
DM_MAX_ROWSNoMaximum number of rows returned per query. Defaults to 100.100
DM_PASSWORDYesDatabase password. Required.
DM_ALLOW_DDLNoSet to 'true' to enable the dm_execute_ddl tool. Defaults to 'false'.false
DM_LOG_LEVELNoLog level: OFF, ERROR, WARN, INFO, DEBUG. Defaults to ERROR.ERROR
DM_DICT_SCOPENoDictionary view scope: 'all' or 'user'. Defaults to 'all'.all
DM_ALLOW_WRITENoSet to 'true' to enable the dm_execute_dml tool. Defaults to 'false'.false
DM_LOGIN_ENCRYPTNoWhether to enable login encryption. Defaults to 'false'.false
DM_MAX_ROWS_HARDNoHard limit that DM_MAX_ROWS cannot exceed. Defaults to 1000.1000
DM_CELL_CHAR_LIMITNoMaximum characters per cell. Defaults to 200.200
DM_PING_TIMEOUT_MSNoPing timeout in milliseconds. Defaults to 3000.3000
DM_QUERY_TIMEOUT_MSNoQuery timeout in milliseconds. Defaults to 30000.30000
DM_TOTAL_CHAR_LIMITNoMaximum total characters per response. Defaults to 24000.24000
DM_SOCKET_TIMEOUT_MSNoNetwork socket timeout in milliseconds. Defaults to 60000.60000
DM_CONNECT_TIMEOUT_MSNoConnection timeout in milliseconds. Defaults to 10000.10000

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
dm_pingA

检查到达梦 DM8 数据库的连接是否正常,返回服务端版本、实例名、当前连接用户,以及 DM_ALLOW_WRITE / DM_ALLOW_DDL 两个写权限开关的当前状态。排查"连不上"或"提示没有写权限"时先调用本工具。本工具只读取会话与实例元数据,不查询任何业务表。

dm_list_schemasA

列出当前连接用户在达梦 DM8 中可访问的全部模式(schema/用户)。不确定某个表属于哪个 schema、或想确认库里有哪些业务库时调用。主查询走 ALL_USERS;若权限不足会退回 SYSOBJECTS 按 TYPE$='SCH' 查询。

dm_list_tablesA

按模式名和表名关键字列出达梦 DM8 中的表,附带行数统计、所在表空间和表注释。用于"这个库里有哪些表""我要找订单相关的表"这类探索。注意 NUM_ROWS 来自统计信息,本库多数表未收集统计信息因而为 NULL;需要准确行数请用 dm_table_count 做精确 COUNT。标识符不区分大小写,传 order 或 ORDER 都可以。

dm_describe_tableA

返回一张表的完整结构:列定义(类型/长度/精度/可空/默认值)、主键、外键、唯一键、检查约束、索引及其包含的列、表注释与列注释,可选附带建表 DDL。写 SQL 之前调用它,避免猜列名和类型。注意:索引位置列在达梦里叫 COLUMN_POSITION,而约束位置列叫 POSITION,两者不同名。

dm_queryA

在达梦 DM8 上执行一条 SELECT 语句,返回列名与结果行。只放行 SELECT:INSERT/UPDATE/DELETE/DDL/多语句/存储过程调用都会被拒绝。分页请在 SQL 里写 LIMIT ? OFFSET ? 并把数值放进 params(DM8 原生支持绑定参数,已实测)。结果会自动按行数、单元格长度、总字符数三层截断,截断提示里会给出下一步建议。BIGINT 主键超出 JS 安全整数范围时会自动改用字符串重读,保证末几位不丢。

dm_table_sampleA

从指定表取几行样本数据,省去手写 SELECT 的步骤,也不用处理标识符大小写和引号。想快速了解一张表里"数据长什么样"时用这个;需要条件过滤或聚合请用 dm_query。默认只取 5 行,避免把上下文打满。

dm_table_countA

返回一张表的行数。默认执行精确 COUNT(*)。注意:达梦 ALL_TABLES.NUM_ROWS 来自统计信息,本库多数表未收集统计信息,该值通常为 NULL —— 所以不要拿 dm_list_tables 里的 NUM_ROWS 当真实行数,要用本工具。大表可以把 exact 设为 false,只读取统计估算值(可能不可用)。

dm_explainA

返回一条 SELECT 语句在达梦 DM8 上的执行计划(走 EXPLAIN FOR,达梦的裸 EXPLAIN 不返回结果集)。输出包含 OPERATION、TAB_NAME、IDX_NAME、SCAN_TYPE、ROW_NUMS、COST 等列。排查慢查询、确认有没有走索引时调用。只接受 SELECT;EXPLAIN 不支持绑定参数,传入的 params 会被内联为字面量(经转义)。

dm_search_objectsA

按关键字跨表搜索:表名、列名、列注释三处任一命中即返回,同时给出所属表、列类型和注释。适合"哪个表里有手机号字段""跟退款相关的列在哪"这类探索。中文注释也能搜(例如搜"订单")。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SpringDamon/mcp-server-dmdb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server