Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-server-tidb

MCP.Pizza Chef: c4pt0r

mcp-server-tidb is an MCP server implementation that enables integration with TiDB, a serverless distributed SQL database. It allows MCP clients and LLMs to query and interact with TiDB databases in real time, supporting environment configuration via environment variables or .env files. This server facilitates seamless database operations within AI-enhanced workflows and applications.

Use This MCP server To

Query TiDB serverless database from MCP clients Integrate TiDB data into AI workflows and agents Run real-time SQL queries via LLMs Configure TiDB connection using environment variables Enable serverless database access in MCP environments Support multi-tenant TiDB database interactions Use TiDB data for automated report generation Combine TiDB queries with other MCP data sources

README

mcp-server-tidb

MCP server implementation for TiDB (serverless) database.

Prerequisites

  • uv (Python package installer)

Installation

# Clone the repository
git clone https://github.com/c4pt0r/mcp-server-tidb
cd mcp-server-tidb

# Install the package and dependencies using uv
uv venv
uv pip install -e .

Configuration

Go tidbcloud.com to create a free TiDB database cluster

Configuration can be provided through environment variables, or using .env:

  • TIDB_HOST - TiDB host address, e.g. 'gateway01.us-east-1.prod.aws.tidbcloud.com'
  • TIDB_PORT - TiDB port (default: 4000)
  • TIDB_USERNAME - Database username, e.g. 'xxxxxxxxxx.<username>'
  • TIDB_PASSWORD - Database password
  • TIDB_DATABASE - Database name, default is test

Run with Claude Desktop

Config Claude Desktop, HOWTO

claude_desktop_config.json:

{
  "mcpServers": {
      "tidb": {
          "command": "uv",
          "args": [
              "--directory",
              "/path/to/mcp-server-tidb",
              "run",
              "src/main.py"
          ]
      }
  }
}

If you're running mcp-server-tidb in WSL, the claude_desktop_config.json should look like this:

{
  "mcpServers": {
    "tool-with-env-vars": {
      "command": "wsl.exe",
      "args": [
        "bash",
        "-c",
        "/path/to/uv --directory /path/to/mcp-server-tidb run python src/main.py"
      ]
    }
  }
}

mcp-server-tidb FAQ

How do I configure the TiDB connection for mcp-server-tidb?
Configure using environment variables like TIDB_HOST, TIDB_PORT, TIDB_USERNAME, TIDB_PASSWORD, and TIDB_DATABASE or a .env file.
What prerequisites are needed to run mcp-server-tidb?
You need Python and the 'uv' package installer to set up and run the server.
Can mcp-server-tidb be used with different MCP clients?
Yes, it is designed to work with any MCP client that supports MCP server integration.
Is mcp-server-tidb compatible with serverless TiDB clusters?
Yes, it is specifically built to connect to serverless TiDB database clusters.
How do I install mcp-server-tidb?
Clone the GitHub repo, then use 'uv venv' and 'uv pip install -e .' to install dependencies and the package.
Can I use mcp-server-tidb with Claude Desktop?
Yes, it supports integration with Claude Desktop via configuration in claude_desktop_config.json.
What is the default port for TiDB in mcp-server-tidb?
The default port is 4000 unless overridden by configuration.
How secure is the connection to TiDB through mcp-server-tidb?
Security depends on your TiDB cluster setup and credentials management; mcp-server-tidb uses standard connection methods.