Introducing the YugabyteDB MCP Server

A Hands-On Demo of Claude Interacting With YugabyteDB
Sfurti Sarah

Overview

The YugabyteDB MCP Server is a new, lightweight, Python-based server that allows LLMs like Anthropic’s Claude to interact directly with your YugabyteDB database.

In this blog, we walk you through a quick demo that shows how MCP allows an AI application to access, query, analyze, and interpret data in your YugabyteDB database, using only natural language prompts.

What is MCP?

The Model Context Protocol (MCP) is a new standard that enables large language models (LLMs) to interact with existing enterprise services in a consistent and standardized way.

Services may be data providers (such as YugabyteDB or file servers), actuators (such as email servers), or both. A deep-dive is beyond the scope of this post, but this high-level overview helps illustrate why MCP is such a valuable development.

One challenge current AI applications face is that they are only as effective as the data they were trained on, and can only produce results by generating text, audio, or video.

However, what happens if an LLM (as part of an AI application) needs to access more current data, or company-specific data? And what happens if an AI application needs to issue an email, schedule an event in a calendar, or otherwise take action? In short, how can an AI application access existing services?

In the past, every LLM and framework (e.g., LangChain) has had its own way of doing this. This lack of a standard, consistent interface to services created complexity for AI application development and slowed progress.

MCP directly addresses this problem by standardizing how AI applications utilize existing services.

Here’s how it works:

  • Existing services are encapsulated (or fronted by) MCP Servers
  • Your app (the “Host”) incorporates an MCP Client.
  • Your app’s MCP Client is configured to connect with one (or more) MCP Servers
  • The client discovers available “tools” that the MCP Server advertises. Tools are analogous to API endpoints, representing discrete functionality that the MCP Server (and backing service) provides.
  • These tools are also described in a structured manner so that the LLM can understand in detail advertised functionality; that is, so that the LLM knows what each function can do and how to call it.
  • MCP Servers can be local (communicating via standard input/output) or remote (communicating via SSE over the network).
  • Each tool is like a function with arguments and (optionally) a return value.

MCP makes tool-augmented LLMs scalable, consistent, and composable.

Why Choose the YugabyteDB MCP Server?

YugabyteDB is an open source, PostgreSQL-compatible, distributed SQL database designed for cloud-native, multi-region workloads. But until now, there wasn’t an MCP integration for it.

This meant LLMs couldn’t directly understand or analyze data stored in YugabyteDB.

So we built the MCP server to:

  • Enable LLM-powered data exploration on YugabyteDB
  • Use safe, read-only queries to avoid modifying production data
  • Support tools like Claude Desktop, Cursor, and Windsurf out-of-the-box
  • Help interact with live data using natural language

Demo: Talk to Your YugabyteDB Database with Claude

For this demo, we have preloaded a three-node YugabyteDB cluster running with the Northwind dataset. This gives us a rich set of sample business data (orders, products, customers, etc.) to query and visualize.

We’ll connect Claude to this database using the MCP protocol, then explore it using natural language prompts.

Requirements

To follow the demo, you’ll need:

  1. An up-and-running YugabyteDB instance (local or remote)
  2. Python 3.10+
  3. uv for dependency management
  4. Claude Desktop: download here

Setting Up the YugabyteDB MCP Server

  1. Clone the repo and install dependencies:
    git clone https://github.com/yugabyte/yugabytedb-mcp-server.git
    cd yugabytedb-mcp-server
    uv sync

Connect Claude to the Server

  1. In Claude Desktop, go to:
    • Settings → Developer → Edit Config
  2. Add a new mcpServer entry in the claude_config.json:
    {
      "mcpServers": {
        "yugabytedb-mcp": {
          "command": "uv",
          "args": [
            "--directory",
            "/path/to/cloned/yugabytedb-mcp-server/",
            "run",
            "src/server.py"
          ],
          "env": {
            "YUGABYTEDB_URL": "dbname=northwind host=localhost port=5433 user=yugabyte password=yugabyte load_balance=true"
          }
        }
      }
    }
    
  3. Restart Claude to apply changes.

View logs in:

  • macOS: ~/Library/Logs/Claude
  • Windows: %APPDATA%\Claude\Logs

Prompt 1: Summarize the database

Prompt:
“Summarize the database you are connected to.”

Claude will:

  • Call summarize_database
  • List all tables with schema and row counts
  • Describe what it sees in plain English

Example output:

Summarize database

Prompt 2: Build a dashboard

Prompt:
“Build a dashboard with 3 visualizations:

  • Monthly sales trend
  • Top 10 customers by revenue
  • Sales grouped by customer country”

Claude will:

  • Execute safe, read-only SQL queries
  • Aggregate and structure the results
  • Create an interactive dashboard for the same

Example output:

Comprehensive insights

Monthly sales trend

Top 10 customers by revenue

Sales by Country

Country Performance Details

All this with no SQL required!

Conclusion

The YugabyteDB MCP Server bridges the gap between your AI application (and its LLM) and your YugabyteDB data—enabling seamless, natural language interaction with live, structured datasets.

By leveraging the Model Context Protocol, we’ve standardized tool integration and opened the door to intuitive data exploration, without needing to write a single line of SQL.

Whether you’re building dashboards, summarizing data, or experimenting with AI-driven workflows, this lightweight MCP server provides a secure, extensible foundation for LLM-enhanced applications. We’re excited to see how developers use this to unlock new insights and build intelligent data experiences on top of YugabyteDB.

To get started, try the demo, explore the GitHub repo, and let us know what you build!

Learn more about using YugabyteDB to build and deploy GenAI and RAG applications here. Keep an eye on our blog for more best practices and how-to guides for the YugabyteDB MCP Server.

Sfurti Sarah

Related Posts

Explore Distributed SQL and YugabyteDB in Depth

Discover the future of data management.
Learn at Yugabyte University
Get Started
Browse Yugabyte Docs
Explore docs
PostgreSQL For Cloud Native World
Read for Free