Skip to main content
Glama
gxc

gaussdb-ro-mcp

by gxc

gaussdb-ro-mcp

[简体中文] | English

CI Glama Release License

NOTE

English: A read-only MCP server for Huawei GaussDB (centralized & distributed), built for coding agents (Claude Code, OpenCode, etc.). Three layers of read-only enforcement — static SQL validation, server-side READ ONLY transactions, and least-privilege account guidance — in a single static binary designed for non-SSL intranet environments. Full documentation: README_en.md.

面向 Coding Agent(Claude Code、OpenCode 等)的 GaussDB 只读 MCP 服务器。基于 GaussDB 官方 Go 驱动 (华为云官方开源的 pgx v5 适配版,源码随仓库内置于 third_party/gaussdb-go,支持离线构建), 通过 stdio 传输提供数据库只读探查工具。

专为内网非 SSL 环境设计:默认 sslmode=disable,配置文件支持同时管理多个 GaussDB 实例。

只读保障(三层纵深防御)

层级

机制

说明

1. SQL 静态校验

internal/guard

仅放行单条 SELECT/WITH 查询:拒绝 DML/DDL(含 CTE 内写语句)、SELECT ... INTO、FOR UPDATE/SHARE 行锁、多语句、危险函数(dblink*、set_config、setval、pg_read_file*、pg_terminate_backend、pg_advisory_*、大对象写等,可配置)。词法分析正确跳过字符串/注释/引号标识符,避免误报

2. 事务级强制

internal/db

所有查询统一在显式只读事务中执行:BEGIN → SET LOCAL TRANSACTION READ ONLY → 查询 → COMMIT(失败回滚)。GaussDB 分布式版仅支持事务级只读设置,该方式在集中式/主备与分布式实例上通用;另设 SET statement_timeout。即使第 1 层被绕过,服务端也会拒绝事务内一切写入(包括函数内部的写)

3. 部署建议

README

建议使用仅授予 SELECT 权限的数据库账号(见下文),实现权限最小化

Related MCP server: starrocks-mcp

提供的 MCP 工具

工具

功能

test_connection

连通性测试:服务器版本、当前库/用户、只读状态、延迟;可选 instance 参数

list_schemas

schema(模式)清单:对象数、注释;include_system 控制是否含系统模式

list_tables

表/视图清单:类型(表/视图/物化视图/分区表/外表)、估算行数、注释;可按 schema 过滤

describe_table

表结构:列(类型/可空/默认值/注释)、主键与约束、全部索引及定义;视图返回视图定义 SQL;分区表返回分区清单(GaussDB pg_partition)

execute_select

执行 SELECT:仅接受单条 SELECT/WITH,受 max_rows/超时限制,返回列名+行数据+是否截断

所有工具均接受可选 instance 参数以选择数据源,缺省使用 default_instance。全部实例名(含默认标注)会写入该参数的 schema 描述,agent 在获取工具列表阶段即可发现可选实例,无需试错。

与同类项目对比

gaussdb-ro-mcp(本项目)

GaussDB-MCP

Multi DB MCP

通用 PostgreSQL MCP 服务器

定位

GaussDB 专用只读探查

GaussDB 全功能访问:查询、写入、事务、诊断运维、用户权限

17 种数据库通用连接器(含 GaussDB/openGauss),MCP + REST API

原生 PostgreSQL

GaussDB 适配

官方 Go 驱动,集中式/主备/分布式均适配

官方 Node.js 驱动(gaussdb-node)

走 PostgreSQL 通用协议

未适配 GaussDB 专有系统目录(如 pg_partition)

只读保障

三层纵深防御:SQL 静态校验 + 事务级 READ ONLY 强制 + 最小权限建议

无只读模式(默认 root 管理员账号,按设计支持写入)

应用层默认只读

各项目实现不一

GaussDB 特有元数据

分区表(pg_partition)、外表、物化视图、视图定义 SQL、全部索引定义

部分支持

按 PG 协议探测,部分支持

无

运行时依赖

无(静态编译单二进制,可离线部署)

Node.js ≥ 20

Node.js(npx)

各异

多实例管理

配置文件集中管理多实例,工具按 instance 参数切换

单实例(环境变量)

单连接(启动参数)

一般单实例

内网非 SSL

默认 sslmode=disable

支持(默认关闭 SSL)

支持

支持

许可证

Apache-2.0

未声明

未声明

各异

各项目定位不同:需要完整读写与运维能力时,全功能服务器是合理选择;如果目标是让 Coding Agent 安全地探查数据(尤其在生产库上),只读约束与纵深防御是本项目的价值所在。 以上信息基于各项目公开 README 整理(2026-10),如有出入欢迎 提 Issue 指正。

安装

macOS / Linux(Homebrew):

brew install gxc/tap/gaussdb-ro-mcp
gaussdb-ro-mcp --version

从 Releases 下载对应平台的二进制 (linux-amd64 / linux-arm64 / darwin-arm64 / windows-amd64.exe;其他平台或内网环境可自行构建,见下节)。

Linux:

curl -LO https://github.com/gxc/gaussdb-ro-mcp/releases/latest/download/gaussdb-ro-mcp-linux-amd64
sudo install -Dm 755 gaussdb-ro-mcp-linux-amd64 /usr/local/bin/gaussdb-ro-mcp
gaussdb-ro-mcp --version

macOS(Apple Silicon):

curl -LO https://github.com/gxc/gaussdb-ro-mcp/releases/latest/download/gaussdb-ro-mcp-darwin-arm64
sudo install -Dm 755 gaussdb-ro-mcp-darwin-arm64 /usr/local/bin/gaussdb-ro-mcp
gaussdb-ro-mcp --version

Windows(PowerShell;放入 PATH 目录后即可直接调用):

Invoke-WebRequest -Uri "https://github.com/gxc/gaussdb-ro-mcp/releases/latest/download/gaussdb-ro-mcp-windows-amd64.exe" -OutFile "gaussdb-ro-mcp.exe"
Move-Item .\gaussdb-ro-mcp.exe "$env:LOCALAPPDATA\Microsoft\WindowsApps\"  # 该目录默认在 PATH 中
gaussdb-ro-mcp --version

各产物校验值见 Release 页的 SHA256SUMS.txt。

构建

要求 Go 1.26.10+(与 go.mod 一致)。驱动源码已内置于 third_party/gaussdb-go(通过 replace 指令引用), 正常联网环境下 go build 会自动解析其余依赖;纯内网环境请先在有网环境执行 go mod vendor 后携带 vendor/ 目录,用 go build -mod=vendor 构建。

go build -o gaussdb-ro-mcp ./cmd/gaussdb-ro-mcp
sudo install -Dm 755 gaussdb-ro-mcp /usr/local/bin/gaussdb-ro-mcp
gaussdb-ro-mcp --version

交叉编译其他平台(纯 Go,CGO_ENABLED=0 即可):CGO_ENABLED=0 GOOS=<os> GOARCH=<arch> go build -o ... ./cmd/gaussdb-ro-mcp。

配置

复制 gaussdb-ro-mcp.example.yaml 为 gaussdb-ro-mcp.yaml 并修改。 配置文件查找顺序:-config 参数 > 环境变量 GAUSSDB_RO_MCP_CONFIG > ./gaussdb-ro-mcp.yaml。

server:
  max_rows: 500          # execute_select 默认行数上限
  max_rows_cap: 10000    # 单次调用可放宽的硬上限
  statement_timeout: 30s
  connect_timeout: 10s

instances:
  - name: prod                    # 实例名称,工具调用时用 instance 参数引用
    host: 192.168.0.10
    port: 8000
    database: postgres
    user: readonly_user
    password: "****"
    sslmode: disable              # 内网非 SSL 默认值
  - name: dev
    dsn: "gaussdb://readonly_user:****@192.168.1.20:5432/appdb?sslmode=disable"

default_instance: prod

接入 Coding Agent

Claude Code

方式一:项目根目录 .mcp.json(或 claude mcp add 命令):

{
  "mcpServers": {
    "gaussdb-readonly": {
      "command": "/usr/local/bin/gaussdb-ro-mcp",
      "args": ["-config", "/path/to/gaussdb-ro-mcp.yaml"]
    }
  }
}
claude mcp add gaussdb-readonly -- /usr/local/bin/gaussdb-ro-mcp -config /path/to/gaussdb-ro-mcp.yaml

OpenCode

opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "gaussdb-readonly": {
      "type": "local",
      "command": ["/usr/local/bin/gaussdb-ro-mcp", "-config", "/path/to/gaussdb-ro-mcp.yaml"]
    }
  }
}

数据库侧只读账号(强烈建议)

CREATE USER readonly_user WITH PASSWORD 'your-strong-password';
GRANT USAGE ON SCHEMA public TO readonly_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly_user;
-- 其他模式按需逐个授权

即使数据库账号被限定为只读,本服务的 SQL 校验与会话强制仍会拦截 锁行(FOR UPDATE)、SELECT INTO、危险函数调用、长查询等行为。

日志

所有运行日志输出到 stderr(stdout 为 MCP 协议通道),包括配置加载、 数据源就绪、会话只读校验结果等,便于在代理客户端的 MCP 日志中排障。

开发与测试

go test ./...                       # 单元测试(SQL 校验、配置解析)
GAUSSDB_RO_MCP_TEST_DSN="host=... port=... user=... password=... dbname=... sslmode=disable" \
  go test -count=1 ./...            # 集成测试(需 GaussDB/openGauss 实例)

可用 Docker 快速起一个 openGauss 测试实例并灌入测试数据:

docker run -d --name opengauss-ro-test -e GS_PASSWORD='Gaussdb@123' \
  -p 127.0.0.1:15433:5432 --privileged docker.m.daocloud.io/enmotech/opengauss:latest

go run ./scripts/devseed "host=127.0.0.1 port=15433 user=gaussdb password=Gaussdb@123 dbname=postgres sslmode=disable"

集成测试覆盖:只读会话强制(服务端拒绝写入)、5 个工具的端到端行为、 真实二进制 stdio 子进程冒烟。注意:本驱动使用 GaussDB 扩展协议(3.51), 无法连接原生 PostgreSQL,集成测试需要真实的 GaussDB / openGauss 实例。

目录结构

cmd/gaussdb-ro-mcp/     程序入口(stdio MCP 服务器)
internal/config/        YAML 配置:多实例数据源、行数/超时等
internal/guard/         第 1 层防护:SQL 只读静态校验器
internal/db/            多实例连接池 + 第 2 层防护:会话级 READ ONLY 强制、元数据查询
internal/tools/         MCP 工具注册与实现
scripts/devseed/        集成测试数据灌入工具(开发用)
third_party/gaussdb-go/ GaussDB 官方 Go 驱动源码(go.mod replace 引用)

反馈与贡献

欢迎提交 Issue 和 Pull Request:

Available Tools

5 tools
describe_tableA

查看表/视图的完整结构:列清单(类型/可空/默认值/注释)、主键与约束、全部索引及其定义;视图返回视图定义 SQL,分区表返回分区清单。适用场景:编写或校对查询前了解表结构、关联键与索引设计。table 为必填(可来自 list_tables 的结果);schema 省略时自动在非系统模式中查找,存在同名表时请显式指定 schema。

NameRequiredDescriptionDefault
tableYes表名或视图名(必填),可来自 list_tables 的结果
schemaNo模式名,可来自 list_schemas 的结果;省略时自动在非系统模式中查找(歧义时报错)
instanceNo数据源名称,省略时使用默认实例。可选实例:demo(默认)

TDQS

A4.1/5.0
Behavior4/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. It discloses rich return contents (columns with nullability/defaults/comments, constraints, indexes, view SQL, partition lists) and schema resolution behavior (auto-search non-system schemas, error on ambiguity). It does not explicitly state read-only status or permission needs, but for an introspection tool this is substantial disclosure.

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?

Front-loaded with purpose, followed by usage context and then parameter notes, with no filler. The final clause repeats table/schema details already documented in the input schema, which slightly reduces conciseness.

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?

With no output schema and no annotations, the description supplies necessary return-value details and parameter resolution behavior, enough for correct invocation. It does not cover instance selection (left to the schema) or explicit read-only assurance, but those gaps are minor for a describe tool.

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 100%, so the baseline is 3. The description mostly restates details already present in the schema (table required, schema ambiguity handling) and omits the instance parameter entirely, adding little meaning beyond the structured fields.

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?

States a specific verb and resource (查看表/视图的完整结构) and enumerates the exact artifacts returned: columns, keys, constraints, indexes, view SQL, and partitions. It is unmistakably distinct from siblings like list_tables, list_schemas, and execute_select.

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?

Provides a clear use case (编写或校对查询前了解表结构、关联键与索引设计) and cross-references list_tables as a source for the required table parameter. It also warns about schema ambiguity. It lacks an explicit when-not statement or a named alternative such as execute_select for retrieving data.

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

execute_selectA

执行只读 SELECT 查询(本服务器唯一允许的 SQL 入口)。仅接受单条 SELECT/WITH 语句:拒绝 DML/DDL、SELECT INTO、FOR UPDATE/SHARE 行锁、多语句与危险函数;查询在服务端强制的只读事务中执行。适用场景:在 list_tables/describe_table 定位目标后做数据探查与统计(计数、聚合、抽样、排序取前 N 行)。max_rows 控制本次返回行数(默认取实例配置,受服务端硬上限约束);大结果集建议用 LIMIT 或聚合减少传输。

NameRequiredDescriptionDefault
sqlYes要执行的 SELECT 语句(必填),仅允许单条 SELECT/WITH 查询
instanceNo数据源名称,省略时使用默认实例。可选实例:demo(默认)
max_rowsNo本次返回的最大行数,默认取实例配置,上限受服务端限制

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so well: it enumerates what is rejected (DML/DDL, SELECT INTO, FOR UPDATE/SHARE row locks, multi-statement, dangerous functions) and states that execution happens inside a server-enforced read-only transaction. It also discloses that max_rows defaults to instance config and is bounded by a server hard cap, which is exactly the kind of constraint an agent needs to avoid failed or oversized calls.

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 text is front-loaded with the core purpose, then constraints, then usage, then the max_rows note — a logical progression with no filler. It is dense but every clause about rejection rules earns its place; the closing max_rows sentence is mildly redundant with the schema description.

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

Completeness5/5

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

For a mutation-free query tool with no annotations and no output schema, the description supplies the safety profile (read-only transaction, rejected statement types), the workflow position relative to siblings, and the row-limit behavior. An agent has everything needed to construct a valid call and anticipate rejection conditions.

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 100%, so the schema already documents sql, instance, and max_rows, giving a baseline of 3. The description largely restates those constraints (single SELECT/WITH, default row limit, server cap) without adding syntax, format, or error-handling detail beyond the schema; the instance parameter is not elaborated on at all.

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 verb and resource (execute a read-only SELECT query) and immediately frames scope: '本服务器唯一允许的 SQL 入口' (the only allowed SQL entry point on this server). It also distinguishes itself from siblings by describing the workflow with list_tables/describe_table as the locating step, so an agent can tell it apart from the metadata tools without opening any schema.

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

Usage Guidelines5/5

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

Usage is explicit: use it after locating a target via list_tables/describe_table for data exploration and statistics (counts, aggregation, sampling, top-N ordering). It also gives an operational alternative rule — prefer LIMIT or aggregation for large result sets to reduce transfer. Both when-to-use and the sibling workflow are stated, leaving little to inference.

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

list_schemasA

列出 GaussDB 数据库中的 schema(模式)清单,含每个模式下的对象数量与注释,默认排除系统模式。适用场景:探查数据库的第一步——先确定业务模式名称,再用 list_tables 查看其中的表。include_system 为 true 时包含 pg_catalog、information_schema 等系统模式(一般仅在排查系统对象时需要)。

NameRequiredDescriptionDefault
instanceNo数据源名称,省略时使用默认实例。可选实例:demo(默认)
include_systemNo是否包含系统模式(pg_catalog 等),默认 false

TDQS

A4.3/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 burden and does well: it discloses the default system-schema exclusion, the optional inclusion of pg_catalog/information_schema, and the returned payload (object counts and comments). It does not explicitly state read-only semantics or any permission constraints, which keeps it short of a 5.

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?

Well front-loaded: purpose and default behavior first, then usage scenario, then the include_system caveat. Slightly dense for a two-parameter list tool, but each clause (defaults, usage order, system-schema caveat) carries distinct 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?

No output schema or annotations exist, and the description compensates by naming the returned fields (object counts, comments) and the default filtering behavior. Near-complete for such a simple tool; only explicit read-only confirmation is absent.

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 100%, so both parameters are already documented in the schema; the baseline is 3. The description reinforces include_system's default and motivation but adds little syntax or format detail beyond the schema itself.

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?

States a specific verb and resource ('list schemas in GaussDB'), plus what each entry contains (object counts and comments) and the default exclusion of system schemas. It is immediately distinguishable from siblings like list_tables, which it explicitly routes to.

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('the first step in exploring the database'), the follow-up action ('then use list_tables to view tables'), and a narrow condition for the include_system alternative ('generally only when troubleshooting system objects'). No inference required.

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

list_tablesA

列出 GaussDB 数据库中的表和视图清单:名称、类型(表/视图/物化视图/分区表/外表)、估算行数与注释。schema 参数可过滤到指定模式(可来自 list_schemas 的结果),省略时扫描全部非系统模式。适用场景:定位目标表后,用 describe_table 查看结构或用 execute_select 抽样查询。大型库建议传 schema 缩小扫描范围。

NameRequiredDescriptionDefault
schemaNo限定模式名(schema),省略时扫描全部非系统模式
instanceNo数据源名称,省略时使用默认实例。可选实例:demo(默认)
include_systemNo是否包含系统模式,默认 false

TDQS

A4.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 burden and does well: it discloses the exact result fields, the default scan scope (all non-system schemas when schema is omitted), and a performance caveat for large databases. It stops short of stating permission/auth requirements or ordering/pagination, but covers what an agent needs to invoke it safely.

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?

Front-loaded with the resource and return fields, then usage and the filtering tip. Every sentence carries information, though the final sentence partially restates the schema-omission behavior already stated earlier.

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

Completeness5/5

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

No output schema exists, so the description must explain returns, which it does by listing the returned columns. Combined with usage routing and the filtering/performance caveat, nothing an agent needs to call this correctly 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?

Schema coverage is already 100%, so the baseline is 3, but the description adds real value beyond the schema by explaining where the schema value comes from (list_schemas output) and why to supply it (narrow scan range). Remaining parameters are only reinforced, not extended, so it lands at 4.

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?

States a specific verb+resource (list tables/views in GaussDB) and enumerates exactly what the result contains (name, type, estimated row count, comment). It clearly distinguishes itself from siblings by naming describe_table, execute_select and list_schemas by their distinct roles.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance: locate a table here, then use describe_table for structure or execute_select for sampling. It also names the alternative source of the schema value (list_schemas) and the large-database condition that favors passing schema.

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

test_connectionA

测试 GaussDB 数据源连通性,返回服务器版本、当前数据库、用户、只读状态与连接耗时。建议在会话开始或其他工具调用前先执行,确认数据源可达且只读事务生效;也用于排查连接、凭据或超时问题。不指定 instance 时测试默认实例。

NameRequiredDescriptionDefault
instanceNo数据源名称,省略时使用默认实例。可选实例:demo(默认)

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description must carry the behavioral burden, and it does disclose the observable outcome (version, current DB, user, read-only status, latency) plus the read-only transaction angle, which signals a non-mutating probe. It stops short of explicitly stating there are no side effects or what a failure response looks like, so it is strong but not exhaustive.

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?

Front-loads the purpose, then returns, then usage recommendation, then the parameter default — a sensible ordering with no filler. It is slightly longer than strictly necessary because the return list and the parameter default are stated in separate clauses, but nothing is wasted.

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?

There is no output schema and no annotations, so the description must explain both purpose and returns, which it does by listing the five returned values. Usage context and the default-instance rule are also covered, leaving only failure/error semantics unspecified for a simple connectivity probe.

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 100%, and the single optional 'instance' parameter is fully documented in the schema (name, default, available value demo). The description only restates the default-instance behavior, adding no new syntax or format detail beyond the schema. Baseline 3 applies when the schema does the work.

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?

States a specific verb and resource (test GaussDB data source connectivity) and enumerates the concrete return contents: server version, current database, user, read-only status, and latency. This is unmistakably distinct from the schema/query-oriented siblings (describe_table, execute_select, list_schemas, list_tables), which do not probe connectivity.

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?

Gives clear when-to-use context: run at session start or before other tool calls to confirm reachability and read-only transaction enforcement, and use it to diagnose connection, credential, or timeout problems. It also resolves the no-instance case. There is no explicit when-not-to-use or named alternative, but no sibling overlaps in function, so the guidance is effectively complete.

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.

  1. 5 tool updatesv0.3.0
    • Changeddescribe_table1 field changed
      • changedInput schema / properties / instance / description
        Previous value: -"数据源名称(配置文件中 instance 的 name),省略时使用默认实例"New value: +"数据源名称,省略时使用默认实例。可选实例:demo(默认)"
    • Changedexecute_select1 field changed
      • changedInput schema / properties / instance / description
        Previous value: -"数据源名称(配置文件中 instance 的 name),省略时使用默认实例"New value: +"数据源名称,省略时使用默认实例。可选实例:demo(默认)"
    • Changedlist_schemas1 field changed
      • changedInput schema / properties / instance / description
        Previous value: -"数据源名称(配置文件中 instance 的 name),省略时使用默认实例"New value: +"数据源名称,省略时使用默认实例。可选实例:demo(默认)"
    • Changedlist_tables1 field changed
      • changedInput schema / properties / instance / description
        Previous value: -"数据源名称(配置文件中 instance 的 name),省略时使用默认实例"New value: +"数据源名称,省略时使用默认实例。可选实例:demo(默认)"
    • Changedtest_connection1 field changed
      • changedInput schema / properties / instance / description
        Previous value: -"数据源名称(配置文件中 instance 的 name),省略时使用默认实例"New value: +"数据源名称,省略时使用默认实例。可选实例:demo(默认)"
  2. 1 tool updatev0.2.6
    • Changeddescribe_table2 fields changed
      • changedInput schema / properties / schema / description
        Previous value: -"模式名,省略时自动在非系统模式中查找(歧义时报错)"New value: +"模式名,可来自 list_schemas 的结果;省略时自动在非系统模式中查找(歧义时报错)"
      • changedInput schema / properties / table / description
        Previous value: -"表名或视图名(必填)"New value: +"表名或视图名(必填),可来自 list_tables 的结果"
  3. 5 tool updatesv0.2.2
    • First observeddescribe_table
    • First observedexecute_select
    • First observedlist_schemas
    • First observedlist_tables
    • First observedtest_connection

TDQS

A4.4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct role: connectivity testing, schema listing, table listing, table structure inspection, and read-only query execution. The discovery flow is explicit and there is no overlap between tools.

Naming Consistency5/5

All tool names use consistent snake_case verb_noun naming: list_schemas, list_tables, describe_table, execute_select, test_connection. The convention is predictable throughout.

Tool Count5/5

Five tools is well-scoped for a read-only GaussDB exploration server. Each tool earns its place and supports a distinct step in the discovery/query workflow.

Completeness5/5

The surface covers the full read-only lifecycle: connectivity check, schema discovery, table/view discovery, structural inspection, and SELECT querying. No write operations are expected for a read-only server, and no obvious dead ends are present.

Maintenance

ActivityActive
ResponsivenessResponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A read-only PostgreSQL MCP server that enables AI agents to perform schema introspection and execute SELECT-only queries. It supports secure database connections through SSL and SSH tunnels while offering a structure-only mode to restrict query access.
    10 npm
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A read-only MCP server that enables users to query and explore StarRocks databases through AI assistants like Claude. It supports SQL execution, schema discovery, and secure LDAP authentication for data analysis and metadata exploration.
    4
    1
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A read-only MCP server for exploratory data analysis across PostgreSQL, MySQL, and ClickHouse databases, providing safe, read-only access with comprehensive analysis capabilities.
    10
    333 PyPI
    6
    MIT