MaxCompute MCP

更新时间:
复制 MD 格式

MaxCompute MCP Server (MCMCP) uses the MCP (Model Context Protocol) to package MaxCompute metadata, compute, and table management capabilities into structured tools that AI Agents can invoke. MCMCP enables AI Agents to directly perform large-scale data analytics, multimodal data processing, and intelligent operations and maintenance (O&M).
This topic describes the managed 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: Check the current account's identity and use MaxCompute authorization information to troubleshoot access issues.

  • Authentication and authorization:

    • Remote MCP uses Alibaba Cloud OAuth for authorization.

    • Local MCP supports AccessKey/SecretKey, Security Token Service, Credentials URI, ECS RAM Role, and the default Alibaba Cloud credential chain.

  • Read-only SQL analysis: Cost estimation, asynchronous execution, instance status queries, and result retrieval. The server protects the read-only query path. Write and metadata modification capabilities are listed separately and require user confirmation.

  • Information Schema operations and governance analysis:

    • Remote MCP includes a built-in Information Schema semantic pack.

    • Local MCP requires the corresponding Skill to be installed separately.

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.

Access methods

  • Remote MCP Server is the recommended access method. It eliminates the need to run an MCP Server locally or store an AccessKey in the local MCP process.

  • Local MCP Server is reserved for scenarios that require self-hosted deployments, stdio integration, local development and debugging, or direct control over credentials.

Scenario

Recommended method

Description

Access 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.

Access a managed service from an enterprise VPC environment

VPC endpoint for the Remote MCP Server

It uses the same OAuth and tool semantics as the public endpoint, but with a different entry domain.

Develop locally, debug MCP Server code, or require stdio or a self-hosted setup

Local MCP Server

This is an advanced option that requires a local Python environment and MaxCompute credential configuration.

Modify the local server code or report 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 remote MCP production service uses MCP Streamable HTTP. Your client must support an HTTP MCP Server and be able to handle the OAuth authorization flow.

Supported regions

Choose an entry point based on the network where your client is located.

You must use the same entry domain for the initial connection, OAuth authorization, and all subsequent calls. Do not mix public and VPC domains during the authorization process.

Public endpoint

Public MCP endpoints are available in specific service regions. The currently available regions are listed below:

Region type

Service region

MCP endpoint

Chinese mainland public cloud

cn-hangzhou

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

China (Hong Kong) and international regions

cn-hongkong

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

Finance Cloud

Not yet available

-

Government Cloud

Not yet available

-

To access a project in a non-default region, specify the region in your prompt. For example: "List the tables in the cn-shanghai region for the <project> project."

If a region ID is not listed in the "Service region" column, the public MCP endpoint for that region is not yet available. Do not attempt to construct the domain name manually.

VPC endpoint

Region type

Service region

MCP endpoint

Chinese mainland public cloud

cn-hangzhou

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

China (Hong Kong) and international regions

cn-hongkong

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

Regardless of whether you choose a public or VPC endpoint, if you do not specify a region in your prompt or tool parameters, the service defaults to the region of the endpoint you are currently connected to. For example, if you are connected to the cn-hangzhou endpoint, the default region is cn-hangzhou. If you are connected to the cn-hongkong endpoint, the default region is cn-hongkong.

Prerequisites

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

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

  • An Alibaba Cloud account with permission to access MaxCompute.

Limitations

  • Permission scope: Your MaxCompute and RAM permissions determine the accessible projects, schemas, tables, and instances.

  • IP whitelist: The target MaxCompute project should not have an IP whitelist enabled. The MCP service does not currently support this scenario. If a whitelist is configured, subsequent tool calls may fail.

  • Write operation confirmation: Write operations require explicit user confirmation on the client side. The gateway does not provide an interactive secondary confirmation.

Client configuration

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

The general configuration format is as follows:

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

If your client uses field names like endpoint, server_url, or transport, follow your client's documentation. The URL should still be the service address ending in /mcp from the table above.

Claude Code

We recommend adding 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 adding the server, you can check the connection status:

claude mcp list
claude mcp login maxcompute-mcp

You can also type /mcp in a Claude Code session to view the server and trigger sign-in. If you want to use the server only for the current project, change --scope user to --scope local or use a project scope as defined by your team.

Codex

We recommend adding the Streamable HTTP MCP server from the command line:

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

After adding the server, list the services and initiate sign-in:

codex mcp list
codex mcp login maxcompute-mcp

For manual configuration, add the following to ~/.codex/config.toml:

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

Qwen Code

We recommend adding 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 current client distribution uses a different command name, replace qwen with the actual command name. After adding the server, start Qwen Code and enter /mcp in a session to check the connection status and available tools. You can also add it manually to ~/.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 requires it, you do not need to manually configure the Authorization header. The OAuth flow handles the initial sign-in on your first connection.

First connection and OAuth authorization

On your first connection, the MCP client automatically initiates an OAuth authorization flow and opens the Alibaba Cloud authorization page in your browser.

Authorization flow

1. 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 tools/list or another tool.

2. The client detects the sign-in requirement and automatically opens a browser to the Alibaba Cloud OAuth page.

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

4. After the browser callback completes, 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 be from an official Alibaba Cloud domain. If the domain, account, or authorization information seems incorrect, do not proceed.

  • Use the correct account: Complete the authorization using the Alibaba Cloud account that has permission to access the target MaxCompute data. The projects and tables you can access depend on this account, and results may differ if you switch accounts.

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

Verify connectivity

After authorization is complete, we recommend performing the following minimal validation steps.

  1. First, have the client list the available 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 permission for the target MaxCompute project.

Local MCP server

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

Use cases

Scenario

Recommendation

You only want to access MaxCompute from an MCP client.

Not recommended. Use the Remote MCP Server instead.

You need a local stdio MCP Server.

Yes.

You need to modify or debug MCP Server code.

Yes.

You need to manage your own AccessKey, STS credentials, or Credentials URI.

Yes, but you must configure it with the principle of least permission and follow key protection best practices.

Multiple users share a single HTTP MCP Server and dynamically switch configurations.

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

Prerequisites

  • Python

    • Version 3.10 or later.

    • We recommend using the uv package management tool to install dependencies and run the service.

  • 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).

Precautions

  • 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 installation

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 the 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

Catalog API address. If not set, MCMCP automatically resolves it from maxcompute_endpoint using the ODPS client, so defaultProject is usually also needed.

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 your MCP client to:

http://127.0.0.1:8000/mcp

Configure the 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 the 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 capabilities

You typically do not need to manually enter tool parameters. Instead, you can describe your objective in natural language.

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

Capability

Remote MCP tools

Local MCP tools

Connection check

maxcompute_health_ping

Verify by calling 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

Account and permission check

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

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, use sql_review to validate the SQL or estimate its cost before you run a potentially resource-intensive query.

    • The execute_sql method of Local MCP allows only read-only queries because the server forcibly adds a read-only hint when a MaxCompute job is submitted.

    • When a Remote MCP executes a SQL write operation, it must be clearly identified as a write operation. The operation can only be executed after receiving user confirmation on the client.

    • The create_table, insert_values, and update_table tools, and their corresponding Remote MCP write tools modify resources or metadata. Grant permissions for these tools with caution.

  • Schema constraints

    • For 2-tier MaxCompute projects, you can typically omit the schema.

    • For 3-tier models, you must provide the relevant schema based on the target object or the SQL execution context.

  • Result set processing

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

  • Metadata search

    The search_meta_data tool in the Local MCP depends on namespaceId or MAXCOMPUTE_NAMESPACE_ID. The query syntax typically includes
    type=TABLE, type=RESOURCE, or type=SCHEMA.

  • Configuration switch

    The list_configs, get_current_config, and use_config tools in the Local MCP are process-level configuration-switching tools. They are best suited for stdio or single-client use cases.

Information Schema semantic skill

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.aliyun.com/skills/alibabacloud-odps-information-schema

Key use cases include:

  • 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 identify 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 admin accounts, and detect excessive permission risks.

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

  • Hot table monitoring

    • Capability: Identify hot tables based on access frequency and automatically discover zombie tables based on their 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 identify metadata gaps and governance weak points related to data freshness.

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

  • Job performance analysis

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

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

  • Tunnel Audit

    • Capability: Track Tunnel upload and download volumes, trace download IP addresses from the public network and detect abnormal data transfer.

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

  • User role audit

    • Capability: Review user-to-role mappings, audit the assignment of administrative roles, 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 count growth trends, verify lifecycle policy enforcement and check the cleanup status of expired partitions.

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

  • Quota resource monitoring

    • Capability: Monitor CPU and memory quota usage in real time, alerting on resource bottlenecks and imbalanced allocation.

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

Use cases

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

Governance and O&M analysis with Information Schema

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

The Remote MCP has a built-in Information Schema semantic skill, so you can use these types of queries directly. For the Local MCP, you must first install the corresponding Skill in your client or agent environment to enable 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

Remote vs. local MCP server

Use the Remote MCP Server by default. Use the Local MCP Server only for self-hosting, stdio integration, local development, or when you need 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 results, a failed response usually includes a request_id and an error code. Common handling methods are as follows:

Symptom

Solution

Login required on first connection

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

OAuth page does not appear

Verify that your client supports MCP OAuth and that your browser or the callback port is not blocked.

401 / Unauthorized

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

403 / Permission Denied

Use 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 if the target project has an IP allowlist configured. The Remote MCP service does not currently support this scenario.

A specific Remote MCP tool does not appear in the tools/list output

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

SQL write operation rejected

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

Query result is too large

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

Region does not match expectations

Explicitly specify the target Region ID in the dialog box or tool parameters. For the service entry region, see the preceding text.

Local MCP and Remote MCP tool names do not match

The two tools have different names. Remote MCP uses the tool name maxcompute_*. Local MCP uses the tool name from the README file in the local repository.

When troubleshooting, you can record the request_id, tool name, timestamp, and masked error code. Do not record or transmit tokens, authorization codes, sensitive business data in complete SQL statements, sensitive account information, or content from Logview that should not be shared externally.

Security precautions

Users should use the Remote MCP Server by default. Do not configure a long-term AccessKey on a local MCP Server for testing.

  • Use a trusted client

    Use only a trusted MCP Client to configure and access production endpoints. Do not initiate MCP requests from untrusted pages.

  • Complete OAuth authorization yourself

    Always complete the OAuth confirmation process yourself. Do not allow others to do it on your behalf.

  • Use an account with least privilege

    Your account permissions determine which MaxCompute resources you can access through MCP. Connect using an account that has only the necessary permissions.

  • Do not expose sensitive credentials

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

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

  • Explicitly confirm write operations

    Before execution, check that the client displays the target project, table, SQL statement, or a summary of changes. Verify this information is correct before proceeding.

Feedback channels

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

You can also have the agent read skill://maxcompute-mcp-feedback/SKILL.md to get links to issue templates, recommended diagnostic fields, and data masking rules. This resource does not replace creating a GitHub issue, nor does it upload logs or save your feedback.

Before you submit an issue, ensure that it does not include any of the following: token, Cookie, AccessKey, an OAuth callback URL with query parameters, sensitive SQL, customer data, or sensitive Logview content.

For issues related to account-level permissions, billing, SLAs, production incidents, security vulnerabilities, or confidential data, contact Alibaba Cloud official support or a secure channel. Do not report these in a public issue.