yugabytedb-mcp-server

yugabyte/yugabytedb-mcp-server

3.3

If you are the rightful owner of yugabytedb-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The YugabyteDB MCP Server is an implementation that enables LLMs to interact directly with a YugabyteDB database using the Model Context Protocol.

The YugabyteDB MCP Server is designed to facilitate seamless interaction between large language models (LLMs) and YugabyteDB databases through the Model Context Protocol (MCP). This server allows users to list all tables in the database, including schema and row counts, and execute read-only SQL queries with results returned in JSON format. It is compatible with various MCP clients such as Claude Desktop, Cursor, and Windsurf Editor, and is optimized for use with FastMCP. The server requires Python 3.10 or higher and utilizes the 'uv' tool to manage and run the server. It can be configured using environment variables to connect to a running YugabyteDB instance, and it supports both STDIO and Streamable-HTTP transports. The server can be run locally or within a Docker container, providing flexibility in deployment. This implementation is particularly useful for developers and data scientists who need to integrate LLMs with their database systems for advanced data querying and analysis.

Features

  • List all tables in the database, including schema and row counts
  • Run read-only SQL queries and return results as JSON
  • Compatible with MCP clients like Claude Desktop, Cursor, and Windsurf Editor
  • Supports both STDIO and Streamable-HTTP transports
  • Can be run locally or within a Docker container

Usages

usage with 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"
      }
    }
  }
}

usage with claude desktop

{
  "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"
      ]
    }
  }
}

Tools

  1. summarize_database

    Lists all tables in the database, including schema and row counts.

  2. run_read_only_query

    Runs a read-only SQL query and returns the results as JSON.