Alibaba Cloud DMS MCP Server

Official
by aliyun

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ALIBABA_CLOUD_ACCESS_KEY_IDYesAlibaba Cloud Access Key ID
ALIBABA_CLOUD_SECURITY_TOKENNoAlibaba Cloud STS Security Token (optional, required when using STS Token)
ALIBABA_CLOUD_ACCESS_KEY_SECRETYesAlibaba Cloud Access Key Secret

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
addInstance
getInstance
Retrieve detailed instance information from DMS. Parameters: host (str): The hostname or IP address of the database instance port (int): Connection port number (valid range: 1-65535) sid (Optional[str]): Required for Oracle like databases. Defaults to None. Returns: Dict[str, Any]: A dictionary containing instance details with these keys: - InstanceId: Unique instance identifier in DMS - State: Current operational status - InstanceType: Database Engine type - InstanceAlias: Instance alias in DMS
searchDatabase
Search databases in DMS based on schemaName. This tool allows searching for database instances in the DMS using a provided search key(schemaName). It supports pagination to handle large result sets efficiently. Parameters: search_key (str): schemaName. page_number (int, optional): The page number to retrieve (starting from 1). Defaults to 1. page_size (int, optional): Number of results per page, up to a maximum of 1000. Defaults to 200. Returns: List[Dict[str, Any]]: A list of dictionaries, each representing a matched database with fields such as: - DatabaseId: Unique database identifier in DMS - Host: Hostname or IP address of the database instance - Port: Connection port number - SchemaName: Name of the database schema - DbType: Database Engine type
getDatabase
Retrieve detailed information about a specific database from DMS. This tool fetches metadata for a database instance in the DMS based on connection parameters and schema name. Supports Oracle-specific SID specification. If you don't know host port, please use searchDatabase tool instead. Parameters: host (str): Hostname or IP address of the database instance. port (str): Connection port number (valid range: 1-65535). schema_name (str): Name of the database schema. sid (Optional[str], optional): Required for Oracle like databases. Defaults to None. Returns: Dict[str, Any]: A dictionary containing database metadata with the following keys: - DatabaseId: Unique database identifier in DMS - SchemaName: Name of the database schema - DbType: Database Engine type - InstanceAlias: Instance alias in DMS - InstanceId: Instance identifier in DMS - State: Current operational status
listTable
Search for database tables in DMS based on databaseId and tableName. This tool allows searching for database tables in the DMS if databaseId is known. If you don't known databaseId, you could obtained via getDatabase tool. Parameters: database_id (str): Required databaseId (obtained via getDatabase tool) to scope the search. search_name (str): A non-empty string used as the search keyword. Used to match table names. page_number (int, optional): Pagination page number (default: 1). page_size (int, optional): Number of results per page (default: 200, max: 200). Returns: Dict[str, Any] containing: TableList (Dict): Container for matching tables with structure: Table (List[Dict]): Array of table metadata objects containing: - DatabaseId (int): ID of parent database - TableGuid (str): Unique table identifier, with format: dmsTableId.schemaName.tableName. - TableName (str): Name of table - Description (str): Table description - TableType (str): Type classification (NORMAL/VIEW/etc.) TotalCount (int): Total number of matching tables across all pages
getTableDetailInfo
Retrieve detailed metadata information about a specific database table including schema and index details. Parameters: table_guid (str): Unique table identifier(format: dmsTableId.schemaName.tableName). Obtained via searchTable or listTable tool. Returns: Dict[str, Any] containing: ColumnList: List of column metadata dictionaries with fields: - ColumnName(str): Name of the column - ColumnType (str): Full SQL type declaration (e.g., 'varchar(32)', 'bigint(20)') - AutoIncrement (bool): Whether the column is an auto-increment field - Description (str): Column comment/description text - Nullable (bool): Whether NULL values are allowed IndexList: List of index metadata dictionaries with fields: - IndexColumns (List[str]): List of column names included in the index - IndexName (str): Name of the index - IndexType (str): Type of index ('Primary', 'Unique', etc.) - Unique (bool): Whether the index enforces uniqueness
executeScript
Execute SQL script against a database in DMS and return structured results. Parameters: database_id (int): Required DMS databaseId. Obtained via getDatabase tool. script (str): SQL script to execute. Returns: Dict[str, Any] containing: - RequestId (str): Unique request identifier - Results (List[Dict]): List of result sets from executed script: Each result set contains: - ColumnNames (List[str]): Ordered list of column names - RowCount (int): Number of rows returned - Rows (List[Dict[str, str]]): List of rows with column name -> value mapping - Success (bool): Whether this result set was successfully retrieved - Success (bool): Overall operation success status
nl2sql

Generate SQL from natural language questions about database data.

This tool converts natural language questions into SQL queries that can be executed against a database. If you don't have the database_id, use the searchDatabase tool first to identify the correct database. The sql generated could be executed via DMS executeScript tool provided in this server if necessary. Parameters: question (str): Natural language question about the database that needs to be converted to SQL. database_id (int): DMS databaseId. If not provided, searchDatabase will be used first. knowledge (Optional[str]): Additional context or database knowledge to improve SQL generation. Returns: Dict[str, Any]: A dictionary containing: - Sql (str): The generated SQL query based on the natural language question
ID: hyhi1ys72b