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
executeScriptandgetDatabaseare replaced byexec_sqlandmeta_database_search. -
Resource identifiers: Legacy
db_id,database_id, andtable_guidare replaced bycatalogUuid,databaseUuid, andqualifiedName. -
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:
-
Log on to the Agent Data Gateway console.
-
In the left-side navigation pane, choose .
-
On the Connection Management page, click DMS Instance Sync.
NoteAlternatively, 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.
-
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.
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:
-
Log on to the Agent Data Gateway console.
-
In the left-side navigation pane, choose , and then click Create Agent Identity.
-
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.
-
-
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
-
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/dgateChina (Shanghai)
https://dgate-mcp-cn-shanghai.aliyuncs.com/mcp/dgateChina (Beijing)
https://dgate-mcp-cn-beijing.aliyuncs.com/mcp/dgateChina (Shenzhen)
https://dgate-mcp-cn-shenzhen.aliyuncs.com/mcp/dgateChina (Zhangjiakou)
https://dgate-mcp-cn-zhangjiakou.aliyuncs.com/mcp/dgateChina (Hong Kong)
https://dgate-mcp-cn-hongkong.aliyuncs.com/mcp/dgateSingapore
https://dgate-mcp-ap-southeast-1.aliyuncs.com/mcp/dgateMalaysia (Kuala Lumpur)
https://dgate-mcp-ap-southeast-3.aliyuncs.com/mcp/dgateJapan (Tokyo)
https://dgate-mcp-ap-northeast-1.aliyuncs.com/mcp/dgate -
Add the following content to your MCP client configuration. Replace the value of
urlwith the endpoint determined in the previous step, and replace the value ofAuthorizationwithBearer <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
urlandAuthorizationare correctly configured, you can connect to the service. -
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 |
|
|
|
Replace the legacy For the considerations when you upgrade this tool, see Considerations for replacing executeScript. |
|
|
|
The new version no longer queries directly by host + port + schema_name. First search for or list databases to obtain the |
|
|
|
The new version refers to the legacy instance as a catalog. First search for and uniquely identify the target instance to obtain the |
|
|
|
First obtain the |
|
|
|
Replace the legacy For the considerations and examples when you upgrade this tool, see meta_table_list replacement example. |
|
|
|
Use |
The resource discovery chain in the new version is unified as follows:
catalogUuid
→ databaseUuid
→ table qualifiedName
→ columns, indexes, or SQL execution
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_sqlcalls. -
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_CONFIRMATIONis returned, complete a manual review, and then retry with theconfirmreason. -
The legacy
logicparameter does not map to a new parameter. The target resource is expressed by the newdatabaseUuid. 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.