Skip to main content

Authentication

MCP API uses a Model Studio API key for authentication and is accessed through a workspace endpoint.

MCP API uses an Alibaba Cloud Model Studio API key for authentication. Each request carries the API key in an HTTP header.

Get an API key

  1. Log on to the Alibaba Cloud Model Studio console.
  2. Go to the API Key page, create an API key, and copy it.
The API key has workspace-level permissions. Keep it secure. Do not commit it to a code repository or share it publicly.

Configure the endpoint

https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/mcp/servers
  • workspace_id: the workspace ID. Log on to the Model Studio console and copy it from the workspace menu in the upper-right corner.

Send a request

Set the API key as an environment variable:
export DASHSCOPE_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Each request carries the Authorization header:
curl "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/mcp/servers/list?pageNo=1&pageSize=10" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

Permissions

  • The Alibaba Cloud primary account can call all APIs.
  • RAM users require the corresponding permissions.
  • The permission scope of an API key is configured in the console.
If authentication fails or workspace information is missing, the API returns 403 AccessDenied. For details, see MCP API error codes.