by yugabyte
Enables large language models to directly query YugabyteDB, list tables with schemas and row counts, and execute read‑only SQL statements returning JSON results.
YugabyteDB MCP Server provides an implementation of the Model Context Protocol (MCP) that connects LLMs with a YugabyteDB instance. It exposes database metadata and read‑only query capabilities through a lightweight server that can be run locally or in a container.
git clone https://github.com/yugabyte/yugabytedb-mcp-server.git
cd yugabytedb-mcp-server
uv sync
YUGABYTEDB_URL
environment variable (e.g., in a .env
file).uv run src/server.py
uv run src/server.py --transport http
SELECT
queries; results are returned as JSON.uv
for dependency management.mcp/yugabytedb
) with appropriate environment variables and security hardening.uv
is not found?
Ensure uv
is installed and on your PATH
; alternatively, symlink it to /usr/local/bin/uv
as the troubleshooting guide suggests.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.
{ "mcpServers": { "yugabytedb-mcp": { "command": "uv", "args": [ "run", "src/server.py" ], "env": { "YUGABYTEDB_URL": "postgresql://user:password@localhost:5433/yugabyte" } } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by googleapis
An MCP server that streamlines database tool development by handling connection pooling, authentication, observability, and secure access, allowing agents to interact with databases via natural language.
by bytebase
Provides a universal gateway that lets MCP‑compatible clients explore and query MySQL, PostgreSQL, SQL Server, MariaDB, and SQLite databases through a single standardized interface.
by designcomputer
Enables secure interaction with MySQL databases via the Model Context Protocol, allowing AI applications to list tables, read contents, and execute queries safely.
by benborla
Provides read‑only access to MySQL databases for large language models, allowing schema inspection and safe execution of SQL queries.
by ClickHouse
Enables AI assistants to run read‑only ClickHouse queries, list databases and tables, and execute embedded chDB queries through an MCP interface.
by chroma-core
Offers an MCP server exposing Chroma's vector database capabilities for LLM applications, supporting collection and document management, multiple embedding functions, and flexible client types such as in‑memory, persistent, HTTP, and cloud.
by kiliczsh
Enables LLMs to interact with MongoDB databases via a standardized interface, offering schema inspection, query execution, aggregation, and write capabilities, with optional read‑only mode and smart ObjectId handling.
by domdomegg
Provides read and write access to Airtable bases for AI systems, enabling inspection of schemas and manipulation of records.
by XGenerationLab
A Model Context Protocol (MCP) server that enables natural language queries to databases