English | 中文
阿里云FC MCP服务器
本项目是阿里云功能计算(FC)服务的MCP服务器,基于 无服务器开发人员 和 OpenAPI.
使用场景
将阿里云功能计算功能集成到支持MCP客户端的代理应用程序中(如Cursor、Claude、Cline)。
先决条件
- 安装 (需要版本18或更高版本)。
- 准备您的阿里云凭据(
AccessKeyId和AccessKeySecret).建议使用以下权限:
- AdministratorAccess (建议使用完整功能),或至少: - AliyunFCFullAccess (必填) - AliyunDevsFullAccess (推荐) - AliyunVPCFullAccess (推荐) - AliyunLogFullAccess (推荐) - AliyunEventBridgeFullAccess (可选)
快速开始
方法1:从npm包开始\[建议MCP Server用户使用\]
您可以使用以下命令在中启动MCP服务器 stdio 模式:
ALIBABA_CLOUD_ACCESS_KEY_ID=${your-access-key-id} ALIBABA_CLOUD_ACCESS_KEY_SECRET=${your-access-key-secret} npx alibabacloud-fc-mcp-server使用 光标 \[推荐\]
- 点击 
或编辑游标配置文件(文档),并添加以下配置:
"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中打开它。在代理模式下与Cursor聊天。输入
Prompts下面来引导对话。
- 让Cursor代理生成一个2048游戏项目,然后让代理将其部署到阿里云Function Compute。
- 等待代理生成项目并将其部署到阿里云功能计算。
使用 克莱恩
编辑Cline配置文件(文档),并添加以下配置:
"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}"
}
}方法2:从源代码开始\[建议MCP Server开发人员使用\]
- 首先,克隆项目并构建它:
git clone https://github.com/alibaba/alibabacloud-fc-mcp-server.git
cd alibabacloud-fc-mcp-server
npm install
npm run build- 然后在中启动MCP服务器
stdio模式:
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- 最后,按照方法1在Cursor或Cline中配置MCP服务器。
组件
工具
put-custom-runtime-function:打包一个符合阿里云自定义运行时要求的项目,创建一个函数,并将代码部署到该函数。如果该函数已存在,它将尝试覆盖和更新目标函数。建议在使用此方法之前检查该功能是否存在,并在必要时确认更新。update-custom-runtime-function:更新自定义运行时函数。仅更新提供的参数;其他则保持不变。get-function:检索有关指定函数的详细信息。list-functions:列出指定区域中的所有函数,仅返回函数名称和部分信息。有关完整详细信息,请使用get-function.delete-function:删除指定的函数。get-custom-domain-config:查询自定义域路由配置。update-custom-domain-config:更新自定义域路由配置。create-custom-domain-config:创建自定义域路由配置。该域必须已被CNAMEed到公共函数计算域(格式:${uid}.${regionId}.fc.aliyuncs.com,例如14\*\*49.cn hangzhou.fc.aliyuncs.com),否则将无法创建。delete-custom-domain-config:删除自定义域路由配置。get-custom-runtime-prompt:获取自定义运行时提示。未来将转移到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市场整合
该项目已整合至阿里云MCP MarketPlace。您可以通过以下链接访问它:
许可证
该项目根据MIT许可证获得许可。请参阅 许可证 文件以获取详细信息。
本项目基于 MIT License 开源。详情参见 许可证 文件。
