dmc-mcp-server

v0.4.0
dmc-mcp-server Checked 2 days ago Published 3 months ago

Tencent Cloud DMC MCP Server - Execute SQL on TDSQL-C / TDSQL via browser cookies

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_cookies

List all persisted Tencent Cloud console cookies (account + region). Useful to see which environments are ready (e.g. Shanghai vs Singapore) and whether any stored cookie has exceeded the ~2h lifetime (likely expired). Returns: A table of stored cookies: key, uin, region_id, age, expired flag.

clear_cookies

Delete a persisted cookie. If region_id is given, clears the cookie for that region (e.g. 4=Shanghai, 9=Singapore); otherwise clears the active cookie. Args: region_id: Optional region to clear (4=Shanghai, 9=Singapore). Returns: Confirmation of what was removed.

ParameterTypeDescription
region_id

login_instance

Login to a database instance via Tencent Cloud DMC. Supports both TDSQL-C (CynosDB) and TDSQL (DCDB) instances. The session is cached - subsequent calls reuse the same token without re-login, unless the token expires. Persisted credentials: if the same instance was logged in before under the current account+region, its user/password are reused automatically, so you can omit user/password on repeat logins. Use find_instance_by_ip to discover the instance_id and db_type, then pass the db_type value from the search results here. Args: instance_i…

ParameterTypeDescription
instance_id *string
db_typestring
passwordstring
region_idinteger
userstring

execute_select

Execute a SELECT query on a logged-in database instance. Only SELECT statements are allowed (enforced by SQL validation). Args: instance_id: Instance ID (must be logged in via login_instance first) sql: SELECT SQL statement to execute db_name: Target database name within the instance page_size: Max rows to return, default 50 Returns: Query results as formatted text.

ParameterTypeDescription
db_name *string
instance_id *string
sql *string
page_sizeinteger

execute_dml

⚠️ HIGH-RISK TOOL: Execute a DML or DDL write statement on a database instance. This tool modifies data and is irreversible. AI AGENT RULES (MANDATORY): - NEVER call this tool with confirm=True without explicit user approval. - ALWAYS call with confirm=False first to show the user the preview. - Wait for the user to explicitly say "confirm" / "确认" / "执行" before calling again with confirm=True. - If the user has not explicitly confirmed, return the preview result and ask the user to confirm. Two-step confirmation flow:…

ParameterTypeDescription
db_name *string
instance_id *string
sql *string
confirmboolean

list_databases

List all databases accessible by the current logged-in account on the specified instance. Args: instance_id: Instance ID (must be logged in) Returns: List of database names.

ParameterTypeDescription
instance_id *string

list_tables

List tables in a database, optionally filtered by name pattern. Args: instance_id: Instance ID (must be logged in) db_name: Database name search: Optional table name filter (fuzzy match) Returns: Table list with row counts and sizes.

ParameterTypeDescription
db_name *string
instance_id *string
search

get_table_detail

Get detailed schema of a table: columns and optionally DDL (CREATE TABLE statement). Args: instance_id: Instance ID (must be logged in) db_name: Database name table_name: Table name include_ddl: If True, also return the CREATE TABLE DDL. Default False (columns only) to save context. Set True when you need exact column definitions, index definitions, or charset info. Returns: Column details (and CREATE TABLE DDL if include_ddl=True).

ParameterTypeDescription
db_name *string
instance_id *string
table_name *string
include_ddlboolean

list_active_sessions

List all currently active (logged-in) database instance sessions. Useful to check which instances are ready for querying. Returns: List of active instance IDs and their session status.

find_instance_by_ip

Find a database instance by its internal Vip (proxy IP). Searches both TDSQL-C (CynosDB) and TDSQL (DCDB) instances. Typical workflow: 1. Read the JDBC URL from your config file (e.g. 10.0.0.1:3306) 2. Call find_instance_by_ip("10.0.0.1", region="ap-guangzhou") to get the InstanceId 3. Call login_instance with the InstanceId (use the DbType from results, and match region_id) 4. Call execute_select Args: ip: Internal Vip address, e.g. "10.0.0.1" region: Tencent Cloud region string, e.g. "ap-shanghai" (default), "ap-beijing", "ap-guangzh…

ParameterTypeDescription
ip *string
regionstring