TaurusDB MCP
Scenarios
In routine data management and analysis, users often need to interact with databases to execute various query and diagnostic tasks. However, traditional database operations require users to have advanced SQL skills and frequently switch between different consoles, which increases operation complexity and reduces efficiency.
Model Context Protocol (MCP) is a protocol that enables AI clients to securely call external tools and data sources. With MCP, AI clients such as Claude Code, Codex, Cursor, and VS Code can connect to a locally running MCP Server, which then accesses databases, cloud services, or other systems on behalf of users.
taurusdb-mcp is an MCP Server tailored for Huawei Cloud TaurusDB. Users do not need to manually write complex SQL statements or repeatedly switch consoles. Instead, they can initiate requests in natural language within AI clients, and the AI clients select appropriate MCP tools to perform database exploration, SQL execution, and problem diagnosis.
Using MCP and taurusdb-mcp simplifies operation workflows and improves the efficiency of data management and analysis.
Typical application scenarios include:
- Database structure exploration: Query databases, tables, columns, indexes, and table structures.
- Read-only SQL queries: Execute read-only statements, such as SELECT, SHOW, and EXPLAIN, to obtain structured results.
- SQL execution plan analysis: Analyze causes of slow SQL queries through explain_sql or enhanced diagnostic capabilities.
- Database runtime status troubleshooting: View diagnostic results such as processlist, lock waits, hotspot SQL, connection growth, and storage pressure.
- TaurusDB capability discovery: Identify whether the current instance supports TaurusDB-specific capabilities, such as hotspot rows, the recycle bin, and flashback queries.
- Cloud database instance selection: Query TaurusDB instances under an account and associate the MCP session with a specified instance.
Prerequisites
Before using taurusdb-mcp, ensure that the following requirements are met.
- Node.js and npm are installed in the local or runtime environment. The Node.js version must be later than 20.
- An MCP-compatible client, such as Claude Code, Codex, Cursor, or VS Code, is installed and available.
- The machine running the MCP Server can access the TaurusDB database.
- For production or long-term use scenarios, it is recommended that the MCP Server be deployed on an ECS in the same VPC as TaurusDB.
- For temporary local debugging, public IP addresses of databases can be used but the security group must allow access only from the current public network egress IP address and necessary ports.
- TaurusDB database connection information has been prepared:
- Public IP address and port number of the database
- Default database name
- Database account and password
- Optional write account and password, which are used only for validating controlled write operations or recovery operations
- It is recommended that a read-only account have at least the following privileges:
- SELECT privilege on the target database
- SHOW PROCESSLIST privilege
- To diagnose replication, locks, and InnoDB status, read-only privileges for SHOW REPLICA STATUS or SHOW SLAVE STATUS, SHOW ENGINE INNODB STATUS, and performance_schema are required.
- To use cloud database capabilities, the Huawei Cloud region and AK/SK information must be prepared in advance.
The AK/SK must have at least the privileges to view TaurusDB instances in the target region. For details about how to obtain an AK/SK, see Access Keys.
For details about how to obtain the region ID, see Regions and Endpoints.
- Before using MCP, you must log in to the database. To log in, you must select an instance first. Each instance has its own account and password. After selecting an instance, use the corresponding credentials to log in to and operate the database.

- To use performance diagnosis tools, the value of the performance_schema parameter must be set to ON. For details, see Modifying Instance Parameters.
Constraints
The following limitations and security boundaries apply when using MCP.
- taurusdb-mcp currently runs as a stdio MCP Server. It is not an HTTP service and does not provide a browser-accessible URL after startup. It must be launched and called by an MCP client.
- The MCP client process must have access to environment variables. It is recommended that database and cloud-side configurations be directly specified in the MCP client configuration.
- execute_readonly_sql only supports read-only SQL statements and blocks write statements.
- execute_sql provides write capabilities. It is exposed only after the mutation configuration is enabled. For high-risk operations, a confirmation_token must be returned first. The operation is executed only when the token is provided in the second call.
- The confirmation_token is bound to context of the initial call, including the SQL statement, datasource, and database, and can be used only once. If parameters do not match or if the token has already been used, validation fails.
- In most cases, security groups focus primarily on inbound rules. If outbound traffic is also restricted in your environment, add the corresponding outbound rules. If the public IP address of the current instance changes, you need to update the security group rules accordingly.
The following figure shows an example of adding the public IP address of the current instance to a security group rule.

Configuring MCP
Before using MCP, configure it based on the client tool you use. This section describes how to configure MCP for the following commonly used clients.
In the configurations below, replace the region information and AK/SK with the actual values.
Huawei Cloud CodeArts
- Download and install Huawei Cloud CodeArts Agent. For details, see Huawei Cloud CodeArts Agent.
- Open the MCP configuration page in Huawei Cloud CodeArts and edit mcp_settings.json.
{ "mcpServers": { "huaweicloud-taurusdb": { "command": "npx", "args": ["-y", "taurusdb-mcp"], "env": { "TAURUSDB_CLOUD_REGION": "your-region", "TAURUSDB_CLOUD_ACCESS_KEY_ID": "your-ak", "TAURUSDB_CLOUD_SECRET_ACCESS_KEY": "your-sk" } } } }
Claude Code
Run the following command:
claude mcp add huaweicloud-taurusdb --transport stdio -s local -e TAURUSDB_CLOUD_REGION=your-region -e TAURUSDB_CLOUD_ACCESS_KEY_ID=your-ak -e TAURUSDB_CLOUD_SECRET_ACCESS_KEY=your-sk -- npx -y taurusdb-mcp
Verify the configuration using the following command:
claude mcp list claude mcp get huaweicloud-taurusdb
Codex
codex mcp add huaweicloud-taurusdb --env TAURUSDB_CLOUD_REGION=your-region --env TAURUSDB_CLOUD_ACCESS_KEY_ID=your-ak --env TAURUSDB_CLOUD_SECRET_ACCESS_KEY=your-sk -- npx -y taurusdb-mcp
Verify the configuration using the following command:
codex mcp list
If you manually maintain the configuration, edit ~/.codex/config.toml and add the following content:
[mcp_servers.huaweicloud-taurusdb] command = "npx" args = ["-y", "taurusdb-mcp"] enabled = true [mcp_servers.huaweicloud-taurusdb.env] TAURUSDB_CLOUD_REGION = "your-region" TAURUSDB_CLOUD_ACCESS_KEY_ID = "your-ak" TAURUSDB_CLOUD_SECRET_ACCESS_KEY = "your-sk"
Cursor
Edit ~/.cursor/mcp.json and add the following content:
{
"mcpServers": {
"huaweicloud-taurusdb": {
"command": "npx",
"args": [
"-y",
"taurusdb-mcp"
],
"env": {
"TAURUSDB_CLOUD_REGION": "your-region",
"TAURUSDB_CLOUD_ACCESS_KEY_ID": "your-ak",
"TAURUSDB_CLOUD_SECRET_ACCESS_KEY": "your-sk"
}
}
}
} OpenCode
Edit the opencode.json file and add the following content:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"huaweicloud-taurusdb": {
"type": "local",
"command": [
"npx",
"-y",
"taurusdb-mcp"
],
"enabled": true,
"environment": {
"TAURUSDB_CLOUD_REGION": "your-region",
"TAURUSDB_CLOUD_ACCESS_KEY_ID": "your-ak",
"TAURUSDB_CLOUD_SECRET_ACCESS_KEY": "your-sk"
}
}
}
} Trae
Add the following configuration in the MCP settings of Trae. If your version supports project-level configuration, it can typically be placed in the MCP configuration file provided by the IDE:
{
"mcpServers": {
"huaweicloud-taurusdb": {
"command": "npx",
"args": [
"-y",
"taurusdb-mcp"
],
"env": {
"TAURUSDB_CLOUD_REGION": "your-region",
"TAURUSDB_CLOUD_ACCESS_KEY_ID": "your-ak",
"TAURUSDB_CLOUD_SECRET_ACCESS_KEY": "your-sk"
}
}
}
} Qwen Code/Qwen
The common configuration file for Qwen Code is ~/.qwen/settings.json. You can directly add the following content:
{
"mcpServers": {
"huaweicloud-taurusdb": {
"command": "npx",
"args": [
"-y",
"taurusdb-mcp"
],
"env": {
"TAURUSDB_CLOUD_REGION": "your-region",
"TAURUSDB_CLOUD_ACCESS_KEY_ID": "your-ak",
"TAURUSDB_CLOUD_SECRET_ACCESS_KEY": "your-sk"
}
}
}
} You can also configure it using the command line:
qwen mcp add -t stdio -e TAURUSDB_CLOUD_REGION=your-region -e TAURUSDB_CLOUD_ACCESS_KEY_ID=your-ak -e TAURUSDB_CLOUD_SECRET_ACCESS_KEY=<your-sk> huaweicloud-taurusdb npx -y taurusdb-mcp
CodeBuddy
You are advised to use codebuddy mcp add-json to add the configuration.
codebuddymcpadd-json--scopeuserhuaweicloud-taurusdb'{
"type": "stdio",
"command": "npx",
"args": [
"-y",
"taurusdb-mcp"
],
"env": {
"TAURUSDB_CLOUD_REGION": "your-region",
"TAURUSDB_CLOUD_ACCESS_KEY_ID": "your-ak",
"TAURUSDB_CLOUD_SECRET_ACCESS_KEY": "your-sk"
}
}' CodeBuddy's configuration file is usually located in one of the following paths:
- ~/.codebuddy/.mcp.json
- ~/.codebuddy/mcp.json
- ~/.codebuddy.json (If you are not using the CLI, write the same content into the corresponding file.)
Verifying MCP Connectivity
Verify that MCP has connected:

Using MCP
TaurusDB MCP provides the following tools, including database connection, instance management, database management, diagnostic tools, and recovery tools.
| Tool Category | Tool | Description |
|---|---|---|
| Database connection | ping | Tests network connectivity. |
| set_cloud_region | Sets a Huawei Cloud region. | |
| set_cloud_access_keys | Sets AK/SK. | |
| get_session_binding | Obtains current session binding information. | |
| set_default_database | Sets the default database. | |
| Instance management | list_cloud_taurus_instances | Lists TaurusDB instances. |
| select_cloud_taurus_instance | Selects a TaurusDB instance. | |
| get_kernel_info | Obtains kernel version information of a specified instance. | |
| list_taurus_features | Obtains the feature matrix. | |
| Database management | list_databases | Lists databases. |
| list_tables | Lists tables. | |
| describe_table | Describes the table structure. | |
| execute_readonly_sql | Executes read-only SQL statements. | |
| execute_sql | Executes SQL statements that modify data. | |
| explain_sql | Executes EXPLAIN. | |
| explain_sql_enhanced | Executes enhanced EXPLAIN (including NDP/PQ hints). | |
| Performance diagnosis | show_processlist | Displays the process list. |
| diagnose_service_latency | Diagnoses root causes of service latency. | |
| diagnose_db_hotspot | Diagnoses hotspot rows. | |
| find_top_slow_sql | Finds slow SQL queries. | |
| diagnose_slow_query | Diagnoses slow queries. | |
| diagnose_connection_spike | Diagnoses sudden connection increases. | |
| diagnose_lock_contention | Diagnoses lock contention. | |
| diagnose_storage_pressure | Diagnoses storage pressure. | |
| Backup and restoration | flashback_query | Performs flashback queries. |
| list_recycle_bin | Queries the recycle bin list. | |
| restore_recycle_bin_table | Restores tables from the recycle bin. |
Examples
- list_taurus_features: Queries the TaurusDB feature matrix.
- diagnose_slow_query: Diagnoses the root causes of slow queries.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot








