Skip to main content
Glama

Alibaba Cloud FC MCP Server

Official
by aliyun

put-custom-runtime-function

Deploy a custom runtime project to Alibaba Cloud Function Compute without manual packaging. Automatically handles code deployment and updates existing functions. Specify region, function name, and runtime configuration for seamless integration.

Instructions

将构建完成的匹配阿里云自定义运行时的工程,部署到函数计算。代码工程不需要手动打包,会自动处理。如果函数已存在,则尝试覆盖并更新目标函数。建议使用该方法前先确认函数是否存在

Input Schema

NameRequiredDescriptionDefault
cpuNo函数的 CPU 规格,单位为 vCPU,为 0.05 vCPU 的倍数。 和 diskSize 必须同时存在, 如果仅仅填写 memorySize, cpu 和 diskSize 可以不填。内存规格(以GB计算)与CPU规格的比例必须在1到4之间,例如内存为1024MB,则CPU必须为0.25到1之间,默认为1
customRuntimeConfigYes自定义运行时配置,定义启动命令、参数以及启动的HTTP Server的监听端口
descriptionNo函数的描述,可以描述一下函数的功能。
diskSizeYes磁盘大小,单位是MB,可选值: 512 | 10240
environmentVariablesNo运行时的环境变量配置
functionNameYes函数名称,函数名称在每个region必须是唯一的。
instanceConcurrencyYes单实例多并发数。规定了单个实例可以同时同时被多个请求命中的上限,只对自定义运行时与自定义容器镜像运行时生效。范围为[1, 200]
internetAccessNo是否支持从函数实例内访问互联网
layersNo函数计算的层配置,当前会自动为custom.debian10,custom.debian11,custom.debian12添加默认的公共层
locationYes本地代码工程的根路径,例如/Users/xxx/my-project,不需要打包为zip
logConfigNo日志投递配置。如果配置为auto,则会自动创建SLS日志库并投递日志。如果配置为其他值,则需要配置project和logstore。
memorySizeNo函数的内存规格,单位为 MB,最小值为128,最大值为 30720。可以选择的内存规格为:128,256,512,1024,2048,4096,8192,16384,32768。默认为2048。内存规格(以GB计算)与CPU规格的比例必须在1到4之间,例如内存为1024MB,则CPU必须为0.25到1之间
regionNo部署的区域,当前可选的区域是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,默认是cn-hangzhoucn-hangzhou
roleNo函数运行时的角色配置。授予函数计算所需权限的 RAM 角色,使用场景包含:1. 把函数产生的日志发送到您的日志库中。2. 为函数在执行过程中访问其他云资源生成的临时访问令牌。一般可以设置为aliyunfcdefaultrole。角色ARN为acs:ram::****:role/aliyunfcdefaultrole,只需要输入aliyunfcdefaultrole即可
runtimeNo函数的运行时环境,对于自定义运行时,当前支持debian10,debian11,debian12custom.debian10
tagsNo函数标签的key与value配置
timeoutNo函数执行的超时时间,单位为秒,最小 1 秒,默认 3 秒。函数执行超过这个时间后会被终止执行。
vpcConfigNo函数的VPC网络配置。如果配置为auto,则会自动创建VPC、VSwitch与安全组配置。如果配置为其他值,则需要配置vpcId、vSwitchIds与securityGroupId。函数实例会运行在配置的VPC网络中。

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "cpu": { "default": 1, "description": "函数的 CPU 规格,单位为 vCPU,为 0.05 vCPU 的倍数。 和 diskSize 必须同时存在, 如果仅仅填写 memorySize, cpu 和 diskSize 可以不填。内存规格(以GB计算)与CPU规格的比例必须在1到4之间,例如内存为1024MB,则CPU必须为0.25到1之间,默认为1", "type": "number" }, "customRuntimeConfig": { "additionalProperties": false, "description": "自定义运行时配置,定义启动命令、参数以及启动的HTTP Server的监听端口", "properties": { "args": { "description": "自定义运行时启动命令参数,例如app.py", "items": { "type": "string" }, "minItems": 1, "type": "array" }, "command": { "description": "自定义运行时启动命令,命令执行的用户是root,执行的目录是/code,例如python3", "items": { "type": "string" }, "minItems": 1, "type": "array" }, "port": { "default": 9000, "description": "自定义运行时中启动的HTTP Server的监听端口,默认为9000", "type": "number" } }, "required": [ "command" ], "type": "object" }, "description": { "description": "函数的描述,可以描述一下函数的功能。", "type": "string" }, "diskSize": { "description": "磁盘大小,单位是MB,可选值: 512 | 10240", "type": "number" }, "environmentVariables": { "additionalProperties": { "description": "环境变量值", "type": "string" }, "default": {}, "description": "运行时的环境变量配置", "type": "object" }, "functionName": { "description": "函数名称,函数名称在每个region必须是唯一的。", "pattern": "^[a-zA-Z0-9_][a-zA-Z0-9_-]{0,63}$", "type": "string" }, "instanceConcurrency": { "description": "单实例多并发数。规定了单个实例可以同时同时被多个请求命中的上限,只对自定义运行时与自定义容器镜像运行时生效。范围为[1, 200]", "type": "number" }, "internetAccess": { "default": true, "description": "是否支持从函数实例内访问互联网", "type": "boolean" }, "layers": { "default": [], "description": "函数计算的层配置,当前会自动为custom.debian10,custom.debian11,custom.debian12添加默认的公共层", "items": { "type": "string" }, "type": "array" }, "location": { "description": "本地代码工程的根路径,例如/Users/xxx/my-project,不需要打包为zip", "type": "string" }, "logConfig": { "anyOf": [ { "additionalProperties": false, "properties": { "enableInstanceMetrics": { "default": true, "description": "是否开启实例级指标投递,开启后,函数计算会自动将实例级指标投递到SLS日志库。", "type": "boolean" }, "enableRequestMetrics": { "default": true, "description": "是否开启请求级指标投递,开启后,函数计算会自动将请求级指标投递到SLS日志库。", "type": "boolean" }, "logBeginRule": { "default": "DefaultRegex", "description": "日志投递到SLS日志库时的切分规则,可选值为DefaultRegex,表示使用默认的切分规则。启用后,函数计算将按日志分割规则进行切分,切分成多个日志段,并逐条写入日志服务。默认的日志分割规则为 ^.{0,2}d{4}-d{2}-d{2},即匹配符合xxxx-xx-xx格式的日期,其中x代表数字。该规则将按照行首是否带有日期进行切分,例如您的日志行首是2023-10-10,则该日志将被认为是一块日志的首行,首行和接下来连续不带日期的日志将被作为一条日志写入到日志服务。不启用日志分割规则是,默认使用换行符\\n进行切分。", "enum": [ "DefaultRegex", "None" ], "type": "string" }, "logstore": { "description": "日志投递的SLS日志库名称", "type": "string" }, "project": { "description": "日志投递的SLS日志项目名称", "type": "string" } }, "required": [ "project", "logstore" ], "type": "object" }, { "enum": [ "auto" ], "type": "string" } ], "description": "日志投递配置。如果配置为auto,则会自动创建SLS日志库并投递日志。如果配置为其他值,则需要配置project和logstore。" }, "memorySize": { "default": 2048, "description": "函数的内存规格,单位为 MB,最小值为128,最大值为 30720。可以选择的内存规格为:128,256,512,1024,2048,4096,8192,16384,32768。默认为2048。内存规格(以GB计算)与CPU规格的比例必须在1到4之间,例如内存为1024MB,则CPU必须为0.25到1之间", "type": "number" }, "region": { "default": "cn-hangzhou", "description": "部署的区域,当前可选的区域是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,默认是cn-hangzhou", "enum": [ "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" ], "type": "string" }, "role": { "description": "函数运行时的角色配置。授予函数计算所需权限的 RAM 角色,使用场景包含:1. 把函数产生的日志发送到您的日志库中。2. 为函数在执行过程中访问其他云资源生成的临时访问令牌。一般可以设置为aliyunfcdefaultrole。角色ARN为acs:ram::****:role/aliyunfcdefaultrole,只需要输入aliyunfcdefaultrole即可", "type": "string" }, "runtime": { "default": "custom.debian10", "description": "函数的运行时环境,对于自定义运行时,当前支持debian10,debian11,debian12", "enum": [ "custom.debian10", "custom.debian11", "custom.debian12" ], "type": "string" }, "tags": { "default": [], "description": "函数标签的key与value配置", "items": { "additionalProperties": false, "properties": { "key": { "description": "标签名称", "type": "string" }, "value": { "description": "标签值", "type": "string" } }, "required": [ "key", "value" ], "type": "object" }, "type": "array" }, "timeout": { "default": 3, "description": "函数执行的超时时间,单位为秒,最小 1 秒,默认 3 秒。函数执行超过这个时间后会被终止执行。", "type": "number" }, "vpcConfig": { "anyOf": [ { "additionalProperties": false, "properties": { "securityGroupId": { "description": "安全组ID", "type": "string" }, "vSwitchIds": { "description": "VSwitch的ID", "type": "string" }, "vpcId": { "description": "VPC的ID", "type": "string" } }, "required": [ "vpcId", "vSwitchIds", "securityGroupId" ], "type": "object" }, { "enum": [ "auto" ], "type": "string" } ], "description": "函数的VPC网络配置。如果配置为auto,则会自动创建VPC、VSwitch与安全组配置。如果配置为其他值,则需要配置vpcId、vSwitchIds与securityGroupId。函数实例会运行在配置的VPC网络中。" } }, "required": [ "location", "functionName", "customRuntimeConfig", "diskSize", "instanceConcurrency" ], "type": "object" }
Install Server

Other Tools from Alibaba Cloud FC MCP Server

Related Tools

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aliyun/alibabacloud-fc-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server