# GaussDB Read-Only MCP

> GaussDB Read-Only MCP is an open-source MCP server for databases. Read-only MCP server letting coding agents inspect Huawei GaussDB databases safely. It is available on CLI, Linux, macOS, Windows and self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Windows, self-hosted
- **Repository:** https://github.com/gxc/gaussdb-ro-mcp
- **GitHub stars:** 1
- **License:** Apache-2.0
- **MCP Registry name:** io.github.gxc/gaussdb-ro-mcp
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-11-18

## About

The README describes a Go binary that gives coding agents such as Claude Code and OpenCode a set of read-only tools for exploring GaussDB instances over stdio. Queries pass a static SQL check that accepts only a single SELECT or WITH statement, then run inside a transaction forced into READ ONLY mode on the server, so writes are refused even if the static check is bypassed.

The server is configured through a YAML file that can hold several GaussDB instances, with one marked as default and tools selecting others by an instance parameter. It targets intranet deployments where SSL is not used, with sslmode defaulting to disable. The README also recommends a database account granted only SELECT privileges.

It suits teams who want an agent to query or read schema from production-like GaussDB or openGauss databases without giving it write access. The README notes that the driver speaks the GaussDB extended protocol, so it will not connect to native PostgreSQL.

## Features

- **Static SQL validation:** Rejects DML, DDL, SELECT INTO, row locks, multi-statement input and a configurable list of dangerous functions before execution.
- **Server-side read-only transactions:** Each query runs in an explicit transaction set to READ ONLY, with a statement timeout applied.
- **Multi-instance configuration:** A single YAML file defines several database instances, and tools pick one through the instance argument.
- **Schema and table inspection:** Tools list schemas and tables and describe columns, constraints, indexes, views and partitions.
- **Row-limited SELECT execution:** Returns column names, rows and a truncation flag, with default and capped row limits.
- **Single static binary:** Built with CGO disabled and an embedded driver copy, so it can be deployed offline on intranet hosts.

## Good for

- Letting a coding agent explore a GaussDB schema while writing application code
- Checking table structure, indexes and partitions before writing a migration
- Running ad hoc read queries against a production-like database without write risk
- Giving analysts an agent-driven read path to multiple intranet GaussDB instances

## Tools

- `test_connection`: Connectivity test reporting server version, current database and user, read-only status and latency.
- `list_schemas`: Lists schemas with object counts and comments, optionally including system schemas.
- `list_tables`: Lists tables and views with type, estimated row count and comments, filterable by schema.
- `describe_table`: Describes columns, keys, constraints, indexes, view definitions and partition lists.
- `execute_select`: Runs a single SELECT or WITH statement subject to row and timeout limits.

## FAQ

### Can it write data to the database?

No. The README describes static checks that block DML and DDL, and server-side READ ONLY transactions that reject writes.

### Does it work with native PostgreSQL?

The README says it will not connect to native PostgreSQL because the driver uses the GaussDB extended protocol, and integration tests need a real GaussDB or openGauss instance.

### Which agents are supported?

The README gives configuration examples for Claude Code and OpenCode.

### How is it installed?

The README covers Homebrew, direct binary downloads for Linux, macOS and Windows, and building from source with Go 1.26.10 or later.

### Is GaussDB Read-Only MCP free?

Yes. GaussDB Read-Only MCP is open source, so you can use and self-host it for free.

### What are the best alternatives to GaussDB Read-Only MCP?

The closest alternatives to GaussDB Read-Only MCP are Pg Readonly MCP, Mysql, Mcpg, Db Conn MCP and BigQuery MCP.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.

## Alternatives

- [Pg Readonly MCP](https://ai-powered.com/mcp/pg-readonly-mcp): Pg Readonly MCP is an open-source MCP server for databases.
- [Mysql](https://ai-powered.com/mcp/mysql): Mysql is an open-source MCP server for databases.
- [Mcpg](https://ai-powered.com/mcp/mcpg): Mcpg is an open-source MCP server for databases.
- [Db Conn MCP](https://ai-powered.com/mcp/db-conn-mcp): Db Conn MCP is an MCP server for databases.
- [BigQuery MCP](https://ai-powered.com/mcp/bigquery-mcp): BigQuery MCP is an open-source MCP server for databases.
- [Universal DB (read-only)](https://ai-powered.com/mcp/universal-db-read-only): Universal DB (read-only) is an open-source MCP server for databases.
- [AdoMcp](https://ai-powered.com/mcp/adomcp): AdoMcp is an open-source MCP server for databases.
- [MCP Toolbox for Databases](https://ai-powered.com/mcp/mcp-toolbox-for-databases-2): MCP Toolbox for Databases is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/gaussdb-read-only-mcp
