
yugabyte/yugabytedb-mcp-server
Database managementこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
MCP Server to interact with data in YugabyteDB
概要
An MCP server for YugabyteDB and PostgreSQL — lets LLMs (Claude Desktop, Cursor, Windsurf, etc.) summarize schemas, run read-only queries, and execute write statements behind a configurable guardrail layer. - — list tables with columns and row counts for a schema (read-only) - — execute a SELECT under BEGIN READ ONLY; results returned as JSON (read-only) - — INSERT/UPDATE/DELETE/MERGE/TRUNCATE/DDL gated by a guardrail blocklist (destructive, — enable with --enable-write-query or YB_MCP_ENABLE_WRITE_QUERY=true) Defense in depth: the write tool is annotated destructiveHint: true, so Claude Desktop surfaces a confirmation prompt before every call even when the guardrails would let the statement through. Optional OAuth (AWS Cognito) and Origin-header validation for self-hosted remote deployments. - Python 3.10+ - uv (recommended) or pip - A reachable YugabyteDB or PostgreSQL database - An MCP client (Claude Desktop, Cursor, Windsurf, etc.
README
以下は原文 README の抜粋です。原文を見る。
YugabyteDB MCP Server
An MCP server for YugabyteDB and PostgreSQL — lets LLMs (Claude Desktop, Cursor, Windsurf, etc.) summarize schemas, run read-only queries, and execute write statements behind a configurable guardrail layer.
Features
summarize_database— list tables with columns and row counts for a schema (read-only)run_read_only_query— execute a SELECT underBEGIN READ ONLY; results returned as JSON (read-only)run_write_query— INSERT/UPDATE/DELETE/MERGE/TRUNCATE/DDL gated by a guardrail blocklist (destructive, disabled by default — enable with--enable-write-queryorYB_MCP_ENABLE_WRITE_QUERY=true)
Defense in depth: the write tool is annotated destructiveHint: true, so Claude Desktop surfaces a confirmation prompt before every call even when the guardrails would let the statement through.
Optional OAuth (AWS Cognito) and Origin-header validation for self-hosted remote deployments.
Prerequisites
- Python 3.10+
- uv (recommended) or pip
- A reachable YugabyteDB or PostgreSQL database
- An MCP client (Claude Desktop, Cursor, Windsurf, etc.)
Installation
Three install options, in roughly the order of how end users will reach for them:
# uvx — no install at all; fetches and runs on demand. Handy for one-off use
# and also the form the MCPB Desktop extension uses internally.
uvx yugabytedb-mcp-server --help
# pipx — installs to an isolated venv, puts the script on $PATH.
pipx install yugabytedb-mcp-server
# uv tool — same idea, uv-managed.
uv tool install yugabytedb-mcp-server
# pip — system-level or current-venv install.
pip install yugabytedb-mcp-server
After any of the persistent installs (pipx / uv tool / pip), verify with:
yugabytedb-mcp --help
# or, equivalently:
yugabytedb-mcp-server --help
Both console scripts are registered and point at the same entry point —
yugabytedb-mcp is the short form, yugabytedb-mcp-server matches the
package name and is what uvx resolves to by default.
Pre-release note: while v2 is in release-candidate (e.g.
2.0.0rc2), default installs won’t pick it up. For now, install with an explicit version (pipx install yugabytedb-mcp-server==2.0.0rc2) or with--pip-args='--pre'. This goes away once2.0.0stable is published.
For development from source, see Development below.
Configuration
| Environment Variable | CLI flag | Required | Description |
|---|---|---|---|
YUGABYTEDB_URL |
--yugabytedb-url |
Yes | libpq connection string (e.g. host=… port=5433 dbname=… user=… password=…). |
YB_MCP_TRANSPORT |
--transport |
No | stdio (default) or http. |
YB_MCP_STATELESS_HTTP |
--stateless-http |
No | true enables stateless Streamable-HTTP — required for multi-replica self-hosted deployments. |
インストール
uvx yugabytedb-mcp-server設定
{
"mcpServers": {
"yugabytedb": {
"command": "uvx",
"args": ["yugabytedb-mcp-server"],
"env": {
"YUGABYTEDB_URL": "host=… port=5433 dbname=… user=… password=…"
}
}
}
}