MCP.so
Sign In

TiDB MCP Server

@l1806858547

About TiDB MCP Server

TiDB MCP Server

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "tidb-server": {
      "command": "npx",
      "args": [
        "tidb-mcp-server"
      ]
    }
  }
}

Tools

No tools detected

Fetch the live tool list by running this server in a temporary sandbox using the button above.

Overview

What is TiDB MCP Server?

A Model Context Protocol (MCP) server that enables AI assistants to execute SELECT queries on a TiDB database through MCP tools. It uses environment variables for secure connection and is intended for developers integrating TiDB querying into MCP-compatible clients.

How to use TiDB MCP Server?

Install via Smithery, npx, or global npm. Set required environment variables (TIDB_HOST, TIDB_PORT, TIDB_USER, TIDB_PASS, TIDB_DB); optionally enable INSERT/UPDATE/DELETE by setting the respective variables to "true". Start the server with tidb-server, add it to your MCP client configuration (e.g., cline_mcp_settings.json), then call the tidb_query tool with an SQL argument.

Key features of TiDB MCP Server

  • Execute SELECT queries on TiDB via MCP tools.
  • Secure connection through environment variables.
  • Lightweight and easy to set up.
  • Optional support for INSERT, UPDATE, DELETE (disabled by default).
  • Compatible with Claude Desktop via Smithery.

Use cases of TiDB MCP Server

  • Query a TiDB database from within an AI assistant conversation.
  • Enable read-only data exploration for LLM applications.
  • Perform safe database lookups with default read-only mode.
  • Quickly prototype MCP-based integrations with TiDB.

FAQ from TiDB MCP Server

What runtime is required?

Node.js version 16 or higher, and a running TiDB instance.

How do I configure connection credentials?

Set the environment variables TIDB_HOST, TIDB_PORT, TIDB_USER, TIDB_PASS, and TIDB_DB. These are read at startup.

Can the server perform write operations?

By default, only SELECT queries are allowed. To enable INSERT, UPDATE, or DELETE, set the corresponding environment variable (e.g., ALLOW_INSERT_OPERATION) to "true". These are disabled by default to prevent accidental modifications.

How do I integrate this server with an MCP client?

Add the server to your MCP

Frequently asked questions

What runtime is required?

Node.js version 16 or higher, and a running TiDB instance.

How do I configure connection credentials?

Set the environment variables `TIDB_HOST`, `TIDB_PORT`, `TIDB_USER`, `TIDB_PASS`, and `TIDB_DB`. These are read at startup.

Can the server perform write operations?

By default, only SELECT queries are allowed. To enable INSERT, UPDATE, or DELETE, set the corresponding environment variable (e.g., `ALLOW_INSERT_OPERATION`) to `"true"`. These are disabled by default to prevent accidental modifications.

How do I integrate this server with an MCP client?

Add the server to your MCP

Comments

More Other MCP servers