mcp-server-tidb

mcp-server-tidb

MCP server implementation for TiDB serverless databases.

22
Stars
6
Forks
22
Watchers
3
Issues
mcp-server-tidb provides an implementation of the Model Context Protocol (MCP) for TiDB, enabling integration with serverless TiDB databases. It supports configuration through environment variables or .env files and connects with applications such as Claude Desktop via standardized configuration. The server facilitates managing context between conversational AI models and a TiDB backend in a consistent and standardized way.

Key Features

Implements Model Context Protocol for TiDB
Works with serverless TiDB cloud databases
Supports configuration via environment variables and .env files
Integrates with Claude Desktop via standard MCP settings
Cross-platform support including WSL environments
Dependency management with uv
Secure database credentials support
Sample configuration templates provided
Command-line server bootstrap
Python-based server implementation

Use Cases

Providing context server functionality for AI tools requiring database-backed context
Integrating TiDB with Claude Desktop for conversational AI applications
Standardizing context handling for AI models with database storage
Rapid prototyping of context-aware AI applications using TiDB backend
Enabling secure and flexible configuration of model context servers
Supporting cloud-based TiDB deployments for AI model contexts
Automating context exchange between applications and serverless databases
Testing Model Context Protocol integrations with TiDB
Facilitating hybrid cloud/local development using WSL
Simplifying deployment of MCP-compliant context servers for AI applications

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

Star History

Star History Chart

Repository Owner

c4pt0r
c4pt0r

User

Repository Details

Language Python
Default Branch master
Size 26 KB
Contributors 2
License Apache License 2.0
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • greptimedb-mcp-server

    greptimedb-mcp-server

    A Model Context Protocol (MCP) server for secure, structured AI access to GreptimeDB.

    greptimedb-mcp-server implements a Model Context Protocol (MCP) server for GreptimeDB, enabling AI assistants to securely explore and analyze database contents. It provides controlled operations such as listing tables, reading data, and executing SQL queries, ensuring responsible access. The server offers integration with Claude Desktop and supports prompt management for structured AI interactions.

    • 23
    • MCP
    • GreptimeTeam/greptimedb-mcp-server
  • Nile MCP Server

    Nile MCP Server

    A Model Context Protocol (MCP) server for managing databases on the Nile platform through standardized interfaces.

    Nile MCP Server implements the Model Context Protocol to enable seamless integration between LLM applications and the Nile database platform. It provides standardized APIs for database and credential management, SQL execution, and region discovery. Written in TypeScript, the server focuses on type safety, comprehensive error handling, and robust input validation. It supports easy installation and integration with Claude Desktop for advanced AI workflows.

    • 16
    • MCP
    • niledatabase/nile-mcp-server
  • MySQL MCP Server

    MySQL MCP Server

    Secure MCP interface for MySQL database interaction with AI applications.

    MySQL MCP Server implements the Model Context Protocol (MCP) to provide a secure bridge between AI applications and MySQL databases. It enables structured exploration and controlled queries through a standardized communication interface, ensuring safe and logged access to data. Designed for integration with tools such as Claude Desktop and Visual Studio Code, MySQL MCP Server allows users to list, read, and query MySQL tables securely. Environment variable-based configuration and comprehensive logging enhance its reliability for sensitive database interactions.

    • 980
    • MCP
    • designcomputer/mysql_mcp_server
  • MCP Server for Milvus

    MCP Server for Milvus

    Bridge Milvus vector database with AI apps using Model Context Protocol (MCP).

    MCP Server for Milvus enables seamless integration between the Milvus vector database and large language model (LLM) applications via the Model Context Protocol. It exposes Milvus functionality to external LLM-powered tools through both stdio and Server-Sent Events communication modes. The solution is compatible with MCP-enabled clients such as Claude Desktop and Cursor, supporting easy access to relevant vector data for enhanced AI workflows. Configuration is flexible through environment variables or command-line arguments.

    • 196
    • MCP
    • zilliztech/mcp-server-milvus
  • mcp-server-duckdb

    mcp-server-duckdb

    A Model Context Protocol server enabling SQL access to DuckDB databases.

    Implements a Model Context Protocol (MCP) server for DuckDB, allowing structured database interaction via MCP-compliant tools and language models. Offers a unified query tool for executing any SQL statement, with support for read-only mode to ensure data integrity. Flexible configuration options include database path specification and connection management. Easily integrable with applications like Claude Desktop for enhanced local data analysis through LLMs.

    • 171
    • MCP
    • ktanaka101/mcp-server-duckdb
  • CipherTrust Manager MCP Server

    CipherTrust Manager MCP Server

    Enables AI assistants to access CipherTrust Manager securely via the Model Context Protocol.

    CipherTrust Manager MCP Server provides an implementation of the Model Context Protocol (MCP), offering AI assistants such as Claude and Cursor a unified interface to interact with CipherTrust Manager resources. Communication is facilitated through JSON-RPC over stdin/stdout, enabling key management, CTE client management, user management, and connection management functionalities. The tool is configurable via environment variables and integrates with existing CipherTrust Manager instances using the ksctl CLI for secure resource access.

    • 7
    • MCP
    • sanyambassi/ciphertrust-manager-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results