All Products
Search
Document Center

Data Management:Upgrade from DMS MCP to Agent Data Gateway MCP

Last Updated:Oct 09, 2026

The former DMS MCP (alibabacloud-dms-mcp-server) has been upgraded to Agent Data Gateway MCP. The new MCP changes data source onboarding, tool names, resource identifiers, and call parameters. This topic describes how to upgrade from the legacy DMS MCP to Agent Data Gateway MCP.

Background information

The former DMS MCP has been upgraded to Agent Data Gateway MCP. The new MCP packages data asset discovery, permission queries, knowledge retrieval, and SQL execution into standard MCP tools. All operations follow the existing identity, permission, security policy, and auditing constraints of Agent Data Gateway.

Compared with the legacy version, the new MCP changes the following aspects. Review these changes before you upgrade:

  • Data source registration: Synchronize DMS data sources to Agent Data Gateway before you access them through the new MCP.

  • Tool names: Legacy tools such as executeScript and getDatabase are replaced by exec_sql and meta_database_search.

  • Resource identifiers: Legacy db_id, database_id, and table_guid are replaced by catalogUuid, databaseUuid, and qualifiedName.

  • Authentication: The access token of the legacy MCP can only follow user permissions. The token of the new MCP is designed for agents and supports more fine-grained and flexible permission control.

Procedure

Synchronize DMS data sources

Before you use the new MCP, synchronize the relevant DMS data sources to Agent Data Gateway. DMS plans to automatically synchronize the relevant existing data sources to Agent Data Gateway before November 30, 2026. To use the new MCP before that date, manually synchronize the DMS data sources by performing the following steps:

  1. Log on to the Agent Data Gateway console.

  2. In the left-side navigation pane, choose Data Sources > Connection Management.

  3. On the Connection Management page, click DMS Instance Sync.

    Note

    Alternatively, on the Overview page of the Agent Data Gateway console, click Get Started, and then click DMS data source sync in the Select Datasource section.

  4. Select the data sources that you want to use from the instances that are hosted in DMS, and then complete the synchronization. Only DMS instances that are securely hosted can be synchronized.

Note

Synchronizing a data source only indicates that the resource is connected to the gateway. It does not mean that the current agent has obtained SQL execution permissions. If a data source is visible but execution returns ACCESS_DENIED, check the agent identity and instance permissions in the console.

Create an agent identity

Before you connect to and use the MCP, create an agent identity by performing the following steps:

  1. Log on to the Agent Data Gateway console.

  2. In the left-side navigation pane, choose Identities & Permissions > My Agent Identity, and then click Create Agent Identity.

  3. In the dialog box that appears, configure the following agent identity parameters, and then click Submit:

    Parameter

    Description

    Name

    Enter a name for the agent identity.

    AccessToken Expiration Time

    Set the expiration time of the agent access token. An empty value indicates that the token never expires.

    Permission Mode

    Select the permission mode of the agent identity:

    • Permissions Follow User: The agent inherits the current user permissions in real time.

    • Permission Narrowing Mode: Select the agent permissions as needed within the scope of the user permissions.

    • Independent permissions: The agent does not inherit the current user permissions. After the identity is created, the agent obtains data permissions through permission requests.

  4. In the dialog box, copy and securely save the generated access token, and then click Close. The access token is displayed only once when it is created and cannot be viewed again after you close the dialog box.

Connect to Agent Data Gateway MCP

After you synchronize the data sources, connect to the new MCP by using the following methods.

Connect directly to an MCP endpoint

  1. Select the endpoint that corresponds to the region of your access token from the following table:

    Region

    MCP endpoint

    China (Hangzhou)

    https://dgate-mcp-cn-hangzhou.aliyuncs.com/mcp/dgate

    China (Shanghai)

    https://dgate-mcp-cn-shanghai.aliyuncs.com/mcp/dgate

    China (Beijing)

    https://dgate-mcp-cn-beijing.aliyuncs.com/mcp/dgate

    China (Shenzhen)

    https://dgate-mcp-cn-shenzhen.aliyuncs.com/mcp/dgate

    China (Zhangjiakou)

    https://dgate-mcp-cn-zhangjiakou.aliyuncs.com/mcp/dgate

    China (Hong Kong)

    https://dgate-mcp-cn-hongkong.aliyuncs.com/mcp/dgate

    Singapore

    https://dgate-mcp-ap-southeast-1.aliyuncs.com/mcp/dgate

    Malaysia (Kuala Lumpur)

    https://dgate-mcp-ap-southeast-3.aliyuncs.com/mcp/dgate

    Japan (Tokyo)

    https://dgate-mcp-ap-northeast-1.aliyuncs.com/mcp/dgate

  2. Add the following content to your MCP client configuration. Replace the value of url with the endpoint determined in the previous step, and replace the value of Authorization with Bearer <ACCESS_TOKEN>, where <ACCESS_TOKEN> is the access token that you saved when you Create an agent identity.

    {
      "mcpServers": {
        "dgate": {
          "url": "https://dgate-mcp-cn-hangzhou.aliyuncs.com/mcp/dgate",
          "headers": {
            "Authorization": "Bearer <ACCESS_TOKEN>"
          }
        }
      }
    }

    The location of the configuration file and the interface entry may vary across clients. However, as long as url and Authorization are correctly configured, you can connect to the service.

  3. After you save the configuration, reload the MCP service. Some clients require you to restart the client or create a new session to refresh the tool list.

Replace MCP tools

After you connect to the new MCP, replace the legacy MCP tools in your applications with the new ones. The following table lists the mapping and descriptions between the main legacy DMS MCP tools and the new MCP tools.

Legacy DMS MCP tool

New Agent Data Gateway MCP

Description

executeScript

exec_sql

Replace the legacy db_id with databaseUuid, and replace script with statement. The new version executes only one SQL statement per call. Split multiple SQL statements into multiple sequential calls. Each call is independently authenticated, controlled, and audited, and transaction atomicity across calls is not guaranteed.

For the considerations when you upgrade this tool, see Considerations for replacing executeScript.

getDatabase

meta_database_search / meta_database_list → meta_database_get

The new version no longer queries directly by host + port + schema_name. First search for or list databases to obtain the databaseUuid, and then query the database details.

getInstance

meta_catalog_search → meta_catalog_get

The new version refers to the legacy instance as a catalog. First search for and uniquely identify the target instance to obtain the catalogUuid, and then query the details. Do not continue to use the legacy host + port parameters.

getTableDetailInfo

meta_table_columns + meta_table_indexes

First obtain the qualifiedName of the table by using meta_table_list, and then query the columns and indexes separately. The two queries together replace the legacy table details. The legacy table_guid is no longer used.

listTables

meta_table_list

Replace the legacy database_id with databaseUuid. The new version uses MaxResults + NextToken cursor-based pagination instead of page_number + page_size.

For the considerations and examples when you upgrade this tool, see meta_table_list replacement example.

searchDatabase

meta_database_search

Use searchKey to search for databases. Save the databaseUuid from the results for subsequent database details, table queries, and SQL execution.

The resource discovery chain in the new version is unified as follows:

catalogUuid
  → databaseUuid
    → table qualifiedName
      → columns, indexes, or SQL execution
Note

The legacy db_id, database_id, and table_guid cannot be used directly with the new MCP. Use the new metadata tools to obtain catalogUuid, databaseUuid, and qualifiedName again.

Agent upgrade

Add the following content to the system prompt or upgrade prompt of your agent to help it upgrade smoothly to the new MCP:

You are using Agent Data Gateway MCP. Follow these call rules:

1. Do not call legacy DMS MCP tools such as executeScript, getDatabase,
   getInstance, getTableDetailInfo, listTables, or searchDatabase.

2. The legacy instance is called a catalog in the new version:
   Use meta_catalog_search to locate the instance and obtain the catalogUuid;
   call meta_catalog_get when you need the details.

3. When you query databases:
   - If the catalogUuid is known, call meta_database_list;
   - If only the database name is known, call meta_database_search;
   - After you obtain the databaseUuid, call meta_database_get for the details.

4. When you query tables, use meta_table_list and save the returned qualifiedName.
   To query full table details, call meta_table_columns and
   meta_table_indexes separately.

5. When you execute SQL, use exec_sql:
   - Pass databaseUuid first;
   - Submit only one SQL statement per call;
   - Split multiple SQL statements into multiple sequential calls;
   - If any statement fails, stop the subsequent calls and report the failure;
   - Do not claim that multiple calls have transaction atomicity or are automatically rolled back.

6. When exec_sql returns NEEDS_CONFIRMATION, the user must review it first,
   and then retry with the confirm reason; do not skip confirmation by default.

7. List tools use NextToken cursor-based pagination. When hasMore=true,
   pass the returned NextToken as-is to get the next page instead of using legacy page-number pagination.

8. A visible data source does not mean that execution permission is granted. When ACCESS_DENIED occurs,
   remind the user to check the agent identity and instance authorization, and do not retry the SQL repeatedly.

Appendix

Considerations for replacing executeScript

In physical database scenarios, the legacy executeScript can receive multiple SQL statements and execute them in sequence, but it does not guarantee transaction atomicity for the entire script. In logical database scenarios, only one SQL statement is allowed. The new exec_sql currently supports only a single SQL statement and does not support batch multi-statement execution. Follow these rules when you upgrade:

  • Split multiple SQL statements into multiple exec_sql calls.

  • Execute the statements one by one in the original script order.

  • If any statement fails, stop the subsequent calls and report the failure.

  • Do not claim that multiple calls are automatically rolled back or have transaction atomicity.

  • When NEEDS_CONFIRMATION is returned, complete a manual review, and then retry with the confirm reason.

  • The legacy logic parameter does not map to a new parameter. The target resource is expressed by the new databaseUuid. Logical databases that are not yet connected to the gateway cannot be upgraded directly.

Single SQL statement call example:

{
  "name": "exec_sql",
  "arguments": {
    "databaseUuid": "<database-uuid>",
    "statement": "SELECT id, status FROM orders LIMIT 20",
    "maxRows": 100,
    "waitSeconds": 110
  }
}

meta_table_list replacement example

The legacy getTableDetailInfo is replaced by two queries: meta_table_columns and meta_table_indexes. First obtain the qualifiedName of the table by using meta_table_list, and then query the columns and indexes separately:

{"name":"meta_table_columns","arguments":{"databaseUuid":"<database-uuid>","tableQualifiedName":"trade.orders"}}
{"name":"meta_table_indexes","arguments":{"databaseUuid":"<database-uuid>","tableQualifiedName":"trade.orders"}}

The two results together constitute the business result of the legacy getTableDetailInfo.