GaussDB Read-Only MCP
io.github.gxcPublished by GitHub account gxcv0.3.0Updated Oct 24, 2026
Read-only MCP server for Huawei GaussDB (centralized & distributed), built for coding agents.
The publisher's own server: OnlyMCP
Overview
Read-only MCP server for Huawei GaussDB that lets a coding agent inspect schemas, tables and indexes and run single SELECT queries safely.
- What you can do
- Test connectivity to a configured GaussDB instance and report version, current database/user, read-only state and latency
- List schemas with object counts and comments, optionally including system schemas
- List tables and views with type, estimated row counts and comments, filtered by schema
- Describe a table's columns, keys, constraints and all index definitions; return view SQL and partition lists
- Run a single SELECT or WITH query with row and timeout limits, returning columns, rows and a truncation flag
- When to use it
- Useful when a coding agent needs to explore a GaussDB database (centralized or distributed) without write risk, especially against production or intranet instances where only read access is wanted. It suits schema discovery and ad-hoc SELECT queries rather than data modification or administration.
- Requirements
- Runs as a local static binary (Homebrew, release download, or Go build) over stdio; no Node.js or other runtime needed. Needs a YAML config file, located via the -config flag, the GAUSSDB_RO_MCP_CONFIG environment variable, or a default path, holding host, port, database, user and password for one or more instances. Network access to the GaussDB server is required; SSL is disabled by default for intranet use.
Installation
In SourceWeft
- Open GaussDB Read-Only MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
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 ONLYtransactions, 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 实例。
只读保障(三层纵深防御)
提供的 MCP 工具
所有工具均接受可选 instance 参数以选择数据源,缺省使用 default_instance。全部实例名(含默认标注)会写入该参数的 schema 描述,agent 在获取工具列表阶段即可发现可选实例,无需试错。
与同类项目对比
各项目定位不同:需要完整读写与运维能力时,全功能服务器是合理选择;如果目标是让 Coding Agent 安全地探查数据(尤其在生产库上),只读约束与纵深防御是本项目的价值所在。 以上信息基于各项目公开 README 整理(2026-10),如有出入欢迎 提 Issue 指正。
安装
macOS / Linux(Homebrew):
从 Releases 下载对应平台的二进制
(linux-amd64 / linux-arm64 / darwin-arm64 / windows-amd64.exe;其他平台或内网环境可自行构建,见下节)。
Linux:
macOS(Apple Silicon):
Windows(PowerShell;放入 PATH 目录后即可直接调用):
各产物校验值见 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,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。
接入 Coding Agent
Claude Code
方式一:项目根目录 .mcp.json(或 claude mcp add 命令):
OpenCode
opencode.json:
数据库侧只读账号(强烈建议)
即使数据库账号被限定为只读,本服务的 SQL 校验与会话强制仍会拦截
锁行(FOR UPDATE)、SELECT INTO、危险函数调用、长查询等行为。
日志
所有运行日志输出到 stderr(stdout 为 MCP 协议通道),包括配置加载、 数据源就绪、会话只读校验结果等,便于在代理客户端的 MCP 日志中排障。
开发与测试
可用 Docker 快速起一个 openGauss 测试实例并灌入测试数据:
集成测试覆盖:只读会话强制(服务端拒绝写入)、5 个工具的端到端行为、 真实二进制 stdio 子进程冒烟。注意:本驱动使用 GaussDB 扩展协议(3.51), 无法连接原生 PostgreSQL,集成测试需要真实的 GaussDB / openGauss 实例。
目录结构
反馈与贡献
欢迎提交 Issue 和 Pull Request:
- 问题反馈 / 功能建议:https://github.com/gxc/gaussdb-ro-mcp/issues
- 获取最新版本:https://github.com/gxc/gaussdb-ro-mcp/releases/latest
- 提交 PR 前,请确保
go vet ./...与go test ./...通过;涉及安全防护逻辑(SQL 静态校验 / 只读强制)的改动请附带回归测试
Source: README.md at commit 7f4c95d
Tools
0Version history
5- v0.3.0LatestOct 21, 2026
- v0.2.5Oct 19, 2026
- v0.2.4Sep 29, 2026
- v0.2.3Sep 23, 2026
- v0.2.2Sep 22, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Other Only-Mcp integrations

OnlyMCP
com.only-mcpOfficial publisher
Cloud service for skills, agents and memory that also acts as a gateway to your other MCP servers, usable as a remote endpoint or via npx.

OpenVibeCoding Read-only MCP
Published by GitHub account xiaojiou176-open
A read-only MCP server that lets an assistant inspect OpenVibeCoding runs, workflows, proofs, queues, replays and incidents on the local machine.

CortexPilot Read-only MCP
Published by GitHub account xiaojiou176-open
Read-only MCP server exposing CortexPilot workflow, queue, proof, replay and incident summaries to an assistant.

macOS-only MCP server that exposes iMessage chat
Published by GitHub account adelaidasofia
macOS-only local MCP server that lets an assistant read iMessage history from chat.db, search it, and export chats to an Obsidian vault.