The YugabyteDB MCP Server acts as a bridge between artificial intelligence and a YugabyteDB database, allowing AI models to "talk" directly to stored data. Instead of a developer manually copying and pasting database schemas or query results into a chat window, this tool enables AI coding assistants and chat clients to access the data source autonomously. This makes it incredibly easy for an AI to understand the structure of a database and provide answers based on real-time information. Technically, the server is built using the Model Context Protocol (MCP) and the FastMCP framework to provide specific capabilities to any compatible LLM. It offers a `summarize_database` tool, which fetches a comprehensive list of all tables along with their schemas and row counts, giving the AI a bird's-eye view of the data architecture. Furthermore, the `run_read_only_query` tool enables the model to execute SQL commands and receive results in JSON format, ensuring that the AI can perform data analysis or retrieve specific records safely within a read-only environment. For developers, this integration streamlines the development workflow by allowing tools like Claude Desktop, Cursor, or Windsurf to interact with distributed SQL workloads seamlessly. The server is highly flexible, supporting both STDIO and Streamable-HTTP transports, and can be deployed locally using the `uv` package manager or via containerized Docker environments. By bridging the gap between LLMs and high-performance databases, this tool empowers developers to build AI-driven applications that can reason over complex, live datasets with minimal friction.
Category: Databases & Data Stores
Tags: database-management, distributed-database, postgresql, SQL, yugabytedb
bash git clone git@github.com:yugabyte/yugabytedb-mcp-server.git cd yugabytedb-mcp-server 2. Install dependencies using uv: bash uv sync Docker Installation: Build the Docker image: bash docker build -t mcp/yugabytedb . ---YUGABYTEDB_URL environment variable.claude_desktop_config.json: json { "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" ] } } }uv Method) Add this to your MCP settings: json { "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" } } } } Note: Replace /path/to/cloned/yugabytedb-mcp-server/ with your actual local path. ---summarize_database: Lists all tables in the database, including schema information and row counts. * run_read_only_query: Runs a read-only SQL query and returns the results in JSON format. ---summarize_database to understand the schema and then automatically generate and execute the correct run_read_only_query to answer business questions. Example: A product manager asks Claude: "Which five products had the highest sales volume in the last 24 hours?" The LLM identifies the sales and products tables, joins them, and returns a JSON list of the top products directly in the chat.DESCRIBE commands to understand table relationships and data distribution. Solution: Developers can use the MCP within their IDE (like Cursor or Windsurf) to get an instant, high-level overview of the database. The LLM can explain how tables relate to one another based on the actual live schema. Example: A developer asks Cursor: "Explain the database schema for our billing system and show me how the invoices table links to customer_accounts." The LLM runs summarize_database, identifies the foreign keys, and provides a summary of the relationship.GUI database client to check the state of specific records. Solution: By integrating the YugabyteDB MCP into an AI-powered code editor, the developer can query the live database without leaving their workflow. The LLM can verify if a record exists or if a specific flag was updated during a test run. Example: While investigating a bug, a developer tells Windsurf: "Check the orders table for the record with ID 'ORD-123' and tell me if the status column is 'PENDING' or 'COMPLETED'." The AI executes the query and reports the current state of that row.
Part of MCP Servers