by yugabyte
Provides an MCP interface for YugabyteDB, enabling LLMs to list tables, run read‑only queries and receive JSON results.
Enables large language models to directly interact with a YugabyteDB instance via the Model Context Protocol. The server can enumerate tables, expose schema details, and execute read‑only SQL queries, returning the results as JSON.
git clone git@github.com:yugabyte/yugabytedb-mcp-server.git
cd yugabytedb-mcp-server
uv
)
uv sync
.env
file or export the environment variable:
YUGABYTEDB_URL=postgresql://user:password@localhost:5433/yugabyte
uv run src/server.py
uv run src/server.py --transport http
docker build -t mcp/yugabytedb .
docker run -p 8080:8080 -e YUGABYTEDB_URL="postgresql://user:password@localhost:5433/yugabyte" mcp/yugabytedb
Q: Which Python version is required? A: Python 3.10 or newer.
Q: Can I use the server with a non‑Yugabyte PostgreSQL instance? A: The server expects a YugabyteDB connection string; compatibility with vanilla PostgreSQL is not guaranteed.
Q: How do I restrict the server to read‑only access? A: The server only runs read‑only queries; ensure the database user has limited privileges.
Q: What environment variable must be set?
A: YUGABYTEDB_URL
with the full connection string.
Q: I get spawn uv ENOENT
on macOS.
A: Symlink uv
to a directory in your PATH, e.g., sudo ln -s "$(which uv)" /usr/local/bin/uv
.
Q: Where can I view logs for my MCP client?
A: Claude Desktop logs are in ~/Library/Logs/Claude
(macOS) or %APPDATA%\Claude\Logs
(Windows); Cursor logs appear in the Output panel under "Cursor MCP".
An MCP server implementation for YugabyteDB that allows LLMs to directly interact with your database.
Clone this repository and install dependencies:
git clone git@github.com:yugabyte/yugabytedb-mcp-server.git
cd yugabytedb-mcp-server
uv sync
The server is configured using the following environment variable:
YUGABYTEDB_URL
: The connection string for your YugabyteDB database (e.g., dbname=database_name host=hostname port=5433 user=username password=password
)Example .env
file:
YUGABYTEDB_URL=postgresql://user:password@localhost:5433/yugabyte
You can run the server with STDIO
transport using uv:
uv run src/server.py
or with Streamable-HTTP
transport:
uv run src/server.py --transport http
Build the Docker image:
docker build -t mcp/yugabytedb .
Run the container with STDIO
transport:
docker run -p 8080:8080 -e YUGABYTEDB_URL="your-db-url" mcp/yugabytedb
or with Streamable-HTTP
transport:
docker run -p 8080:8080 -e YUGABYTEDB_URL="your-db-url" mcp/yugabytedb --transport=http
To use this server with an MCP client (e.g., Claude Desktop, Cursor), add it to your MCP client configuration.
uv
Example configuration for Cursor:
{
"mcpServers": {
"yugabytedb-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/cloned/yugabytedb-mcp-server/",
"run",
"src/server.py"
],
"env": {
"YUGABYTEDB_URL": "dbname=database_name host=hostname port=5433 user=username password=password load_balance=true topology_keys=cloud.region.zone1,cloud.region.zone2"
}
}
}
}
/path/to/cloned/yugabytedb-mcp-server/
with the path to your cloned repository.env
section.After building the docker container, add the following to claude_config.json
entry or equivalent json files for other editors:
{
"mcpServers": {
"yugabytedb-mcp-docker": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"YUGABYTEDB_URL=dbname=yugabyte host=host.docker.internal port=5433 user=yugabyte password=yugabyte load_balance=false",
"mcp/yugabytedb"
]
}
}
}
mcpServers
.The logs for Claude Desktop can be found in the following locations:
The logs can be used to diagnose connection issues or other problems with your MCP server configuration. For more details, refer to the official documentation.
In the bottom panel of Cursor, click on "Output" and select "Cursor MCP" from the dropdown menu to view server logs. This can help diagnose connection issues or other problems with your MCP server configuration.
Start the server using Streamable-HTTP:
uv run src/server.py --transport http
Or with Docker:
docker run -p 8080:8080 -e YUGABYTEDB_URL="..." mcp/yugabytedb --transport=http
Launch the inspector:
npx @modelcontextprotocol/inspector
In the GUI, use the URL:
http://localhost:8080/invocations/mcp
Streamable-HTTP
Once connected via an MCP client, you can:
YUGABYTEDB_URL
: (required) The connection string for your YugabyteDB/PostgreSQL databaseYUGABYTEDB_URL
is set and correctuv
is installed and available in your PATH. Note: If claude is unable to access uv, giving the error: spawn uv ENOENT
, try symlinking the uv for global access:sudo ln -s "$(which uv)" /usr/local/bin/uv
pyproject.toml
src/server.py
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by googleapis
Provides a configurable MCP server that abstracts connection pooling, authentication, observability, and tool management to accelerate development of database‑backed AI tools.
by bytebase
DBHub is a universal database gateway that implements the Model Context Protocol (MCP) server interface, enabling MCP-compatible clients to interact with various databases.
by neo4j-contrib
Provides Model Context Protocol servers for interacting with Neo4j databases, managing Aura instances, and handling personal knowledge graph memory through natural‑language interfaces.
by mongodb-js
Provides a Model Context Protocol server that connects to MongoDB databases and Atlas clusters, exposing a rich set of tools for querying, managing, and administering data and infrastructure.
by benborla
A Model Context Protocol (MCP) server that provides read-only access to MySQL databases, enabling Large Language Models (LLMs) to inspect database schemas and execute read-only queries.
by ClickHouse
Provides tools that let AI assistants run read‑only SQL queries against ClickHouse clusters or the embedded chDB engine, plus a health‑check endpoint for service monitoring.
by elastic
Provides direct, natural‑language access to Elasticsearch indices via the Model Context Protocol, allowing AI agents to query and explore data without writing DSL.
by motherduckdb
Provides an MCP server that enables SQL analytics on DuckDB and MotherDuck databases, allowing AI assistants and IDEs to execute queries via a unified interface.
by redis
Provides a natural language interface for agentic applications to manage and search data in Redis efficiently.