TiDB MCP Server
TiDB MCP サーバー
MCP ツールを通じて SELECT クエリを実行できる TiDB 用のモデル コンテキスト プロトコル (MCP) サーバー。
特徴
TiDBでSELECTクエリを実行する
環境変数による安全な接続
軽量で使いやすい
Related MCP server: MCP Server for MySQL
前提条件
Node.js 16以上
TiDBインスタンス
インストール
Smithery経由でインストール
Smithery経由で Claude Desktop 用の TiDB サーバーを自動的にインストールするには:
npx -y @smithery/cli install @l1806858547/tidb-server --client claudenpx経由
npx tidb-mcp-serverグローバルインストール
npm install -g tidb-mcp-server
tidb-mcp-server構成
実行する前に次の環境変数を設定します。
export TIDB_HOST="your_tidb_host"
export TIDB_PORT="your_tidb_port"
export TIDB_USER="your_username"
export TIDB_PASS="your_password"
export TIDB_DB="your_database"
# Optional operation permissions (default: false)
export ALLOW_INSERT_OPERATION="false" # Set to "true" to allow INSERT operations
export ALLOW_UPDATE_OPERATION="false" # Set to "true" to allow UPDATE operations
export ALLOW_DELETE_OPERATION="false" # Set to "true" to allow DELETE operations
WARNING: Enabling these operations may expose your database to modification risks.
Only enable what you need and ensure proper access controls are in place.使用法
サーバーを起動します。
tidb-serverMCP 構成 (cline_mcp_settings.json) に追加します。
{
"mcpServers": {
"tidb-server": {
"command": "npx",
"args": ["-y", "tidb-mcp-server"], # Also adding the -y flag for consistency
"env": {
"TIDB_HOST": "your_tidb_host",
"TIDB_PORT": "your_tidb_port",
"TIDB_USER": "your_username",
"TIDB_PASS": "your_password",
"TIDB_DB": "your_database"
}
}
}
}MCP ツールを使用します:
const result = await use_mcp_tool({
server_name: 'tidb-server',
tool_name: 'tidb_query',
arguments: {
sql: 'SELECT * FROM your_table LIMIT 10'
}
});発達
リポジトリをクローンします:
git clone https://github.com/l1806858547/tidb-server.git
cd tidb-server依存関係をインストールします:
npm install建てる:
npm run build走る:
node build/index.jsライセンス
マサチューセッツ工科大学
Available Tools
1 tooltidb_queryC
Execute SQL queries against TiDB
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL query to execute |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action without details on permissions, side effects, rate limits, or response format. It fails to address critical aspects like whether queries are read-only, transactional, or have other constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste, clearly front-loading the tool's purpose. It is appropriately sized for a simple tool with one parameter and no complex context.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for a tool that executes SQL queries. It omits essential context like return value format, error handling, or behavioral traits, leaving significant gaps for an AI agent to understand the tool fully.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, so the input schema already documents the 'sql' parameter fully. The description does not add any meaning beyond what the schema provides, such as SQL dialect specifics or query limitations, resulting in a baseline score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Execute SQL queries') and target resource ('against TiDB'), providing a specific verb+resource combination. It distinguishes the tool's function effectively, though there are no sibling tools to differentiate from, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or context for its application. It lacks explicit usage instructions, making it minimally helpful for decision-making in a broader toolset.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
tidb_query
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.
A single tool inherently has perfect naming consistency, as there are no other tools to compare it against. The naming pattern is straightforward and clear.
A single tool is too few for a database server like TiDB, which typically requires operations beyond just querying (e.g., schema management, data manipulation, administration). This minimal set severely limits functionality.
The tool surface is severely incomplete for a TiDB server. It only supports query execution, missing essential operations like creating/dropping tables, inserting/updating/deleting data, managing indexes, or handling transactions.
Maintenance
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for Studex tools, notifications, and profile integrations
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables SQL query execution, database management, and business intelligence capabilities through MySQL connections.1,492 npmMIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.22,154 npm2,199MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.22,154 npmMIT
- AlicenseBqualityCmaintenanceA Model Context Protocol server that enables SQL operations (SELECT, INSERT, UPDATE, DELETE) and table management through a standardized interface with SQLite databases.7106 npm1ISC