SuperAPIAI Directory

gaussdb-ro-mcp

github.com · AI developer platforms

gaussdb-ro-mcp is a Huawei GaussDB read-only MCP server for Coding Agents (such as Claude Code, OpenCode, etc.). It is based on the official GaussDB Go driver (Huawei Cloud's officially open-sourced pgx v5 adapted version, with source code built into the repository at third_party/gaussdb-go, supporting offline builds), and provides database read-only exploration tools via stdio transport. The project enforces read-only through a three-layer mechanism: static SQL validation, server-side READ ONLY transactions, and least-privilege account guidance, and is distributed as a single static binary, designed specifically for intranet non-SSL environments (sslmode=disable by default). The configuration file supports managing multiple GaussDB instances simultaneously. All tools accept an optional instance parameter to select the data source; when omitted, default_instance is used. Instance names are written into the parameter schema description, making it easy for agents to discover available instances at the tool-list retrieval stage.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsWindows · Linux

About this tool

Purpose

gaussdb-ro-mcp is a read-only MCP server for Coding Agents (Claude Code, OpenCode, etc.), used to let agents safely explore Huawei GaussDB (centralized and distributed) databases. The project's positioning emphasizes: if full read-write and operations capabilities are needed, a full-featured server should be chosen; if the goal is to let a Coding Agent safely explore data (especially on production databases), the read-only constraints and defense in depth are the value of this project.

Main capabilities

  • Provides database read-only exploration tools via stdio transport, 5 tools in total (integration tests cover their end-to-end behavior).
  • Three-layer read-only enforcement: static SQL validation, server-side READ ONLY transactions, least-privilege account guidance.
  • Even if the database account is restricted to read-only, SQL validation and session enforcement still block row locking (FOR UPDATE), SELECT INTO, dangerous function calls, long queries, and other behaviors.
  • Multi-instance management: the configuration file supports managing multiple GaussDB instances simultaneously; all tools accept an optional instance parameter, defaulting to default_instance; all instance names (including the default annotation) are written into that parameter's schema description, so the agent can discover available instances at the tool-list retrieval stage without trial and error.
  • Designed specifically for intranet non-SSL environments, with sslmode=disable by default.
  • Distributed as a single static binary, supporting offline builds (the driver source is built into third_party/gaussdb-go and referenced via a replace directive).
  • All runtime logs are output to stderr (stdout is the MCP protocol channel), including configuration loading, data source readiness, session read-only validation results, etc., for troubleshooting in the proxy client's MCP logs.

Usage

Installation: platform binaries (linux-amd64 / linux-arm64 / darwin-arm64 / windows-amd64.exe) can be downloaded from Releases; for other platforms or intranet environments, you can build it yourself; checksums for each artifact are in SHA256SUMS.txt on the Release page.

Build: requires Go 1.26.10+ (consistent with go.mod). In a normal networked environment, go build will automatically resolve the remaining dependencies;For a pure intranet environment, first run go mod vendor in a networked environment, then carry the vendor/ directory and build with go build -mod=vendor. Cross-compiling for other platforms (pure Go, CGO_ENABLED=0 is sufficient): CGO_ENABLED=0 GOOS=<os> GOARCH=<arch> go build -o ... ./cmd/gaussdb-ro-mcp.

Configuration: copy gaussdb-ro-mcp.example.yaml to gaussdb-ro-mcp.yaml and modify it. Configuration file lookup order: -config parameter > environment variable GAUSSDB_RO_MCP_CONFIG > ./gaussdb-ro-mcp.yaml.

Integrating with a Coding Agent: method one is the .mcp.json in the project root directory (or the claude mcp add command); OpenCode uses opencode.json configuration.

Testing: you can use Docker to quickly start an openGauss test instance and load test data. Integration tests cover read-only session enforcement (the server rejects writes), end-to-end behavior of the 5 tools, and a smoke test of the real binary as a stdio subprocess. Note: this driver uses the GaussDB extended protocol (3.51) and cannot connect to native PostgreSQL; integration tests require a real GaussDB / openGauss instance.

Applicable Scenarios

  • Let a Coding Agent safely explore data structures and data on development or production GaussDB databases.
  • Read-only database access in intranet non-SSL environments.
  • Agent workflows that need to manage multiple GaussDB instances simultaneously.

Limitations

  • Only read-only capabilities are provided; full read-write and operations capabilities are not provided.
  • The driver uses the GaussDB extended protocol (3.51) and cannot connect to native PostgreSQL.
  • Integration tests require a real GaussDB / openGauss instance.
  • Building requires Go 1.26.10+; pure intranet builds require dependencies to be vendored in advance.
  • For the specific tool list, configuration field details, and integration example code, please refer to the repository README and README_en.md.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools