All Products
Search
Document Center

MaxCompute:MaxCompute MCP Service documentation

Last Updated:Aug 05, 2026

MaxCompute MCP Server (MCMCP) implements the Model Context Protocol (MCP) to package MaxCompute's metadata, compute, and table management capabilities as structured tools that AI Agents can understand and invoke. Using MCMCP, AI Agents can perform large-scale data analytics, multimodal data transformation, and intelligent Operations and Maintenance (O&M).
This topic describes the hosted Remote MCP Server (recommended) and the local MCP Server.

Important

Function Overview

Agents invoke structured tools provided by MCMCP using the standard MCP protocol—no extra SDK or driver is required. MCMCP covers the full data operation workflow, from metadata browsing and SQL analysis to table management.

Core capabilities

  • Catalog metadata browsing and search: Browse projects, schemas, tables, fields, and partitions hierarchically. Supports natural language search.

  • Table management and metadata maintenance: Create tables (with options for lifecycle, primary key, and partial column updates), insert small amounts of data, and update table comments, tags, or column descriptions.

  • Identity and permission checks: View the current account identity and use MaxCompute authorization information to troubleshoot access issues.

  • Authentication and authorization:

    • The Remote MCP Server uses Alibaba Cloud OAuth for authorization.

    • The local MCP Server supports AccessKey/SecretKey (AK/SK), Security Token Service (STS), Credentials URI, ECS RAM Role, and the default Alibaba Cloud credential chain.

  • Read-only SQL analysis: Estimate costs, run asynchronous jobs, query instance statuses, and retrieve results. The read-only query path is protected on the server side. Write and metadata modification capabilities are listed separately and require user confirmation.

  • Quota discovery: View the list and details of MaxCompute Quotas available to the current account.

  • Knowledge base search and Q&A: The Remote MCP Server has a built-in MaxCompute documentation knowledge base that supports keyword searches and natural language Q&A, and returns answers with citations.

  • Skill discovery and reading: The Remote MCP Server has built-in MCP Skill resources. Clients can discover and retrieve Skill content using tools/list for scenarios such as Information Schema semantic analysis and feedback guidance.

  • Information Schema O&M and governance analysis:

    • The Remote MCP Server has a built-in Information Schema semantic package.

    • The local MCP Server requires you to install the corresponding Skill.

Architecture overview

image

MCMCP uses a layered architecture, from top to bottom:

  • User Agent ecosystem: Supports multiple Agent clients including OpenClaw, DataWorks Agent, Qwen Code, QoderWork, and MaxAgent.

  • MaxCompute Skills collection: A universal skill package for Agents, containing semantic packs, common commands, development templates, and usage limits. Extends Agent capabilities via MaxCompute OpenAPI, InfraAgent, and CatalogAI.

  • MCMCP service: Wraps MaxCompute OpenAPI, StorageAPI, and CatalogAPI into structured tools directly callable by Agents.

  • MaxCompute core capabilities:

    • Metadata:

      Catalog / Schema / Table / Partition. Features include authorization, auditing, data discovery, data exporting, masking, row-level permissions, and data sharing.

    • Compute Engines:

      MaxCompute SQL, MaxFrame, MC Spark. Compute types include heterogeneous CU/GU, AI functions, and models.

    • Storage:

      Table (Append / PK Delta Table); data types include BLOB, JSON, ARRAY, MAP, STRUCT. Features include automatic storage tiering, multi-replica, multi-AZ disaster recovery, recycle bin/Time Travel, data snapshots, and storage encryption.

Connection methods

  • The Remote MCP Server is the recommended connection method. It does not require you to run an MCP Server locally or store an AccessKey in a local MCP process.

  • The local MCP Server is for self-hosting, stdio, local development and debugging, or scenarios where you need direct control over credentials.

Scenario

Recommended method

Description

Accessing MaxCompute from clients such as Claude Code, Codex, or Qwen Code

Remote MCP Server

This is the recommended method. You do not need to run an MCP Server locally or configure an AccessKey in a local MCP process.

Accessing a hosted service in an enterprise VPC environment

VPC endpoint of the Remote MCP Server

This method uses the same OAuth and tool semantics as the public endpoint, but with a different domain name.

Local development, debugging MCP Server code, or requiring stdio or self-hosting

Local MCP Server

This is an optional advanced method. It requires a local Python environment and MaxCompute credential configuration.

Modifying local server code or submitting a bug for the local server

GitHub repository

Use the local issue template in the aliyun/alibabacloud-maxcompute-mcp-server repository.

If you are unsure which method to choose, start with the Remote MCP Server.

Remote MCP Server (recommended)

The production Remote MCP Server uses MCP Streamable HTTP. The client must support HTTP MCP Servers and be able to handle the OAuth authorization flow.

Supported regions

Choose an endpoint based on your client's network.

A single connection, OAuth authorization, and subsequent calls must always use the same endpoint domain name. Do not mix public and VPC domain names during the authorization process.

Public endpoints

Public MCP endpoints are available by service region. The currently available regions are as follows:

Region type

Service region

MCP Endpoint

The Chinese mainland public cloud

cn-hangzhou

https://mcp.cn-hangzhou.maxcompute.aliyun.com/mcp

Hong Kong (China) and outside China

cn-hongkong

https://mcp-intl.cn-hongkong.maxcompute.aliyun.com/mcp

Finance Cloud

Not yet available

-

Alibaba Gov Cloud

Not yet available

-

  • Cross-region access is allowed within the same region type. To access a project in a different service region, specify the region in the conversation. For example: "Show me the tables in the <project> project in the cn-shanghai region" or "Show me the tables in the <project> project in the ap-southeast-1 region".

  • The Hong Kong (China) service provides endpoints for both the Alibaba Cloud China Website (www.aliyun.com) and the Alibaba Cloud International Website (www.alibabacloud.com). When you log on with an account from the China website, use the endpoint with the mcp prefix. When you log on with an account from the international website, use the endpoint with the mcp-intl prefix. A single connection, OAuth authorization, and subsequent calls must always use the same endpoint domain name. Do not mix the two sites.

  • If a Region ID is not listed under "Service region", the public MCP endpoint for that region is not yet available. Do not try to construct the domain name directly.

VPC endpoints

Region type

Service region

MCP Endpoint

The Chinese mainland public cloud

cn-hangzhou

https://mcp.cn-hangzhou-vpc.maxcompute.aliyun-inc.com/mcp

Hong Kong (China) and outside China

cn-hongkong

https://mcp-intl.cn-hongkong-vpc.maxcompute.aliyun-inc.com/mcp

Whether you choose a public or VPC endpoint, the service defaults to the current connection's service region if the region is not specified in the conversation or tool parameters. For example, if you connect to the cn-hangzhou endpoint, the default region is cn-hangzhou. If you connect to the cn-hongkong endpoint, the default region is cn-hongkong.

Prerequisites

  • A network environment that can access the endpoint domain names listed above.

  • An MCP client that supports MCP Streamable HTTP and browser-based OAuth authorization.

  • An Alibaba Cloud account with access permissions for MaxCompute.

Limits

  • Permission scope: The projects, schemas, tables, and instances you can access are determined by your MaxCompute and RAM permissions.

  • IP address whitelist: The target MaxCompute project must not have an IP address whitelist configured. The MCP service does not currently support whitelist-based access for such projects. If a whitelist is configured, subsequent tool calls may fail.

  • Write operation confirmation: Write operations must be explicitly confirmed by the user on the client side. The gateway does not provide a second interactive confirmation.

Client configuration

Different MCP clients may use different names for configuration fields, but the core step is the same: set the MCP server URL to your chosen service endpoint address. The example below uses the public endpoint for the Chinese mainland public cloud. If you need the Hong Kong (China) or an international endpoint, replace the URL with https://mcp.cn-hongkong.maxcompute.aliyun.com/mcp. If your client runs in a VPC environment, replace it with the corresponding VPC service endpoint from the Supported regions table.

A general configuration looks like this:

{
  "mcpServers": {
    "maxcompute-mcp": {
      "type": "streamable-http",
      "url": "https://mcp.cn-hangzhou.maxcompute.aliyun.com/mcp"
    }
  }
}

If your client uses field names such as endpoint, server_url, or transport, configure them according to the client's documentation. The URL should still be the /mcp address from the service endpoint table above.

Claude Code

Add the HTTP MCP server from the command line:

claude mcp add --transport http --scope user maxcompute-mcp \
  https://mcp.cn-hangzhou.maxcompute.aliyun.com/mcp

After you add it, check the connection status:

claude mcp list
claude mcp login maxcompute-mcp

You can also enter /mcp in a Claude Code session to view the status and trigger the logon. If you want to use it only for the current project, change --scope user to --scope local or use a project scope as required by your team.

Codex

You can add the Streamable HTTP MCP server from the command line:

codex mcp add maxcompute-mcp \
  --url https://mcp.cn-hangzhou.maxcompute.aliyun.com/mcp

After the service is added, view the service list and log on:

codex mcp list
codex mcp login maxcompute-mcp

To configure it manually, add the following to ~/.codex/config.toml:

[mcp_servers."maxcompute-mcp"]
url = "https://mcp.cn-hangzhou.maxcompute.aliyun.com/mcp"

Qwen Code

Add the HTTP MCP server from the command line:

qwen mcp add --transport http --scope user maxcompute-mcp \
  https://mcp.cn-hangzhou.maxcompute.aliyun.com/mcp

If your client distribution uses a different command name, replace qwen above with the actual command name. After you add it, start Qwen Code and enter /mcp in a session to check the connection status and available tools. You can also add it manually in ~/.qwen/settings.json:

{
  "mcpServers": {
    "maxcompute-mcp": {
      "httpUrl": "https://mcp.cn-hangzhou.maxcompute.aliyun.com/mcp"
    }
  }
}

If the file already contains other configurations, merge only the mcpServers section. Do not overwrite existing settings.
Unless your client or enterprise environment has other requirements, you do not need to manually configure the Authorization header. The first connection completes the logon through the OAuth flow.

First-time connection and OAuth authorization

On the first connection, the MCP client automatically starts the OAuth authorization flow and opens the Alibaba Cloud authorization page in a browser.

Authorization flow

  1. Authorize the third-party application on the first connection.

    • Authorization scope: This authorization is for the maxcompute-mcp OAuth application, not for granting data permissions in MaxCompute.

    • Authorizing account: This must be done by a root account or a RAM administrator with the AliyunRAMFullAccess permission. Administrative permission is used only to authorize the third-party application and should not be used as the runtime identity for daily access to MaxCompute data. The projects, schemas, tables, and instances that each logged-on user can access are still determined by their own MaxCompute and RAM permissions.

    • After the application is authorized once under a root account, other RAM users under that account can log on and complete their own OAuth authentication. Not every RAM user needs the AliyunRAMFullAccess permission.

  2. Add the MaxCompute MCP Server in your MCP client and initiate a connection. This happens on the first connection to /mcp, or the first call to a tool such as tools/list.

  3. The client detects the logon requirement and automatically opens a browser to the Alibaba Cloud OAuth page.

  4. Confirm that the account and authorization information on the page are correct, and then click Agree or Authorize.

  5. The browser completes the callback. The client saves the token and automatically reconnects to the MCP service. You typically do not need to authorize again within the same session.

Notes

  • Verify page source: The OAuth page must come from an official Alibaba Cloud domain. If the domain name, account, or authorization information seems unusual, do not proceed.

  • Use the correct account: Complete the authorization with the Alibaba Cloud account that has permission to access the target MaxCompute data. The accessible projects and tables are tied to this account. Results may differ if you switch accounts.

  • Protect sensitive information: Do not share your access token, refresh token, authorization code, or parameters from the callback URL with others.

  • If the authorization page shows a "Call not authorized" message and states that the current authorization requires an administrator with AliyunRAMFullAccess permission, it means the currently logged-on RAM user does not have the permission to authorize third-party applications for the root account. In this case, ask the root account owner or a RAM administrator with this permission to log on to the MaxCompute MCP Server and click "Authorize". If the page still shows the previous failed authorization status, the administrator must delete the application in the OAuth application management section of the RAM console and then initiate the logon and authorization again from the MCP client. We do not recommend granting the AliyunRAMFullAccess permission to a daily-use account long-term just to bypass this prompt.

Account selection for shared enterprise systems

When you connect the Remote MCP Server to an internal enterprise Agent or other multi-user shared system, first determine how to preserve the end-user identity:

  • To isolate data based on employee permissions and retain user-level auditing, have each user complete the OAuth logon separately.
    MCP calls will use their individual Alibaba Cloud identities, and the data they can access will be determined by their respective MaxCompute and RAM permissions.

  • If the system can use only a single shared logon identity, create a dedicated RAM user and grant only the minimum required MaxCompute permissions. In this case, all requests share this identity's permissions and audit trail. The system itself is responsible for user authentication, session isolation, and operation auditing.

  • We do not recommend using a root account or an administrator account with AliyunRAMFullAccess as the long-term runtime identity for an LLM, internal enterprise Agent, or shared MCP client. The initial application authorization and daily data access should use different permission boundaries.

Connection verification

After authorization, perform a minimal verification as follows.

  1. First, have the client list the tools:

    tools/list
  2. Call the health check tool:

    {
      "name": "maxcompute_health_ping",
      "arguments": {}
    }
  3. On success, the returned structuredContent should contain:

    {
      "ok": true,
      "data": {
        "pong": true
      }
    }
  4. Next, list the MaxCompute projects visible to the current account:

    {
      "name": "maxcompute_schema_list_projects",
      "arguments": {
        "limit": 10
      }
    }

    If this step returns an empty list or a permission error, first check whether the current Alibaba Cloud account has permissions for the target MaxCompute project.

Local MCP Server

The local MCP Server is for self-hosting, stdio integration, local development and debugging, or scenarios where you need direct control over credentials. Most users and MCP client integrators do not need to deploy a local MCP Server.

Scenarios

Scenario

Is local MCP Server recommended?

Accessing MaxCompute from an MCP client

Not recommended. Use the Remote MCP Server instead.

Requiring a local stdio MCP Server

Can be used

Modifying or debugging MCP Server code

Can be used

Managing AK, STS, or Credentials URI manually

Can be used, but you must configure it with least privilege and follow key protection requirements.

Sharing one HTTP MCP Server among multiple users with dynamic configuration switching

Not recommended. Local named configurations are process-level states. Switching them at runtime affects other connections in the same process.

Prerequisites

  • Python

    • Version 3.10 or later.

    • You can use the uv package management tool to install dependencies and run services.

  • Alibaba Cloud credentials

    AK/SK, STS, Credentials URI, ECS RAM Role, or the default Alibaba Cloud credential chain.

  • MaxCompute

    • Project: You must have access to at least one MaxCompute project. Confirm your default project name—it is used to create the ODPS client, submit SQL, check permissions, and serve as the default context when project parameters are omitted.

    • Confirm your endpoint, for example: https://service.cn-hangzhou.maxcompute.aliyun.com/api.

  • Confirm your root account UID (also known as namespaceId).

Important notes

  • Do not commit config.json, AK/SK, STS tokens, Credentials URIs, query result files, or coverage outputs.

  • In production environments, prefer dynamic credential sources such as ALIBABA_CLOUD_CREDENTIALS_URI or RAM Roles.

  • Grant the identity used for MCP the least privilege access. Do not use high-permission root account AKs directly.

  • execute_sql enforces read-only protection, but create_table, insert_values, and update_table modify resources or metadata.

  • output_uri only allows writing to local files on the server. Use a dedicated secure directory and avoid sensitive system paths.

  • For high-cost, large-result, or cross-project queries, estimate costs first and verify that project, schema, and table references are correct.

If you encounter issues, contact the MaxCompute team or open an issue in the GitHub repository.

Download and install

Download MCMCP

GitHub Repo: https://github.com/aliyun/alibabacloud-maxcompute-mcp-server

Compatible with MCP clients such as Claude Code, OpenCode, Qoder, and Cursor.

Install from source

  1. In your terminal, run:

    git clone https://github.com/aliyun/alibabacloud-maxcompute-mcp-server.git
    cd alibabacloud-maxcompute-mcp-server
    uv sync
  2. Verify the CLI entry point:

    uv run alibabacloud-maxcompute-mcp-server --help
  3. Copy the configuration template:

    cp config.example.json config.json
    Warning

    config.json contains sensitive information (such as AK/SK). Keep it local only—do not commit it to Git.

  4. After editing config.json, start the service once from the command line to confirm there are no configuration errors:

    uv run alibabacloud-maxcompute-mcp-server --config config.json

The default transport method is stdio. After successful startup, the server waits for communication from the MCP client via standard input and output.

Configure MaxCompute connection

MCMCP supports two configuration sources:

  • Configuration file: Specify using --config /path/to/config.json or the environment variable MAXCOMPUTE_CATALOG_CONFIG.

  • Environment variables: These can override the configuration file or be used without any config file.

Using a configuration file

Warning

config.json contains sensitive information (such as AK/SK). Keep it local only—do not commit it to Git.

Example config.json:

{
  "maxcompute": {
    "maxcompute_endpoint": "https://service.cn-hangzhou.maxcompute.aliyun.com/api",
    "defaultProject": "<DEFAULT_PROJECT_NAME>",
    "namespaceId": "<ALIBABACLOUD_ACCOUNT_UID>",
    "accessKeyId": "<ALIBABA_CLOUD_ACCESS_KEY_ID>",
    "accessKeySecret": "<ALIBABA_CLOUD_ACCESS_KEY_SECRET>"
  }
}

Click to view field descriptions

Field

Required

Description

maxcompute_endpoint

Yes

MaxCompute service endpoint. Choose based on your region.

defaultProject

Strongly recommended

Default project name. Without this, SQL execution, permission checks, instance queries, and automatic Catalog endpoint resolution will not work.

namespaceId

Optional

Root account UID. Required only for search_meta_data.

catalogapi_endpoint

Optional

Specifies the address of the Catalog API. If this parameter is not configured, the ODPS client automatically parses the address from maxcompute_endpoint. Therefore, the defaultProject parameter is also typically required.

protocol

Optional

https or http. Usually inferred from the endpoint and does not need to be set.

accessKeyId / accessKeySecret

Optional

Static AK/SK. Suitable for development and testing. Use dynamic credentials in production.

securityToken

Optional

STS token. Used together with static AK/SK.

Using environment variables

export MAXCOMPUTE_ENDPOINT="https://service.cn-hangzhou.maxcompute.aliyun.com/api"
export MAXCOMPUTE_DEFAULT_PROJECT="<DEFAULT_PROJECT_NAME>"
export MAXCOMPUTE_NAMESPACE_ID="<ALIBABACLOUD_ACCOUNT_UID>"

# Method 1: AK/SK
export ALIBABA_CLOUD_ACCESS_KEY_ID="<ALIBABA_CLOUD_ACCESS_KEY_ID>"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="<ALIBABA_CLOUD_ACCESS_KEY_SECRET>"

# Method 2: STS
export ALIBABA_CLOUD_ACCESS_KEY_ID="<STS_ACCESS_KEY_ID>"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="<STS_ACCESS_KEY_SECRET>"
export ALIBABA_CLOUD_SECURITY_TOKEN="<STS_TOKEN>"

# Method 3: Credentials URI (recommended for production or platform-managed environments)
export ALIBABA_CLOUD_CREDENTIALS_URI="http://localhost:8765/credentials"

Credential resolution rules:

  • If AK/SK is set in environment variables or the config file, MCMCP uses those static credentials.

  • If no static AK/SK is set, MCMCP uses the default Alibaba Cloud Credentials SDK credential chain.

  • The default credentials chain can use ALIBABA_CLOUD_CREDENTIALS_URI, the local Alibaba Cloud configuration, or ECS RAM.

    RAM Role, OIDC, and other sources.

  • For automatic STS token refresh, prefer Credentials URI, RAM Role, or other dynamic credential sources.

Running modes

  • stdio mode:

    uv run alibabacloud-maxcompute-mcp-server
  • Local Streamable HTTP mode:

    uv run alibabacloud-maxcompute-mcp-server --transport http --host 127.0.0.1 --port 8000

Point the MCP client to:

http://127.0.0.1:8000/mcp

Configure your MCP client

Qoder / Cursor / Claude Code / generic stdio clients

  • Common client configuration locations

    Client

    Config location

    Cursor

    ~/.cursor/mcp.json

    Claude Code

    .mcp.json in your project root

    Other MCP clients

    Refer to your client’s MCP server configuration documentation

  • Configuration methods

    Using a config file

    {
      "mcpServers": {
        "alibabacloud-maxcompute-mcp-server": {
          "command": "uv",
          "args": ["--directory", "/absolute/path/to/alibabacloud-maxcompute-mcp-server", "run", "alibabacloud-maxcompute-mcp-server"],
          "env": {"MAXCOMPUTE_CATALOG_CONFIG": "/absolute/path/to/config.json"}
        }
      }
    }

    Using only environment variables

    {
      "mcpServers": {
        "alibabacloud-maxcompute-mcp-server": {
          "command": "uv",
          "args": ["--directory", "/absolute/path/to/alibabacloud-maxcompute-mcp-server", "run", "alibabacloud-maxcompute-mcp-server"],
          "env": {
            "MAXCOMPUTE_ENDPOINT": "https://service.cn-hangzhou.maxcompute.aliyun.com/api",
            "MAXCOMPUTE_DEFAULT_PROJECT": "<DEFAULT_PROJECT_NAME>",
            "MAXCOMPUTE_NAMESPACE_ID": "<ALIBABACLOUD_ACCOUNT_UID>",
            "ALIBABA_CLOUD_ACCESS_KEY_ID": "<AK_ID>",
            "ALIBABA_CLOUD_ACCESS_KEY_SECRET": "<AK_SECRET>"
          }
        }
      }
    }

DataWorks personal instance + Claude Code

DataWorks personal instances typically inject ALIBABA_CLOUD_CREDENTIALS_URI. In this environment, config.json only needs endpoint, default project, and optionally namespaceId:

{
  "maxcompute": {
    "maxcompute_endpoint": "https://service.cn-hangzhou.maxcompute.aliyun.com/api",
    "defaultProject": "<DEFAULT_PROJECT_NAME>",
    "namespaceId": "<ALIBABACLOUD_ACCOUNT_UID>"
  }
}

Example .mcp.json:

{
  "mcpServers": {
    "alibabacloud-maxcompute-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/alibabacloud-maxcompute-mcp-server",
        "run",
        "alibabacloud-maxcompute-mcp-server"
      ],
      "env": {
        "MAXCOMPUTE_CATALOG_CONFIG": "/absolute/path/to/alibabacloud-maxcompute-mcp-server/config.json",
        "ALIBABA_CLOUD_CREDENTIALS_URI": "<VALUE_FROM_DATAWORKS_ENV>"
      }
    }
  }
}

You can view the injected credentials URI inside the instance with:

echo "$ALIBABA_CLOUD_CREDENTIALS_URI"

Streamable HTTP mode

Use stdio by default. For remote or multi-process access, start in HTTP mode:

uv run alibabacloud-maxcompute-mcp-server \
  --config /absolute/path/to/config.json \
  --transport http \
  --host 127.0.0.1 \
  --port 8000

Set the MCP client address to:

http://127.0.0.1:8000/mcp

Verify connection

After configuration, restart your MCP client and enter the following in a conversation:

Show my MaxCompute identity information without querying detailed permissions

The Agent should call check_access and return a response like:

{
  "success": true,
  "data": {
    "identity": {
      "accessKeyId": "LTAI***xYzW",
      "defaultProject": "my_project",
      "endpoint": "https://service.cn-hangzhou.maxcompute.aliyun.com/api",
      "displayName": "user@example.com"
    }
  }
}

To also verify permission queries, use:

Show my MaxCompute permissions in the my_project project

MCP tool capability checklist

You typically do not need to fill in tool parameters manually. Just describe your goal in natural language.

The following table lists the MaxCompute tools to help integrators understand the scope of capabilities. The actual tools available to a client are determined by the response from tools/list.

Capability

Remote MCP tool

Local MCP tool

Connection check

maxcompute_health_ping

Verify with tools/list or any read-only tool

View projects and schemas

maxcompute_schema_list_projects, maxcompute_schema_get_project, maxcompute_schema_list_schemas, maxcompute_schema_get_schema

list_projects, get_project, list_schemas, get_schema

Table and partition metadata

maxcompute_schema_search_metadata, maxcompute_schema_list_tables, maxcompute_schema_describe_table, maxcompute_schema_list_partitions, maxcompute_schema_get_latest_partition, maxcompute_schema_get_table_ddl

list_tables, get_table_schema, get_partition_info, search_meta_data

SQL analysis and instances

maxcompute_sql_validate, maxcompute_sql_estimate_cost, maxcompute_sql_execute, maxcompute_sql_get_status, maxcompute_sql_fetch_result, maxcompute_sql_cancel, maxcompute_sql_get_logview, maxcompute_sql_list_instances, maxcompute_sql_list_queueing

cost_sql, execute_sql, get_instance_status, get_instance

Natural language SQL drafts

maxcompute_generate_sql: accepts a raw question, and optionally a single region and a hard sources scope. The server discovers accessible tables within the scope, retrieves the knowledge base, generates and validates a read-only SQL, and estimates the cost. It does not execute the SQL.

Not applicable

Job diagnosis

maxcompute_diagnose_job: accepts an instance_id with a project, or a restricted Logview URL. The server only parses the URL; it does not fetch or redirect to it. Based on job status accessible to the caller, it returns deterministic findings, evidence, and manual review suggestions. If plans, stages, logs, or historical evidence are unavailable, it explicitly returns partial.

Not applicable

View Quotas

maxcompute_quota_list, maxcompute_quota_get

Not applicable

Quota analysis

maxcompute_analyze_quota_usage: pass an exact quota_nickname to analyze a single subscription secondary Quota, or omit the nickname to compare the compute Quotas that have recently appeared in the tenant's Information Schema. Visible subscription secondary Quotas are augmented with the current CPU snapshot and inventory metadata. Read-only.

Not applicable

Account and permission checks

maxcompute_access_check

check_access

Table management and metadata maintenance

maxcompute_schema_create_table, maxcompute_schema_update_table, maxcompute_table_insert_values

create_table, insert_values, update_table

Knowledge base search and Q&A

maxcompute_kb_search, maxcompute_kb_ask

Not applicable

Skill discovery and reading

maxcompute_skill_list, maxcompute_skill_read

Not applicable

Information Schema semantic analysis

Built-in Information Schema semantic package

Requires separate installation of the alibabacloud-odps-information-schema Skill

Local session configuration

Not applicable

list_configs, get_current_config, use_config

Key constraints:

  • SQL execution and write operations

    • For read-only queries, validate with sql_review or estimate the cost before you run potentially resource-intensive queries.

    • The local MCP's execute_sql tool allows only read-only queries. The server forcibly attaches a read-only hint when it submits the job to MaxCompute.

    • When you run a write SQL statement with the Remote MCP Server, you must explicitly state that it is a write operation, and it can be run only after you receive user confirmation on the client side.

    • create_table, insert_values, update_table, and their corresponding Remote MCP write tools modify resources or metadata. Grant access carefully.

  • Schema constraints

    • You can usually omit the schema for Layer 2 MaxCompute projects.

    • For Layer 3 models, you must pass the corresponding schema based on the target object or SQL execution context.

  • Result set handling

    For large result sets, use paging, narrow the query scope, or read from an asynchronous instance. The local MCP Server can also write to a file through a local file://output_uri. This path is on the file system of the machine where the local MCP Server is running, not the MCP client machine.

  • Metadata search

    The local MCP's search_meta_data tool depends on namespaceId or MAXCOMPUTE_NAMESPACE_ID. The query syntax typically needs to include type=TABLE, type=RESOURCE, or type=SCHEMA.

  • Configuration switching

    The local MCP's list_configs, get_current_config, and use_config tools switch configurations at the process level and are better suited for stdio or single-client use.

  • Tools exclusive to the Remote MCP gateway

    maxcompute_kb_search, maxcompute_kb_ask, maxcompute_quota_list, maxcompute_quota_get, maxcompute_skill_list, maxcompute_skill_read, and maxcompute_search_catalog are tools exclusive to the Remote MCP gateway and are not provided by the local MCP Server. The actual tools available to a client are determined by the response from tools/list.

  • maxcompute_generate_sql requires the question parameter, and optionally accepts a single region and sources.

    • Each physical source can be scoped to a project, a project plus schema, or specific tables;

    • Multiple sources can express cross-project and cross-schema queries within the same region.

    • Sources serves as a hard authorization boundary, not a retrieval hint. Do not pass table schemas, DDLs, prompt context, or execution parameters;

    • Omit sources to fall back to the existing caller-authorized bounded discovery.

    • This tool consumes model credits, and the returned SQL must still be evaluated by the caller before execution.

  • maxcompute_diagnose_job requires exactly one job reference: an instance_id (passed together with project) or a restricted Logview URL. Do not pass a Logview token, raw logs, plan text, or diagnostic conclusions as parameters; the service does not fetch that URL, nor does it execute, retry, or cancel the job.

  • maxcompute_analyze_quota_usage accepts an optional region, an exact quota_nickname, and a natural language question.

    • Do not pass a project, user, table schema, pre-generated SQL, threshold, or diagnostic context.

    • When a nickname is specified, verify its Name and Nickname through the Quota API first, and then scope the Information Schema query by Nickname. When the nickname is omitted, aggregate tenant job consumption by the Information Schema quota_name, and align results with inventory by Nickname.

    • Compute Quotas that do not appear in the subscription secondary Quota inventory remain in the root-level quota_usage and information_schema_queries; they are neither guessed, mapped, nor dropped.

    • If the Information Schema query does not finish within the synchronous wait budget, the result is returned with outcome=partial and pending_information_schema_queries, which includes the Instance and LogView (not cancelled by the gateway), along with the continuation parameters for maxcompute_sql_get_status and maxcompute_sql_fetch_result.

  • current_cpu_usage is the current CPU usage returned by the WLM Quota API. It is not a normalized utilization ratio in the range of 0 to 1, so it may exceed 1. Only when current_cpu_usage_available=true does it mean the backend actually returned this value. Historical job resource consumption comes from bounded tenant-level queries on TASKS and TASKS_HISTORY. TASKS_HISTORY typically has about a 5-minute delay, and the query window is up to 14 days. There is still no caller-authorized data API for historical Quota utilization, so averages, peaks, P90 levels, or scaling conclusions must not be inferred from job consumption. Regardless of whether the evidence is complete, the results must not be used to automatically scale, schedule, migrate, or cancel jobs.

  • The execution_mode of maxcompute_sql_execute defaults to wlm: when quota_name is specified, the gateway passes it as the odps.task.wlm.quota hint for regular instances. When using MaxQA (MCQA v2), execution_mode=maxqa and an interactive quota_name must be explicitly passed, and settings.odps.task.wlm.quota cannot be passed at the same time. The gateway internally obtains and reuses the MaxQA connection and cookies; the client only needs to pass back the regular project and instance_id in subsequent calls to maxcompute_sql_get_status, maxcompute_sql_fetch_result, or maxcompute_sql_cancel, and must not pass or store these credentials. A successful MaxQA instance ID usually ends with _mcqa.

Information Schema semantic package

Information_Schema is a system-level Ops semantic skill built on MaxCompute tenant-level INFORMATION_SCHEMA metadata views. It gives data teams comprehensive capabilities for project auditing, usage analysis, and operational observability by turning complex low-level metadata into natural-language-queryable metrics and entities.

Skill Repo: https://skills.alibabacloud.com/skills/alibabacloud-odps-information-schema

The main application scenarios are as follows:

  • Storage pressure diagnosis

    • Capability: Identify top storage-consuming tables, detect partition bloat risks, and spot data freshness issues.

    • Prompt example: "Analyze the top 10 tables by storage usage in my tenant" or "Check which tables have partition bloat risks."

  • Cost pressure diagnosis

    • Capability: Break down job costs by owner, project, or type. Track CU-hour consumption and identify high-resource jobs.

    • Prompt example: "What were the most expensive jobs in the last week?" or "Rank users by resource consumption."

  • Job failure surge analysis

    • Capability: Monitor failure rate trends and drill down by type, owner, or project to find root causes.

    • Prompt example: "List failed jobs in the last 24 hours" or "Show failure rates by job type."

  • Permission exposure audit

    • Capability: Audit table-level grants, identify high-risk administrator accounts, and detect over-granting.

    • Prompt example: "Which users have admin permissions?" or "Count tables granted to each user."

  • Hot table monitoring

    • Capability: Identify frequently accessed tables and automatically detect "zombie tables" based on last access time.

    • Prompt example: "Which tables are accessed most often?" or "Find zombie tables not accessed in the last 90 days."

  • Metadata governance gap analysis

    • Capability: Measure table and column comment coverage to find metadata gaps and stale data.

    • Prompt example: "What is the column comment coverage rate?" or "List tables without table comments."

  • Job performance analysis

    • Capability: Analyze average and P99 job durations to identify long-tail slow jobs and abnormal queuing.

    • Prompt example: "Show the slowest P99 jobs" or "What was the average job duration last week?"

  • Data tunnel audit

    • Capability: Track Tunnel upload and download volumes, trace public network download IPs, and detect abnormal transfers.

    • Prompt example: "Show Tunnel data volume in the last 24 hours" or "Audit public network download source IPs."

  • User role audit

    • Capability: Map user-role relationships, review admin role assignments, and identify inactive high-privilege accounts.

    • Prompt example: "List all admin and super_administrator users" or "Show user role assignments."

  • Partition lifecycle analysis

    • Capability: Monitor partition growth trends, verify lifecycle policy enforcement, and check expired partition cleanup.

    • Prompt example: "Which tables have more than 500 partitions?" or "Find partitioned tables without lifecycle enabled."

  • Quota resource monitoring

    • Capability: Monitor real-time CPU and memory quota usage and alert on bottlenecks or imbalanced allocations.

    • Prompt example: "Show CPU usage for all Quotas" or "Which Quotas exceed their usage threshold?"

Scenarios

Browse projects and tables

Example:

List MaxCompute projects I can access, then show schemas in my_project
Show fields, partition keys, and table comments for user_info in my_project's default schema

Run SQL queries securely

Estimate cost before execution:

First show the structure of the orders table, then estimate the cost of this SQL:
SELECT COUNT(*) FROM orders WHERE dt='2026-05-01'

Run a read-only query:

Run this read-only query in my_project:
SELECT * FROM default.orders WHERE dt='2026-05-01' LIMIT 100

For large queries, use asynchronous execution:

Run this query asynchronously. After returning the instanceId, poll its status and read the first 100 rows when done

Export large results

Inline results are capped by row limits. For full results, use output_uri:

Run this query synchronously and write the full result to file:///tmp/maxcompute-result/orders.jsonl;
Only show me a preview and the final outputPath in the response
Note

output_uri writes to the local file system of the MCP server—not your client machine.

Check identity and permissions

Show the MaxCompute identity used by MCP and list my permissions in my_project

Search metadata

Search the Catalog for tables with names containing 'orders', limited to my_project

View Quotas

List the MaxCompute Quotas available to my current account, and show the details of the default Quota.

Knowledge base search and Q&A

How do I use dynamic partitions for inserts in MaxCompute? Please search the documentation and provide an answer with citations.
What is the difference between a clustered table and a standard table in ODPS? In what scenarios is it appropriate to use a clustered table?

Use Information Schema for governance and O&M analysis

Analyze the top 10 tables by storage usage in the current tenant.
What were the most expensive jobs in the last week? Summarize by owner and project.

The Remote MCP Server has a built-in Information Schema semantic package, so you can use these types of questions directly. For the local MCP Server, you must first install the corresponding Skill in the client or Agent environment before you use these scenarios.

Maintain business metadata

First read the current schema of default.orders, then update the table comment to 'Order fact table'
and change the buyer_id column comment to 'Buyer ID'

update_table supports these changes:

  • Table comment: description

  • Tags: labels

  • Lifecycle: expiration.days, expiration.partitionDays

  • Column comments: columns.setComments

  • Change top-level columns from non-nullable to nullable: columns.setNullable

  • Add new columns: columns.add

MaxCompute does not support deleting columns, changing column types, reordering columns, inserting columns in the middle, changing nullable columns to non-nullable, or modifying nullability of nested columns via this tool.

Create tables and insert small data sets

Create a test table demo_user in my_project.default
with fields id BIGINT, name STRING, and dt STRING as a partition key, with a 7-day lifecycle
Insert two test rows into demo_user with dt partition value 2026-05-18

These operations modify MaxCompute resources. Grant permissions only for test or controlled projects.

FAQ

Unsure whether to use Remote or Local

Use the Remote MCP Server. Use the local MCP Server only if you need self-hosting, stdio, local development, or direct control over credentials.

MCP client does not show tools

Check the following:

  1. Is command set to uv? Does args include --directory pointing to the absolute path of the repo?

  2. If the client cannot find uv, replace command with the absolute path returned by which uv.

  3. Have you run uv sync in the repo?

  4. Does MAXCOMPUTE_CATALOG_CONFIG point to the correct config.json?

  5. Did you restart Cursor, Claude Code, or your MCP client?

  6. Does manually running uv run alibabacloud-maxcompute-mcp-server --help in the repo directory succeed?

Authentication or connection failures

Check the following:

  1. Does MAXCOMPUTE_ENDPOINT or maxcompute_endpoint match your project’s region?

  2. Are your AK/SK or STS token valid and not expired?

  3. If using a credentials service, can ALIBABA_CLOUD_CREDENTIALS_URI be accessed from the MCP server machine?

  4. Has the current identity been granted access to the target project?

  5. First verify your identity with check_access, then troubleshoot specific tools.

search_meta_data returns an error

Common causes:

  • namespaceId or MAXCOMPUTE_NAMESPACE_ID is not configured.

  • The query lacks type=TABLE, type=RESOURCE, or type=SCHEMA.

  • The query uses incompatible project and region conditions.

SQL table name resolution fails

First call get_table_schema and have the Agent use the returned sqlTableRef.

  • Three-layer model tables commonly use schema.table or project.schema.table;

  • Two-layer model tables commonly use table or project.table.

SQL execution times out or results are truncated

  • We recommend asynchronous execution by default. After obtaining the instanceId, use get_instance_status and

    get_instance to retrieve the results.

  • For synchronous execution, set a timeout. If it times out, you can still use the returned instanceId to continue querying.

  • For large results, use output_uri=file:///path/to/result.jsonl to write to a local file on the server.

  • Before execution, call cost_sql, then use maxCU to limit resource consumption.

Other common errors

If the client displays the raw tool result, a failed response usually includes a request_id and an error code. Common solutions are as follows:

Symptom

Solution

Logon is required on the first connection

Complete the authorization on the Alibaba Cloud OAuth page in your browser.

The OAuth page does not appear

Check whether the client supports MCP OAuth. Check whether your browser or the callback port is being blocked.

401 / Unauthorized

Re-authorize. Confirm that the token saved by the client has not expired or been cleared.

403 / Insufficient permissions

Switch to an Alibaba Cloud account with the required permissions, or grant the necessary permissions in MaxCompute or RAM.

Access to a project or table fails after authorization

Check whether the target project has an IP whitelist configured. The Remote MCP service does not currently support this whitelist scenario.

A specific Remote MCP tool is not visible in tools/list

Confirm that the client is connected to the correct endpoint. The actual list of tools is determined by the tools/list response.

SQL write operation is rejected

Use mode: "write" and obtain user confirmation on the client side first.

Query result is too large

Use LIMIT, the paging parameters limit or cursor, or narrow the query scope.

Region does not match expectations

Explicitly specify the target Region ID in the conversation or tool parameters. For service endpoint regions, see the tables above.

Local MCP tool names do not match Remote MCP tool names

The tool names are different. The Remote MCP Server uses maxcompute_* tool names. The local MCP Server uses the tool names from the README in the local repository.

When you troubleshoot, record the request_id, tool name, time, and a sanitized version of the error code. Do not record or share tokens, authorization codes, sensitive business data in full SQL statements, sensitive account information, or content from Logview that should not be shared.

Security precautions

Use the Remote MCP Server. Do not configure a long-term AccessKey in a local MCP Server just for trial purposes.

  • Use trusted clients

    Configure and access production endpoints only through trusted MCP clients. Do not make MCP requests from untrusted pages.

  • Complete OAuth authorization yourself

    You must personally handle the OAuth confirmation page. Do not let others click it for you.

  • Use an account with least privilege

    The MaxCompute resources that MCP can access are determined by the account's permissions. Connect with an account that has only the necessary permissions.

  • Do not leak sensitive credentials

    • Do not share tokens, refresh tokens, authorization codes, keys, or callback URLs in chats, tickets, documents, or screenshots.

    • Do not commit your AccessKey, STS token, config.json file, or Credentials URI to Git.

  • Explicitly confirm write operations

    Before you run a write operation, confirm that the client has displayed the target project, table, SQL, or a summary of the changes. Verify that the information is correct before you proceed.

Feedback channels

To provide feedback on the Remote MCP service, client compatibility, tool errors, documentation issues, or feature suggestions, submit it through the following channels:

You can also have the Agent read skill://maxcompute-mcp-feedback/SKILL.md to obtain issue template links, suggested diagnostic fields, and sanitization rules. This resource does not create a GitHub issue for you, nor does it upload logs or save feedback content.

Before you submit, confirm that the issue does not contain the following: tokens, cookies, AccessKeys, OAuth callback URLs with query parameters, sensitive SQL, customer data, or sensitive Logview content.

For issues related to account-level permissions, billing, Service-Level Agreements (SLAs), production failures, security vulnerabilities, or confidential data, contact official Alibaba Cloud support or security channels. Do not report these in a public issue.