mcpField
A
Alibaba Cloud FC MCP Server

Alibaba Cloud FC MCP Server

Local
github.com/aliyunCloud & Infra9Updated 72w ago

About Alibaba Cloud FC MCP Server

Alibaba Cloud FC MCP Server connects Alibaba Cloud Function Compute with agent applications through Serverless Devs and OpenAPI. It is for users who need to deploy and manage functions through MCP tools, including custom runtime functions and domain routes.

Key features

  1. 01Package and deploy custom runtime functions
  2. 02Update function parameters
  3. 03Get and list functions
  4. 04Delete functions
  5. 05Manage custom domain routes

Use cases

  1. 01Deploy a project to Function Compute from an agent app
  2. 02View functions in a specified region
  3. 03Update a function or inspect its details
  4. 04Change custom domain route configuration

MCP support

This MCP server exposes Function Compute tools to agent applications that support MCP. The tools cover function deployment, updates, retrieval and deletion, as well as custom domain route configuration.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"alibabacloud-fc": {
"command": "npx",
"args": [
"-y",
"alibabacloud-fc-mcp-server"
],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "<ALIBABA_CLOUD_ACCESS_KEY_ID>",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "<ALIBABA_CLOUD_ACCESS_KEY_SECRET>"
}
}
}
}
Run commandnpx -y alibabacloud-fc-mcp-server
Environment variables to set
ALIBABA_CLOUD_ACCESS_KEY_IDSecret
ALIBABA_CLOUD_ACCESS_KEY_SECRETSecret

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmalibabacloud-fc-mcp-server

Tools

12

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
locationstringYesThe root path of the local code project, e.g. /Users/xxx/my-project. No need to package it as a zip.
functionNamestringYesFunction name. The function name must be unique in each region.
regionenumNoDeployment region. The currently available regions are cn-hangzhou, cn-shanghai, cn-beijing, cn-shenzhen, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, ap-south-1, me-east-1, cn-chengdu, cn-wulanchabu, and cn-guangzhou. The default is cn-hangzhou.cn-hangzhou | cn-shanghai | cn-beijing | cn-shenzhen | cn-hongkong | ap-southeast-1 | ap-southeast-2 | ap-southeast-3 | ap-southeast-5 | ap-northeast-1 | eu-central-1 | eu-west-1 | us-west-1 | us-east-1 | ap-south-1 | me-east-1 | cn-chengdu | cn-wulanchabu | cn-guangzhou
cpunumberNoThe function's CPU specification, in vCPU, must be a multiple of 0.05 vCPU. It must be specified together with diskSize. If only memorySize is specified, cpu and diskSize can be omitted. The ratio of the memory specification (in GB) to the CPU specification must be between 1 and 4. For example, if the memory is 1024MB, the CPU must be between 0.25 and 1. Defaults to 1.
memorySizenumberNoThe function's memory specification, in MB. The minimum is 128 and the maximum is 30720. Available memory specifications are: 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768. Defaults to 2048. The ratio of the memory specification (in GB) to the CPU specification must be between 1 and 4. For example, if the memory is 1024MB, the CPU must be between 0.25 and 1.
customRuntimeConfigobjectYesCustom runtime configuration, defining the startup command, arguments, and listening port of the HTTP Server to be started
customRuntimeConfig.commandarrayYesThe startup command for the custom runtime. The command runs as root, in the /code directory; for example, python3
customRuntimeConfig.argsarrayNoArguments for the custom runtime startup command, for example, app.py
customRuntimeConfig.portnumberNoThe listening port of the HTTP Server started by the custom runtime. Defaults to 9000
descriptionstringNoA description of the function, which can describe its functionality.
diskSizenumberYesDisk size, in MB. Possible values: 512 | 10240
instanceConcurrencynumberYesConcurrent requests per instance. Specifies the maximum number of requests that a single instance can handle simultaneously. Applies only to custom runtimes and custom container image runtimes. Range: [1, 200]
environmentVariablesobjectNoRuntime environment variable configuration
internetAccessbooleanNoWhether function instances can access the internet
logConfiganyNoLog delivery configuration. If set to auto, an SLS log store is created automatically and logs are delivered to it. If set to another value, project and logstore must be configured.
vpcConfiganyNoThe function's VPC network configuration. If set to auto, a VPC, VSwitch, and security group configuration are created automatically. If set to another value, vpcId, vSwitchIds, and securityGroupId must be configured. Function instances run in the configured VPC network.
rolestringNoThe role configuration for the function runtime. A RAM role that grants the permissions required by Function Compute. Use cases include: 1. Sending logs generated by the function to your log store. 2. Generating temporary access tokens for the function to access other cloud resources during execution. This can generally be set to aliyunfcdefaultrole. The role ARN is acs:ram::****:role/aliyunfcdefaultrole; you only need to enter aliyunfcdefaultrole.
runtimeenumNoThe function's runtime environment. For custom runtimes, debian10, debian11, and debian12 are currently supportedcustom.debian10 | custom.debian11 | custom.debian12
timeoutnumberNoFunction execution timeout, in seconds. The minimum is 1 second and the default is 3 seconds. Function execution is terminated if it exceeds this time.
layersarrayNoFunction Compute layer configuration. A default public layer is currently added automatically for custom.debian10, custom.debian11, and custom.debian12
tagsarrayNoConfiguration of function tag keys and values

Details

From the project README

English | 中文

Alibaba Cloud FC MCP Server

This project is the MCP Server for Alibaba Cloud Function Compute (FC) service, based on Serverless Devs and OpenAPI.

Usage Scenarios

Integrate Alibaba Cloud Function Compute capabilities into agent applications that support MCP Client (such as Cursor, Claude, Cline).

Prerequisites

  1. Install Node.js (version 18 or above is required).
  2. Prepare your Alibaba Cloud credentials (AccessKeyId and AccessKeySecret). The following permissions are recommended:
    • AdministratorAccess (recommended for full functionality), or at minimum:
    • AliyunFCFullAccess (required)
    • AliyunDevsFullAccess (recommended)
    • AliyunVPCFullAccess (recommended)
    • AliyunLogFullAccess (recommended)
    • AliyunEventBridgeFullAccess (optional)

Quick Start

Method 1: Start from npm package [Recommended for MCP Server users]

You can use the following command to start the MCP server in stdio mode:

ALIBABA_CLOUD_ACCESS_KEY_ID=${your-access-key-id} ALIBABA_CLOUD_ACCESS_KEY_SECRET=${your-access-key-secret} npx alibabacloud-fc-mcp-server
Using Cursor [Recommended]
  • Click Install MCP Server or edit the Cursor configuration file (doc), and add the following configuration:
"alibabacloud-fc-mcp-server": {
    "command": "npx",
    "args": ["-y", "alibabacloud-fc-mcp-server"],
    "env": {
        "ALIBABA_CLOUD_ACCESS_KEY_ID": "${your-access-key-id}",
        "ALIBABA_CLOUD_ACCESS_KEY_SECRET": "${your-access-key-secret}"
    }
}

cursor-config

  • Create a new empty project and open it in Cursor. Chat with Cursor in agent mode. Input the Prompts below to guide the conversation.

input-prompt

  • Ask the Cursor agent to generate a 2048 game project, then ask the agent to deploy it to Alibaba Cloud Function Compute.

chat-with-agent

  • Wait for the agent to generate the project and deploy it to Alibaba Cloud Function Compute.

get-result

Using Cline

Edit the Cline configuration file (doc), and add the following configuration:

"alibabacloud-fc-mcp-server": {
    "command": "npx",
    "args": ["-y", "alibabacloud-fc-mcp-server"],
    "env": {
        "ALIBABA_CLOUD_ACCESS_KEY_ID": "${your-access-key-id}",
        "ALIBABA_CLOUD_ACCESS_KEY_SECRET": "${your-access-key-secret}"
    }
}
Method 2: Start from source code [Recommended for MCP Server developers]
  • First, clone the project and build it:
git clone https://github.com/alibaba/alibabacloud-fc-mcp-server.git
cd alibabacloud-fc-mcp-server
npm install
npm run build
  • Then start the MCP server in stdio mode:
ALIBABA_CLOUD_ACCESS_KEY_ID=${your-access-key-id} ALIBABA_CLOUD_ACCESS_KEY_SECRET=${your-access-key-secret} node {absolute-path-to-project}/build/index.js
  • Finally, configure the MCP server in Cursor or Cline as in Method 1.

Components

Tools
  • put-custom-runtime-function: Package a project that meets Alibaba Cloud custom runtime requirements, create a function, and deploy the code to that function. If the function already exists, it will attempt to overwrite and update the target function. It is recommended to check if the function exists before using this method, and confirm updates if necessary.
  • update-custom-runtime-function: Update a custom runtime function. Only the provided parameters will be updated; others remain unchanged.
  • get-function: Retrieve detailed information about a specified function.
  • list-functions: List all functions in the specified region, returning only function names and partial information. For full details, use get-function.
  • delete-function: Delete a specified function.
  • get-custom-domain-config: Query the custom domain route configuration.
  • update-custom-domain-config: Update the custom domain route configuration.
  • create-custom-domain-config: Create a custom domain route configuration. The domain must already be CNAMEed to the public Function Compute domain (format: ${uid}.${regionId}.fc.aliyuncs.com, e.g. 14**49.cn-hangzhou.fc.aliyuncs.com), otherwise it will fail to create.
  • delete-custom-domain-config: Delete the custom domain route configuration.
  • get-custom-runtime-prompt: Get the custom runtime prompt. Will be moved to Prompts in the future.
Prompts
# Role
You are a professional Alibaba Cloud Function Compute (FC) Copilot, focused on providing customers with advice on building and deploying code to Function Compute.

## Function Compute Build Constraints

- The project must be built before it can be deployed to Function Compute. For languages like Python, dependencies should be installed in ./python at the project root; for Node, dependencies should be installed in ./node_modules at the project root; for Java, use Maven or Gradle to package the project as a Jar with dependencies. This ensures runtime dependencies can be found.
- The project build must meet the Function Compute runtime constraints.
- You do not need to package the project; after building, you can directly use the MCP Server tools for deployment.

## Function Compute Runtime Constraints

- The user must expose a port to provide an HTTP service at runtime.
- The runtime environment is debian10, with Python 3.10, Node 20, and OpenJDK JRE 21 pre-installed.
- Function Compute provides specific runtime environments for Python, Node, Java, and Golang. Python 3.10 is installed at /opt/python3.10, and /opt/python3.10/bin as well as /code/python in the code package are added to the PATH environment variable by default. Node 20 is installed at /opt/nodejs20, and /opt/nodejs20/bin as well as /code/node_modules in the code package are added to the PATH by default. OpenJDK 21 is installed at /opt/java21, and /opt/java21/bin is added to the PATH by default, with JAVA_HOME set to /opt/java21. If you modify the PATH, you should include the above contents. Golang does not require a runtime environment.

## Skills

### Skill 1: Problem Decomposition and Analysis
- Able to deeply decompose user questions, clarify the core requirements and possible steps or commands involved.
- Provide clear task breakdown steps to ensure each step leads to the final solution.
- Organize answers in tabular form whenever possible.

### Skill 2: alibabacloud-fc-mcp-server MCP Tool Usage
- Proficient in using the alibabacloud-fc-mcp-server MCP tools to obtain function information or perform related operations.
- Task decomposition must be completed before tool invocation, ensuring the logic is clear and meets customer needs.
- Select the appropriate MCP module based on the user's specific problem, such as creating or updating custom runtime functions.

## Constraints
- **Task Decomposition First**: Detailed task breakdown steps must be provided first.
- **Clear Tool Dependency**: All operations requiring MCP tool invocation should be based on clear task requirements and logical reasoning.
- **Code Generation and Build**: Code must be built locally before being deployed and run on Function Compute. Code generation and build must meet the Function Compute build and runtime constraints.

MCP MarketPlace Integration

This project is integrated into Alibaba Cloud MCP MarketPlace. You can access it via the following link:

License

This project is licensed under the MIT License. See the LICENSE file for details.

本项目基于 MIT License 开源。详情参见 LICENSE 文件。

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.