Configure the MCP client
This topic describes how to configure the MCP service of Realtime Compute for Apache Flink in clients such as Qoder, Qoder CN, Cursor, Claude Code, and Codex, including OAuth, static credentials, agent-driven configuration, and connection verification.
Prerequisites
-
The edition to use, Core or Custom, is determined. See MCP service overview.
-
The target client is installed and supports MCP.
-
For static credential access, Python 3.13 or later and
uvare installed, and the system policyAliyunOpenAPIMCPServerStaticCredentialAccessis granted to the RAM user.
Obtain the MCP endpoint
For the Core edition, log on to the console to obtain the endpoint. For the Custom edition, create a server and select API operations first. The client configuration is the same for both.
Core edition (recommended)
-
Log on to the OpenAPI MCP Server console.
-
In the left-side navigation pane, click the Core tab. The page shows the Streamable HTTP Endpoint and the SSE Endpoint, assigned automatically based on your logon identity. No server creation is required.
-
Modify the advanced settings as needed: multi-account MCP, public access, and custom VPC allowlist.
The Core edition provides 15 built-in tools in five categories: API discovery and exploration, API execution, advanced orchestration, infrastructure as code, and documentation retrieval. The model matches and calls Flink API operations by semantic search. No API selection is required.
Note The Core edition endpoint covers all Alibaba Cloud OpenAPI operations. When you call Realtime Compute for Apache Flink, specify the product code and the API version in your prompt: ververica (2022-07-18) for management-side operations and foasconsole (2021-10-28) for sales-side operations.
Custom edition (advanced)
The selected API operations are exposed directly to the model as tools, with no semantic search. For use cases and API selection guidance, see MCP scenarios and API selection.
-
Log on to the OpenAPI MCP Server console. In the left-side navigation pane, choose .
-
Configure the parameters as described in the following table.
|
Parameter |
Recommended value |
Description |
|
Name |
|
3 to 16 characters. Lower-case letters, digits, |
|
Document language |
English |
Determines the language of the tool descriptions |
|
OAuth |
Alibaba Cloud OAuth |
Select Custom OAuth to connect a self-managed platform |
|
Cloud product and API list |
Select Realtime Compute for Apache Flink and select the nine read-only operations of the job diagnosis package, listed in MCP scenarios and API selection |
Each selected operation is exposed as one MCP tool |
|
MCP instructions |
Paste the template in MCP instructions |
Guides the model to call tools in the diagnosis workflow |
-
Click Create and confirm the risk notice.
-
After the server is created, the page shows the Streamable HTTP Endpoint and the SSE Endpoint. Copy and store them. The endpoint uses the following format.
https://openapi-mcp.cn-hangzhou.aliyuncs.com/accounts/<account-id>/custom/<server-name>/id/<service-id>/mcp
Note In a VPC environment, use the VPC endpoint shown on the page. Its domain name is in the format openapi-mcp-cn.vpc-proxy.aliyuncs.com and its path follows the same rules as the public endpoint. Public access is enabled by default. After you disable it, the server is accessible only from VPCs in the whitelist.
Clients and access methods
|
Scenario |
Method |
Description |
|
Desktop AI client with browser OAuth, such as Qoder, Qoder CN, Cherry Studio, or Cursor |
OAuth |
No AccessKey configuration is required. Authorize in the browser and start using the server. Recommended. |
|
Enterprise agent platform, CI/CD, or unattended integration |
Static credentials and mcp-proxy |
Uses the AccessKey pair of a RAM user. Follow the principle of least privilege. |
|
Self-managed platform with its own OAuth system, such as Dify or AgentScope |
Custom OAuth |
Configure custom OAuth credentials when you create the MCP server. |
OAuth
If your client supports remote MCP servers, add the server in the MCP settings of the client and set the URL to the Streamable HTTP Endpoint. Clients that require an explicit transport type accept streamable-http or sse. Qoder detects the transport type from the URL, so you do not need to specify it.
{
"mcpServers": {
"openapi-mcp": {
"type": "streamable-http",
"url": "<your Streamable HTTP Endpoint>"
}
}
}
If your client supports only STDIO, such as Cursor or Qoder CN, bridge the connection with mcp-remote-alibaba-cloud.
{
"mcpServers": {
"openapi-mcp": {
"command": "npx",
"args": [
"mcp-remote-alibaba-cloud",
"<your Streamable HTTP Endpoint>"
]
}
}
}
Claude Code and Codex are configured from the command line, with no manual editing of configuration files. Run the list command after adding the server to confirm that it is registered.
# Claude Code
claude mcp add openapi-mcp -- npx mcp-remote-alibaba-cloud "<Streamable HTTP Endpoint>"
claude mcp list
# Codex
codex mcp add openapi-mcp -- npx mcp-remote-alibaba-cloud "<Streamable HTTP Endpoint>"
codex mcp list
For Cursor, paste the configuration into ~/.cursor/mcp.json or .cursor/mcp.json in the project root. For Qoder CN, add the server on the MCP Tools page of the plug-in and select the STDIO type.
On the first connection, a browser window opens for authorization. Log on as a RAM user that belongs to the same Alibaba Cloud account as the MCP server and confirm the authorization. The client can then list and call the tools.
Important On a shared device, make sure that you log on as the intended RAM user. Authorization from an unrelated account results in incorrect permissions.
Static credentials
Use the local proxy alibabacloud.mcp-proxy with the AccessKey pair of a RAM user. Run the pre-check first to confirm that the proxy and the permissions are ready.
uvx alibabacloud.mcp-proxy@latest --server-url <MCP endpoint> pre-check
Add the MCP server in your client as an STDIO server with the following settings.
|
Setting |
Value |
|
Type |
|
|
Command |
|
|
Arguments |
|
|
Environment variables |
|
If you have signed in by running aliyun configure, the proxy reuses the credentials of the Alibaba Cloud CLI and you can omit the environment variables.
The following snippet shows a complete configuration. Inject the AccessKey pair through environment variables instead of writing it into the configuration file.
{
"mcpServers": {
"openapi-mcp": {
"command": "uvx",
"args": [
"alibabacloud.mcp-proxy@latest",
"--server-url",
"<Streamable HTTP Endpoint>"
],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "<AccessKey ID of the RAM user>",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "<AccessKey secret of the RAM user>"
}
}
}
}
Warning Do not hard-code AccessKey pairs in configuration files that are under version control. Use environment variables or a secret management service instead.
Let the agent configure the connection
Agents that can read and write local configuration files, such as Qoder, Claude Code, Codex, and Cursor, can run the following prompt to complete the configuration and the self-check instead of clicking through the settings. Replace the endpoint before you paste it.
Configure the MCP service of Realtime Compute for Apache Flink for this project and verify the connection:
1. Add a server named openapi-mcp to the MCP configuration file. Set the transport type to streamable-http and the url to <Streamable HTTP Endpoint>.
2. Save the file, reconnect, and list all tool names exposed by the server with the total count.
3. For the Core edition, confirm that the tool list contains SearchApis and CallCLI. For the Custom edition, confirm that it contains ververica-20220718-ListDeployments.
4. Call one read-only tool to verify connectivity: list the deployments in the cn-hangzhou region.
5. Report the configuration file path, the total number of tools, and a summary of the verification response.
If the call returns 401 Authorization header is missing, the endpoint requires authentication. Complete the browser OAuth authorization and try again.
Note Configuration files written by the agent may be under version control. For static credential access, confirm that the AccessKey pair is not written into the file.
Verify the connection
For the Core edition, first ask: "List the compute-related Alibaba Cloud services." A returned product list confirms that the MCP connection works.
Then verify the Flink calls. Ask your client: "List my jobs in Realtime Compute for Apache Flink and check why the most recent failed job stopped."
Expected behavior: the model calls the job list, instance query, and diagnosis tools in sequence, and returns the root cause and a recommended action for the failed instance.
Every tool requires the workspace (workspace ID) and namespace parameters. Provide them in your prompt. The job diagnosis package of the Custom edition does not include an operation that discovers workspaces. If you want the agent to locate them on its own, also select the sales-side operations DescribeInstances and DescribeNamespaces.
Security considerations
-
Least privilege: create a dedicated RAM user for MCP access and grant only the permissions required by the selected read-only operations. Static credential access also requires
AliyunOpenAPIMCPServerStaticCredentialAccess. -
No account-level AccessKey pair: static credential access must use the AccessKey pair of a RAM user, granted with the minimum permissions required.
-
Read-only boundary: the recommended job diagnosis package (see MCP scenarios and API selection) contains read-only operations only. It cannot perform changes such as start, stop, or scaling.
-
Isolate write operations: for O&M scenarios such as start, stop, and scaling, create a separate MCP server and approve its permissions separately in RAM.
-
Multi-tenant isolation: MCP can query job information in all workspaces within the authorized scope. In multi-tenant scenarios, isolate access with RAM policies.