Skip to main content
Glama
TGich

dm_mcp_server

by TGich

达梦数据库 MCP 服务器

Python 3.10+ License: MIT uv

一个基于 FastMCP 框架的达梦数据库 Model Context Protocol (MCP) 服务器。该服务器采用环境变量驱动,深度结合达梦数据库特性,并内置严格的安全审计机制。

🌟 特性

  • 🚀 环境变量驱动: 全面通过环境变量配置,无需手动调用连接工具,即插即用。

  • 🛡️ 深度安全审计:

    • 强制锁定配置的 DAMENG_SCHEMA

    • 自动拦截跨模式 (Cross-Schema) 访问尝试。

    • 禁止在元数据查询中尝试过滤非本模式的信息。

    • SQL 注入风险模式检测(多语句注入、注释注入、存储过程调用等)。

    • 精细化 DDL/DCL 权限控制(允许表/索引管理,拦截 TRUNCATE/GRANT/REVOKE 等危险操作)。

  • 🔀 多 Schema 支持: 支持配置多个允许的 Schema,可在允许范围内自由切换。

  • 🔒 只读模式: 可选开启只读模式,禁止所有写操作(INSERT/UPDATE/DELETE/DDL)。

  • 📄 分页查询: execute_sql 支持 limit / offset 参数,避免大数据量一次性返回。

  • 📝 批量字段注释: 支持一次性执行多条 COMMENT ON COLUMN 字段注释语句,减少 AI 与 MCP 的多轮交互。

  • 🛠️ 多维工具集: 提供从基础 SQL 执行到模式元数据管理的 9 大核心工具。

  • 🌏 编码优化: 针对 Windows 终端及达梦 UTF-8 编码进行了专项适配。

  • 现代管理: 使用 uv 进行依赖锁定与高性能运行时管理。

Related MCP server: dameng-mcp-server

快速开始

1. 安装依赖

推荐使用 uv 进行环境同步:

uv sync

2. 配置环境变量

服务器在启动时会读取以下环境变量:

变量名

说明

必填

默认值

DAMENG_HOST

数据库主机地址

-

DAMENG_PORT

数据库端口

5236

DAMENG_USER

数据库用户名

-

DAMENG_PASSWORD

数据库密码

-

DAMENG_SCHEMA

默认操作模式

-

DAMENG_ALLOWED_SCHEMAS

允许访问的模式列表(逗号分隔)

DAMENG_SCHEMA

DAMENG_READ_ONLY

只读模式(true/false)

false

DAMENG_LOG_LEVEL

日志级别(DEBUG/INFO/WARNING/ERROR)

INFO

DAMENG_SQL_FILE_ALLOWED_DIRS

允许 execute_sql_file 读取 SQL 文件的目录列表,多个目录按系统路径分隔符分隔

当前工作目录

DAMENG_SQL_FILE_ALLOWED_DIRS 示例:Windows 单目录可写 E:\sql,多目录用分号分隔如 E:\sql;D:\dm-sql;Linux/macOS 多目录用冒号分隔如 /data/sql:/tmp/dm-sql

3. 运行服务器

# Windows (PowerShell 示例) - 单 Schema 模式
$env:DAMENG_HOST="192.168.x.x"; $env:DAMENG_USER="SYSDBA"; $env:DAMENG_PASSWORD="your_password"; $env:DAMENG_SCHEMA="your_schema"; $env:DAMENG_SQL_FILE_ALLOWED_DIRS="E:\sql"; uv run dm-mcp-server

# Windows (PowerShell 示例) - 多 Schema + 只读模式
$env:DAMENG_HOST="192.168.x.x"; $env:DAMENG_USER="SYSDBA"; $env:DAMENG_PASSWORD="your_password"; $env:DAMENG_SCHEMA="schema_a"; $env:DAMENG_ALLOWED_SCHEMAS="schema_a,schema_b,schema_c"; $env:DAMENG_READ_ONLY="true"; $env:DAMENG_SQL_FILE_ALLOWED_DIRS="E:\sql;D:\dm-sql"; uv run dm-mcp-server

🛠️ 提供工具

服务器暴露了以下 9 个工具供 LLM 调用:

  1. test_connection

    • 功能: 验证数据库连接状态,返回当前 Schema、允许的 Schema 列表、只读模式状态。

  2. execute_sql

    • 参数: sql (字符串), fetch_results (布尔值,默认 true), limit (整数,可选), offset (整数,可选)。

    • 功能: 执行 SQL 语句。涉及 SELECT 时返回字典列表。支持分页。内置多层安全审查(注入检测、跨 Schema 检测、只读模式检测)。

  3. execute_sql_file

    • 参数: file_path (字符串), encoding (字符串,默认 utf-8), stop_on_error (布尔值,默认 true), fetch_results (布尔值,默认 false), limit (整数,可选), offset (整数,可选)。

    • 功能: 读取并执行 .sql 文件,适合超长 INSERT、批量初始化脚本等 MCP 单次调用无法承载的场景。文件必须位于 DAMENG_SQL_FILE_ALLOWED_DIRS 白名单目录内;AI 可先调用 get_sql_file_allowed_dirs 获取可写目录,再将文件保存到该目录。支持一个文件内包含多条 SQL;执行前会剥离 --/* */ 注释,再逐条复用现有只读模式与 Schema 白名单安全校验。

    • 示例:

      execute_sql_file(file_path="E:\\sql\\bulk_insert.sql")
  4. get_sql_file_allowed_dirs

    • 功能: 返回 execute_sql_file 当前允许读取的目录列表、目录是否存在、是否可写、推荐写入目录、路径分隔符和 .sql 扩展名要求,方便 AI 先落盘 SQL 文件再执行。

  5. batch_comment_columns_sql

    • 参数: sql (字符串), stop_on_error (布尔值,默认 true)。

    • 功能: 批量执行字段注释 SQL。仅允许 COMMENT ON COLUMN 表名.字段名 IS '注释内容'COMMENT ON COLUMN SCHEMA.表名.字段名 IS '注释内容' 语句,禁止混入其他 SQL。

    • 示例:

      COMMENT ON COLUMN USER_INFO.ID IS '主键ID';
      COMMENT ON COLUMN USER_INFO.USER_NAME IS '用户名称';
      COMMENT ON COLUMN USER_INFO.PHONE IS '手机号';
  6. list_tables

    • 参数: schema (字符串,可选)。

    • 功能: 列出指定模式下的所有表名。不指定则查询默认 Schema。

  7. count_tables

    • 参数: schema (字符串,可选)。

    • 功能: 统计指定模式下的总表数。不指定则统计默认 Schema。

  8. get_current_schema

    • 功能: 返回当前 Schema、允许的 Schema 列表、只读模式状态。

  9. switch_schema

    • 参数: schema (字符串)。

    • 功能: 切换当前操作的 Schema。仅在配置了 DAMENG_ALLOWED_SCHEMAS 时可用,且目标 Schema 必须在允许列表中。

🔒 安全性说明

为了防止非授权的数据访问,本服务器实施了以下安全策略:

  • 模式隔离: 所有 SQL 操作在执行前,都会通过 SET SCHEMA 显式切换到环境变量指定的模式。

  • 多 Schema 白名单: 通过 DAMENG_ALLOWED_SCHEMAS 配置允许访问的 Schema 列表,未在列表中的 Schema 一律拒绝。

  • SQL 注入防护: 检测并拦截常见的 SQL 注入模式,包括多语句注入(;)、注释注入(--/*)、存储过程调用(EXECCALLxp_sp_)等。

  • 跨 Schema 检测: 拦截包含点号 (.) 前缀且非允许模式的 SQL 标识符(例如禁止查询 OTHER_SCHEMA.TABLE)。

  • 元数据保护: 在查询 ALL_TABLES 等系统视图时,如果检测到试图查询非允许模式的 OWNER,将直接拦截。

  • 只读模式: 开启后,仅允许 SELECTWITHEXPLAINSHOWDESCRIBE 等查询语句,禁止所有写操作和 DDL。

  • DDL/DCL 精细化控制 (v2.6.1+):

    • 允许: CREATE TABLEALTER TABLEDROP TABLECREATE INDEXALTER INDEXDROP INDEXRENAMECOMMENT ONTRUNCATE

    • 拦截: GRANT/REVOKE(权限变更)、CREATE VIEW/PROCEDURE 等非 TABLE/INDEX 类型的 DDL。

    • 智能识别: 正确区分 SQL 字符串值中的关键词与实际 DDL/DCL 语句,INSERT/UPDATE 中包含如 'DROP TABLE x' 的字符串值不会被误拦截。

在 Cursor / Claude Desktop / Antigravity / Trae 中配置

使用 uvx (推荐方式)

将以下配置添加到您的 MCP 配置文件中(如 Cursor 的 mcpServers 设置):

{
  "mcpServers": {
    "dm_mcp_server": {
      "command": "uvx",
      "args": [
        "dm-mcp-server@latest"
      ],
      "env": {
        "DAMENG_HOST": "192.168.x.x",
        "DAMENG_PORT": "5236",
        "DAMENG_USER": "SYSDBA",
        "DAMENG_PASSWORD": "your_password",
        "DAMENG_SCHEMA": "your_schema",
        "DAMENG_SQL_FILE_ALLOWED_DIRS": "E:\\sql"
      }
    }
  }
}

多 Schema + 只读模式配置示例

{
  "mcpServers": {
    "dm_mcp_server": {
      "command": "uvx",
      "args": [
        "dm-mcp-server@latest"
      ],
      "env": {
        "DAMENG_HOST": "192.168.x.x",
        "DAMENG_PORT": "5236",
        "DAMENG_USER": "SYSDBA",
        "DAMENG_PASSWORD": "your_password",
        "DAMENG_SCHEMA": "schema_a",
        "DAMENG_ALLOWED_SCHEMAS": "schema_a,schema_b,schema_c",
        "DAMENG_READ_ONLY": "false",
        "DAMENG_LOG_LEVEL": "INFO",
        "DAMENG_SQL_FILE_ALLOWED_DIRS": "E:\\sql;D:\\dm-sql"
      }
    }
  }
}

许可证

MIT License

Available Tools

9 tools
batch_comment_columns_sqlA

批量执行字段注释 SQL,仅允许 COMMENT ON COLUMN 语句

参数: sql: 多条 COMMENT ON COLUMN 语句,可用分号分隔 stop_on_error: 执行阶段遇到错误是否停止

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes
stop_on_errorNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the behavioral disclosure burden. It discloses the core restriction and that stop_on_error controls whether execution halts on error, but it does not explain what happens with invalid statements, whether execution is transactional, or what side effects occur beyond modifying column comments.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: a one-sentence purpose plus a short parameter list. Every sentence contributes useful information with no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

It covers the main purpose and both parameters, and an output schema exists so return-value documentation is less critical. However, with no annotations, a batch SQL-writing tool would benefit from more context about validation behavior, error handling for disallowed statements, and transaction or rollback semantics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the parameter explanations in the description are essential. They add real meaning: sql is defined as multiple COMMENT ON COLUMN statements separated by semicolons, and stop_on_error is described as whether to stop when encountering errors during execution. This meaningfully exceeds the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies a specific verb and resource: it batch-executes field comment SQL and explicitly restricts execution to COMMENT ON COLUMN statements. This distinguishes it from broad siblings like execute_sql and execute_sql_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The allowed statement type is stated ('仅允许 COMMENT ON COLUMN 语句'), which implies when the tool is appropriate. However, it does not explicitly mention alternatives such as execute_sql or explain when not to use this tool, leaving sibling selection mostly to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

count_tablesA

统计指定SCHEMA下的表数量,不指定则统计默认SCHEMA

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral disclosure burden. It usefully reveals the default-SCHEMA fallback behavior, but it does not state whether the operation is read-only, how errors are handled, or whether the count includes only tables or also views. The output schema covers return shape, but safety and edge-case behavior remain undocumented.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single focused sentence that front-loads the action and immediately covers the optionality. There is no redundant phrasing or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple counting tool with one optional parameter and an existing output schema, the description covers the core behavior and the default case adequately. It could be slightly more complete with explicit read-only/error behavior or sibling differentiation, but nothing essential is missing for basic invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema description coverage is 0%, the description fully compensates by explaining the one parameter's semantics: a specified SCHEMA is counted directly, while an unspecified one falls back to the default SCHEMA. This adds meaning beyond the raw nullable schema property.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the exact verb and resource: count the number of tables under a specified SCHEMA, and clarifies the default when none is provided. This clearly distinguishes it from siblings like list_tables, which would return table names rather than a count.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for the schema parameter (specified vs. default schema) but provides no explicit guidance on when to choose this tool over siblings such as list_tables or execute_sql, and names no alternatives or exclusions. Usage is implied rather than fully articulated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_sqlC

执行 SQL 语句(强制限定配置下的SCHEMA操作)

参数: sql: 要执行的 SQL 语句 fetch_results: 是否返回查询结果(默认 True) limit: 限制返回的行数,用于分页(可选) offset: 跳过的行数,用于分页(可选)

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo
offsetNo
fetch_resultsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of disclosing behavior, but it only says SQL statements are executed. It does not state whether the tool is read-only, whether commits occur, what SQL dialects or operations are allowed, what happens with destructive statements, or what the response contains. The '强制限定配置' phrase suggests restriction but fails to define it concretely.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately short and front-loads the main purpose before listing parameters. The parameter list is easy to scan and avoids excessive detail. The parenthetical is somewhat cryptic, but no sentences are wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool named execute_sql with multiple siblings, no annotations, and a potentially dangerous operation, the description is incomplete. It omits allowed SQL statement types, result format, pagination behavior, error handling, and security restrictions. An agent cannot confidently decide whether this tool will safely execute a given SQL statement or whether to choose execute_sql_file or list_tables instead.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The parameter list restates the schema names but does add minimal meaning: limit is for pagination, offset skips rows, and fetch_results controls result return. However, it does not explain how these interact, whether limit/offset apply to all statements or only queries, or what constraints exist on the sql parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the core action: '执行 SQL 语句' (execute SQL statements). The parenthetical '强制限定配置下的SCHEMA操作' adds some scoping, suggesting operations are constrained, but it is vague about whether this means schema-only, read-only, or sandboxed execution. It is distinguishable from execute_sql_file because it executes a raw SQL string rather than a file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is given about when to use this tool versus its siblings like execute_sql_file, list_tables, or switch_schema. The parenthetical hints at a restricted configuration but never states the conditions under which execute_sql is appropriate or when another tool should be chosen. An agent is left to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_sql_fileA

读取并执行 SQL 文件,用于处理超长 SQL。

文件路径必须位于 DAMENG_SQL_FILE_ALLOWED_DIRS 白名单目录内。 文件中的 SQL 注释会在校验和执行前剥离,字符串字面量内的内容不受影响。

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
encodingNoutf-8
file_pathYes
fetch_resultsNo
stop_on_errorNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full transparency burden. It discloses two important behaviors: the file path must be inside the DAMENG_SQL_FILE_ALLOWED_DIRS whitelist, and SQL comments are stripped before validation/execution while string literals are unaffected. This is meaningful beyond the schema, though it does not mention mutation risks or error behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact: three sentences that front-load the core purpose, then add the critical path whitelist constraint and comment-stripping behavior. No filler or redundant repetition of the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the description covers the key file-path constraint and a useful preprocessing behavior, it omits guidance on several operationally important aspects: what limit/offset/fetch_results/stop_on_error control, whether file execution can modify data, and how this tool relates to execute_sql for non-long queries. The presence of an output schema reduces the need to document return values, but parameter semantics remain incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but it only sheds light on file_path (via the whitelist constraint). The remaining parameters—limit, offset, encoding, fetch_results, and stop_on_error—are not given any semantic explanation in the description, leaving the agent to guess their roles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool reads and executes a SQL file, and explicitly positions it for handling ultra-long SQL, which differentiates it from the sibling execute_sql. It does not explicitly name the sibling or define the exact length threshold, so it stops short of a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase '用于处理超长 SQL' provides clear context for when to use this tool: when SQL is too long to handle inline. It does not explicitly state when not to use it or name alternative tools, but the intended use case is unambiguous enough for an agent to make a reasonable selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_current_schemaB

获取当前配置的数据库的SCHEMA及允许的SCHEMA列表

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description reveals what information is returned (current schema and allowed schemas) but does not disclose behavioral traits such as read-only status, whether connections are required, side effects, or failure modes. With no annotations available, the description carries the full burden and only partially covers it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence that directly states the tool's purpose. It is concise, front-loaded, and contains no filler or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless getter with an output schema available, the description adequately states what will be retrieved. It could be slightly more complete by noting typical use cases or read-only behavior, but no critical invocation information is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so there is no parameter semantics burden on the description. The description's mention of 'current configured database' and 'allowed schemas' adds meaningful context even though the input schema is empty.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear action and resource: retrieve the currently configured database's schema and the list of allowed schemas. It is specific enough to convey the tool's core function, though it does not explicitly distinguish itself from sibling tools like list_tables or switch_schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided for when to use this tool versus alternatives such as list_tables, switch_schema, or execute_sql. The intended context must be inferred entirely from the tool name and description, with no exclusions or selection criteria stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_sql_file_allowed_dirsA

获取 execute_sql_file 允许读取的 SQL 文件目录。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. The verb 'get' implies a read-only operation, and the description states the subject (directories allowed for execute_sql_file). However, it does not explicitly disclose that it has no side effects, returns a list of paths, or how the allowed directories are determined (configuration, environment). This is adequate for a simple getter but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that states the verb and object efficiently with no filler. It is appropriately sized for a tool of this simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is low complexity (0 params) and has an output schema, so the description need not detail return values. It tells the agent exactly what information is retrieved. Minor gaps, such as what an empty result means or how directories are configured, are not essential given the output schema and the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters with 100% schema description coverage (empty properties). The description adds no parameter-specific details, but with no parameters, the baseline of 4 applies. It implicitly communicates that the tool requires no arguments, which is correct.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('获取' / get) and a precise resource ('execute_sql_file 允许读取的 SQL 文件目录' / the SQL file directories execute_sql_file is allowed to read). It clearly differentiates from sibling tools by tying the operation to execute_sql_file's permitted paths, leaving no ambiguity about what the tool returns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: an agent would call this when it needs to know which directories execute_sql_file can read from. However, the description does not explicitly state when to use it versus alternatives, nor does it mention prerequisites or consequences (e.g., checking before executing a SQL file). None of the sibling tools overlap, so the lack of exclusions is acceptable but not exemplary.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesA

查询指定SCHEMA下的所有表,不指定则查询默认SCHEMA

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the disclosure burden. It usefully reveals the default-schema behavior and implies a read-only query, but it does not disclose whether views are included, what happens for invalid schema names, or whether the current connection is used.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single compact sentence that conveys both the main purpose and the important default behavior with no filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-optional-parameter listing tool with an output schema, the description is nearly complete. The main gap is that 'default SCHEMA' is not defined or cross-referenced with get_current_schema or switch_schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does clarify that the optional 'schema' parameter selects the schema to list and that null/omission means the default schema, but it does not define how the default schema is determined or specify naming/case/quoting rules.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('查询') and resource ('所有表'), and scopes it to a given schema or the default schema if none is given. It does not explicitly differentiate from sibling tools like count_tables or execute_sql, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear behavior for the optional schema parameter: if omitted, the default schema is queried. However, it provides no guidance on when to prefer this tool over siblings such as count_tables or execute_sql, nor any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

switch_schemaB

切换当前操作的SCHEMA(仅在配置了DAMENG_ALLOWED_SCHEMAS时可用)

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden. It discloses that the tool changes the current schema and is only available under a specific configuration. It does not clarify the scope of the change, persistence, or error behavior, leaving some ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with a useful parenthetical constraint. It is front-loaded and contains no filler, though it could add a bit more practical guidance without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, but the description does not explain how to determine valid schema names, what happens to subsequent operations, or how to verify the switch succeeded. A bit more context would be needed for an agent to use it confidently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds little beyond the schema property name. The parameter's meaning (the target schema name) is implied, but there is no guidance on allowed values, formatting, or how to discover valid schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action (switch) and a specific resource (the current operation's SCHEMA), and includes a configuration-based availability condition. It is distinguishable from siblings like get_current_schema, though it does not explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies that this tool is used to change the active schema for subsequent operations, and it gives a prerequisite (DAMENG_ALLOWED_SCHEMAS must be configured). However, it does not mention when to prefer this over related tools or explain the effect on later calls.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

test_connectionA

测试数据库连接状态

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the behavioral disclosure burden. It states the operation as testing connection status, which implies a read-only health check, but it does not describe failure behavior, return semantics, or whether any side effects occur. For a simple, zero-parameter test operation this is adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence in Chinese that fully communicates the tool's purpose with no redundant words or filler. It is maximally concise and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter health-check tool with an output schema, the description provides enough information for an agent to select the tool. It could benefit from a note about what the output looks like on success/failure, but the output schema likely covers return structure, and the tool's simplicity keeps the description adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the baseline is 4. There is no parameter information in the description, but none is needed because the input schema is empty. The description cannot add meaning beyond the schema where no parameters exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '测试数据库连接状态' states a specific action (test) on a clear resource (database connection status). It is distinct from sibling tools that execute SQL files, run queries, list tables, or manage schema, so an agent can immediately understand this is a connectivity health check.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives, but the name and description clearly imply it is for checking database connectivity. Since none of the sibling tools serve this purpose, the usage context is reasonably inferable, though no explicit guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 9 tool updatesv2.6.2
    • First observedbatch_comment_columns_sql
    • First observedcount_tables
    • First observedexecute_sql
    • First observedexecute_sql_file
    • First observedget_current_schema
    • First observedget_sql_file_allowed_dirs
    • First observedlist_tables
    • First observedswitch_schema
    • First observedtest_connection

TDQS

A3.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: connection testing, direct SQL execution, file-based SQL execution, table listing/counting, schema inspection/switching, batch column comments, and file-directory introspection. Although multiple tools execute SQL, their input modes and constraints are explicit enough to avoid misselection.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern, such as test_connection, list_tables, switch_schema, and execute_sql_file. Even the more specialized batch_comment_columns_sql follows the same imperative style.

Tool Count5/5

Nine tools is well-scoped for a database MCP server. Each tool covers a meaningful part of the workflow, from schema navigation to SQL execution, without feeling bloated or redundant.

Completeness4/5

The core database operations are covered: connection testing, SQL execution, schema switching, and table listing. A minor gap is the lack of a dedicated describe-table or column-metadata tool, though this can be worked around with execute_sql.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for DaMeng database, enabling AI assistants to execute SQL queries, list tables, describe table structures, and retrieve schema information.
    69
    7
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    MCP server enabling AI assistants to connect and query Dameng DM8 databases via JDBC. Supports SQL queries, listing tables, and describing schemas.
    3
    23
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for Dameng database that enables querying and managing database objects via JDBC, including tools for schemas, tables, views, indexes, and more.
    MIT

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/TGich/dm_mcp_server'

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