You need to enable JavaScript to run this app.
文档中心
AgentKit

AgentKit

复制全文
下载 pdf
MCP
CreateMCPService - 创建MCP服务
复制全文
下载 pdf
CreateMCPService - 创建MCP服务
创建MCP服务,操作说明和注意事项请参见MCP服务。​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:CreateMCPService​
要执行的操作,取值:CreateMCPService。​
​
Version string 必选 示例值:2025-10-30​
API的版本,取值:2025-10-30。​
​
BackendConfiguration.CustomConfiguration.Domain string 可选 示例值:www.****.com​
MCP服务的后端服务的域名。​
说明​
当BackendType取值为Domain时必填。​
​
BackendConfiguration.CustomConfiguration.Port integer 可选 示例值:80​
MCP服务对接的后端服务的端口。​
说明​
当BackendType取值为Domain时必填。​
​
BackendConfiguration.CustomConfiguration.ProtocolType string 可选 示例值:HTTP​
MCP服务对接的后端服务的协议,取值:​
  • HTTP:后端为HTTP服务。​
  • HTTPS:后端为HTTPS服务。​
说明​
当BackendType取值为Domain时必填。​
​
BackendConfiguration.FunctionConfiguration.FunctionId string 可选 示例值:u3hyod8d​
函数服务(veFaaS)ID。​
说明​
当BackendType取值为Function时必填。​
​
BackendConfiguration.CustomMcpConfiguration.FunctionId string 可选 示例值:--​
创建的veFaaS Function ID(由系统自动填充,用户无需提供)。​
​
BackendConfiguration.CustomMcpConfiguration.EnableApmplus boolean 可选 示例值:true​
是否开启日志服务。取值:​
  • true(默认):开启。​
  • false:未开启。​
​
BackendConfiguration.CustomConfiguration.TlsSettings.TlsMode string 必选 示例值:DISABLE​
选择TLS(传输层安全协议)模式。当后端服务类型为固定域名时需要配置本参数,取值:​
  • DISABLE:关闭TLS。当后端协议类型为http时,需传入DISABLE。​
  • SIMPLE:开启单向TLS。当后端协议类型为https时,需传入SIMPLE。​
​
BackendConfiguration.FunctionConfiguration.FunctionName string 可选 示例值:vefaas01​
函数服务(veFaaS)名称。​
说明​
当BackendType取值为Function时必填。​
​
BackendConfiguration.CustomMcpConfiguration.FunctionName string 可选 示例值:--​
创建的veFaaS Function名称(由系统自动填充,用户无需提供)。​
​
BackendType string 必选 示例值:Function​
MCP服务的后端服务的类型,取值:​
  • Function:veFaaS函数。​
  • Domain:固定域名。​
  • ECS:云服务器。​
  • VKE:容器服务。​
  • CustomPublic:公共包(NPX/UVX)。​
  • CustomPrivate:私有包(自定义镜像)。​
​
BackendConfiguration.CustomMcpConfiguration.PrivatePackage.Command string 可选 示例值:./run.sh​
自定义MCP服务镜像的启动命令,由用户根据镜像自定义,默认 ./run.sh。​
​
InboundAuthorizerConfiguration.Authorizer.CustomJwtAuthorizer.DiscoveryUrl string 必选 示例值:https://example.com/.well-known/openid-configuration​
使用OAuth JWT进行入站身份认证鉴权时,认证服务地址。​
说明​
当Inbound****AuthorizerType取值为CustomJWT时必填。​
​
ClientToken string 可选 示例值:333456899ff****​
保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
取值:仅支持ASCII字符,且不能超过64个字符。​
​
BackendConfiguration.CustomMcpConfiguration.PrivatePackage.Envs.N.Key string[] 可选 示例值:k1​
自定义MCP服务镜像的环境变量键。​
​
InboundAuthorizerConfiguration.Authorizer.CustomJwtAuthorizer.AllowedClients.N string[] 可选 示例值:client1​
使用OAuth JWT进行入站身份认证鉴权时,允许访问的客户端列表。​
说明​
当Inbound****AuthorizerType取值为CustomJWT时必填。​
​
InboundAuthorizerConfiguration.Authorizer.KeyAuth.ApiKeyLocation string 可选 示例值:HEADER​
使用APIKey进行入站身份认证鉴权时,APIKey的传递的位置。取值:​
  • HEADER:当前仅支持HEADER。​
说明​
当Inbound****AuthorizerType取值为ApiKey时必填。​
​
BackendConfiguration.CustomMcpConfiguration.PrivatePackage.Envs.N.Value string[] 可选 示例值:v1​
自定义MCP服务镜像的环境变量值。​
​
InboundAuthorizerConfiguration.Authorizer.KeyAuth.ApiKeys.N.Name string[] 必选 示例值:ark-authkey​
使用APIKey进行入站身份认证鉴权时,APIKey的名称。​
  • 参数 - N:表示APIKey名称的序号,取值范围:1~5。​
  • 多个字段名之间用&分隔。​
  • 长度为4-64的字符串。​
  • 由字母、数字、“-”和“_”组成。​
说明​
当Inbound****AuthorizerType取值为ApiKey时必填。​
​
BackendConfiguration.CustomMcpConfiguration.PrivatePackage.ImageUrl string 可选 示例值:http://***​
自定义MCP服务镜像的URL。​
​
InboundAuthorizerConfiguration.Authorizer.KeyAuth.ApiKeys.N.Key string[] 可选 示例值:8b02f2e2-ae83-11f0-b6e5-******&In​
使用APIKey进行入站身份认证鉴权时,APIKey的值。取值:​
  • 参数 - N:表示APIKey值的序号,取值范围:1~5。​
  • 多个字段名之间用&分隔。​
  • 不填则默认随机生成一个字符串。​
说明​
当Inbound****AuthorizerType取值为ApiKey时必填。​
​
BackendConfiguration.CustomMcpConfiguration.PublicPackage.McpType string 可选 示例值:Stdio​
自定义MCP 服务类型,取值:​
  • Stdio:标准输入输出。​
  • Remote:远程服务。​
​
InboundAuthorizerConfiguration.Authorizer.KeyAuth.Parameter string 可选 示例值:Authorization​
使用APIKey进行入站身份认证鉴权时,请求头(Header)中携带的API Key对应的参数名称。​
说明​
当Inbound****AuthorizerType取值为CustomJWT时必填。​
​
BackendConfiguration.CustomMcpConfiguration.PublicPackage.PackageManagerType string 可选 示例值:UVX​
自定义MCP服务的公共包管理器类型,取值:​
  • NPX。​
  • UVX。​
​
InboundAuthorizerConfiguration.AuthorizerType string 必选 示例值:ApiKey​
MCP服务入站身份认证安全的类型,取值:​
  • ApiKey:使用API Key认证。​
  • CustomJWT:使用OAuth JWT认证。​
​
BackendConfiguration.CustomMcpConfiguration.PublicPackage.RawConfig string 可选 示例值:--​
自定义MCP服务完整配置(JSON 字符串)。​
​
Name string 必选 示例值:MCP-001​
MCP服务名称,取值:​
  • 长度为4 ~ 64的字符串。​
  • 由字母、数字、“-”和“_”组成。​
​
OutboundAuthorizerConfiguration.Authorizer.KeyAuth.ApiKeyLocation string 可选 示例值:HEADER​
后端服务使用API Key作为出站凭据时,API Key的传递的位置。取值:​
  • HEADER:当前仅支持HEADER。​
说明​
如果Outbound****.AuthorizerType参数取值为ApiKey,则必须传入本参数。​
​
BackendConfiguration.EcsConfiguration.Instances.N.InstanceId string[] 可选 示例值:i-yeattc3lkw****​
云服务器(ECS)实例的ID。​
说明​
当BackendType取值为ECS时必填。​
​
OutboundAuthorizerConfiguration.Authorizer.KeyAuth.ApiKeys.N.Key string[] 可选 示例值:3nr5ibubffg1s931eb5k5***​
后端服务使用API Key作为出站凭据时,API Key的值。取值:​
  • 参数 - N:表示APIKey值的序号,取值范围:1~5。​
  • 多个字段名之间用&分隔。​
  • 不填则默认随机生成一个字符串。​
说明​
如果Outbound****.AuthorizerType参数取值为ApiKey,则必须传入本参数。​
​
BackendConfiguration.EcsConfiguration.Instances.N.Ip string[] 可选 示例值:172.xx.xx.109​
云服务器(ECS)实例的私网IP地址。​
说明​
当BackendType取值为ECS时必填。​
​
OutboundAuthorizerConfiguration.Authorizer.KeyAuth.Parameter string 可选 示例值:Authorization​
后端服务使用API Key作为出站凭据时,请求头(Header)中携带的API Key对应的参数名称。​
说明​
如果Outbound****.AuthorizerType参数取值为ApiKey,则必须传入本参数。​
​
BackendConfiguration.EcsConfiguration.Instances.N.Port integer[] 可选 示例值:80​
云服务器(ECS)实例的端口。​
说明​
当BackendType取值为ECS时必填。​
​
OutboundAuthorizerConfiguration.AuthorizerType string 必选 示例值:ApiKey​
后端服务的出站凭据类型,取值:​
  • ApiKey:使用API Key认证。​
  • Identity:使用身份与权限(Identity)认证。​
​
Path string 必选 示例值:/mcp​
MCP服务的访问路径。​
​
ProtocolConfiguration.HttpApiConfiguration.Configuration string 可选 示例值:ewogICJzd2FnZ2VyIjogIjIuMCIsCiAgImluZm8iOiB7CiAgICAidGl0bGUi***​
MCP服务的API信息,如:Swagger 的json,需进行Base64编码。​
说明​
仅当MCP服务的访问方式(参数ProtocolType)为“HTTP转MCP”时,需要配置本参数。​
​
OutboundAuthorizerConfiguration.Authorizer.KeyAuth.ApiKeys.N.Name string[] 必选 示例值:api01​
后端服务使用API Key作为出站凭据时,API Key的名称。取值:​
  • 长度为4 ~ 64的字符串。​
  • 由字母、数字、“-”和“_”组成。​
  • 多个字段名之间用&分隔。​
说明​
如果Outbound****.AuthorizerType参数取值为ApiKey,则必须传入本参数。​
​
BackendConfiguration.VkeConfiguration.ClusterId string 可选 示例值:cd59nk5v1a****​
容器服务(VKE)集群的ID。​
说明​
当BackendType取值为VKE时必填。​
​
ProtocolConfiguration.HttpApiConfiguration.Type string 可选 示例值:Swagger​
当后端接口为HTTP时,后端接口的展示形式,取值:Swagger。​
说明​
当ProtocolType为HTTP时,为必填。​
​
BackendConfiguration.VkeConfiguration.Namespace string 可选 示例值:namespace01​
容器服务(VKE)集群命名空间的名称。​
说明​
当BackendType取值为VKE时必填。​
​
ProtocolType string 必选 示例值:HTTP​
MCP服务访问方式,取值:​
  • HTTP:HTTP 转 MCP。​
  • MCP:直接访问 MCP。​
​
BackendConfiguration.VkeConfiguration.Port integer 可选 示例值:80​
容器服务(VKE)集群的端口。​
说明​
当BackendType取值为VKE时必填。​
​
BackendConfiguration.VkeConfiguration.ServiceName string 可选 示例值:service01​
容器服务(VKE)集群服务的名称。​
说明​
当BackendType取值为VKE时必填。​
​
NetworkConfiguration.EnablePrivateNetwork boolean 可选 示例值:true​
是否开启运行时的私网访问能力,取值:​
  • true:开启。​
  • false(默认):不开启。​
说明​
EnablePrivateNetwork和EnablePublicNetwork参数,必须传入其中一个。​
​
NetworkConfiguration.EnablePublicNetwork boolean 可选 示例值:true​
是否开启运行时的公网访问能力,取值:​
  • true(默认):开启。​
  • false:不开启。​
说明​
EnablePrivateNetwork和EnablePublicNetwork参数,必须传入其中一个。​
​
NetworkConfiguration.VpcConfiguration.VpcId string 必选 示例值:vpc-ye7s6jatq8rxg218****​
私有网络ID。​
说明​
当EnablePrivateNetwork取值为ture时必选。​
​
NetworkConfiguration.VpcConfiguration.SubnetIds.N string[] 可选 示例值:SubnetIds.1=subnet-ye7s6jatq8rxg218****​
子网ID列表,每个可用区只能指定一个子网ID。​
说明​
当EnablePrivateNetwork取值为ture时必选。​
​
ProjectName string 可选 示例值:default​
所属项目名称。​
​
OutboundAuthorizerConfiguration.Authorizer.IdentityAuthorizer.CredentialProviderName string 可选 示例值:Oauth2M2m01​
后端服务使用身份与权限(Identity)作为出站凭据时,凭证管理的名称。​
说明​
如果Outbound****.AuthorizerType参数取值为Identity,则必须传入本参数。​
​
Tags.N.Key string[] 必选 示例值:k1​
为资源添加的用户标签的标签键。​
  • 参数 - N:表示标签键的序号,取值范围:1~50。​
  • 多个标签键之间用&分隔。​
命名规则如下:​
  • 不能以任何大小写形式的volc:或sys:开头。​
volc:或sys:开头为系统预留标签键禁止创建。​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 长度限制在1~128个字符之间。​
​
OutboundAuthorizerConfiguration.Authorizer.IdentityAuthorizer.ProviderType string 可选 示例值:Oauth2M2m​
后端服务使用身份与权限(Identity)作为出站凭据时,凭证管理的类型。取值:​
  • ApiKey:使用API Key凭据。​
  • Oauth2M2m:使用OAuth Client凭据。​
说明​
如果Outbound****.AuthorizerType参数取值为Identity,则必须传入本参数。​
​
Tags.N.Value string[] 可选 示例值:v1​
为资源添加的用户标签的标签值。​
  • 参数 - N:表示标签值的序号,取值范围:1~50。​
  • 多个标签值之间用&分隔。​
命名规则如下:​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 允许为空,长度限制在0~256个字符之间。​
​
RoleName string 可选 示例值:TestRoleForAgentKit​
MCP服务绑定的IAM角色名称。​
​
Tags.N.Type string[] 可选 示例值:system​
标签类型。​
  • system:系统标签。​
  • custom:用户标签。​
​
GatewayInstanceId string 可选 示例值:gw-********​
MCP服务关联的专属网关实例ID。​
  • 仅当GatewayMode取值为Exclusive时,需传入此参数。​
  • 您可在AgentKit控制台“网关 > 网关实例 > 专属网关”中获取专属网关实例ID。​
​
BackendAccessType string 可选 示例值:Public | Private​
专属网关访问后端服务的网络类型。Exclusive模式使用Domain后端时传入此参数。​
  • Public:公网访问。​
  • Private:私网访问。​
​
GatewayMode string 可选 示例值:Shared | Exclusive​
MCP服务的网关模式。​
  • Shared(默认):共享网关。​
  • Exclusive:专属网关。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
MCPServiceId string 示例值:m-ye7s6jatq8rxg218****​
MCP服务ID。​
​
​
​
请求示例​
​
POST https://agentkit.cn-beijing.volcengineapi.com?Action=CreateMCPService&Version=2025-10-30 HTTP/1.1​
Content-Type: application/json​
{​
"Name": "mcp-***",​
"Path": "/mcp",​
"ProtocolType": "MCP",​
"NetworkConfigurations": [​
{​
"NetworkType": "Public"​
}​
],​
"BackendType": "Function",​
"BackendConfiguration": {​
"FunctionConfiguration": {​
"FunctionId": "26fqb4gn"​
}​
},​
"InboundAuthorizerConfiguration": {​
"AuthorizerType": "ApiKey",​
"Authorizer": {​
"KeyAuth": {​
"ApiKeys": [​
{​
"Name": "***"​
}​
],​
"ApiKeyLocation": "HEADER"​
}​
}​
},​
"OutboundAuthorizerConfiguration": {​
"AuthorizerType": "ApiKey",​
"Authorizer": {​
"KeyAuth": {​
"ApiKeys": [​
{​
"Name": "***",​
"Key": "usix-sixa-xxxx-***"​
}​
],​
"ApiKeyLocation": "HEADER"​
}​
}​
}​
}​
​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "202106111445100102252431000052****",​
"Action": "CreateMCPService",​
"Version": "2025-10-30",​
"Service": "agentkit",​
"Region": "cn-beijing"​
},​
"Result": {​
"MCPServiceId": " m-ye7s6jatq8rxg218****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidApiKeyLocation.Malformed​
The specified ApiKeyLocation is malformed.​
指定的ApiKeyLocation不合法。​
400​
InvalidArgument​
The specified argument is invalid.​
指定参数不合法。​
400​
InvalidAuthorizerType.Malformed​
The specified AuthorizerType is malformed.​
指定的AuthorizerType不合法。​
400​
InvalidBackendType.Malformed​
The specified BackendType is malformed.​
指定的BackendType不合法。​
400​
InvalidFunction.NotFound​
The specified FunctionId does not exist.​
指定函数不存在。​
400​
InvalidMcpType.Malformed​
The specified McpType is malformed.​
指定的McpType不合法。​
400​
InvalidName.Malformed​
The specified Name is malformed.​
指定的Name不合法。​
400​
InvalidNetworkType.Malformed​
The specified NetworkType is malformed.​
指定的NetworkType不合法。​
400​
InvalidPackageManagerType.Malformed​
The specified PackageManagerType is malformed.​
指定的PackageManagerType不合法。​
400​
InvalidProtocolType.Malformed​
The specified ProtocolType is malformed.​
指定的ProtocolType不合法。​
400​
InvalidTlsMode.Malformed​
The specified TlsMode is malformed.​
指定的TlsMode不合法。​
400​
InvalidType.Malformed​
The specified Type is malformed.​
指定的Type不合法。​
400​
LimitExceeded.MaximumApiKeys​
The number of specified ApiKeys exceeds the maximum limit.​
指定的ApiKeys超过最大限制。​
400​
LimitExceeded.MaximumPort​
The number of specified Port exceeds the maximum limit.​
指定的Port超过最大限制。​
400​
LimitExceeded.MaximumSubnetIds​
The number of specified SubnetIds exceeds the maximum limit.​
指定的SubnetIds超过最大限制。​
400​
LimitExceeded.MinimumApiKeys​
The number of specified ApiKeys exceeds the minimum limit.​
指定的ApiKeys超过最小限制。​
400​
LimitExceeded.MinimumPort​
The number of specified Port exceeds the minimum limit.​
指定的Port超过最小限制。​
400​
LimitExceeded.MinimumSubnetIds​
The number of specified SubnetIds exceeds the minimum limit.​
指定的SubnetIds超过最小限制。​
400​
MissingParameter.ApiKeyLocation​
The required parameter ApiKeyLocation is not supplied.​
参数ApiKeyLocation不能为空。​
400​
MissingParameter.ApiKeys​
The required parameter ApiKeys is not supplied.​
参数ApiKeys不能为空。​
400​
MissingParameter.AuthorizerType​
The required parameter AuthorizerType is not supplied.​
参数AuthorizerType不能为空。​
400​
MissingParameter.BackendConfiguration​
The required parameter BackendConfiguration is not supplied.​
参数BackendConfiguration不能为空。​
400​
MissingParameter.BackendType​
The required parameter BackendType is not supplied.​
参数BackendType不能为空。​
400​
MissingParameter.DiscoveryUrl​
The required parameter DiscoveryUrl is not supplied.​
参数DiscoveryUrl不能为空。​
400​
MissingParameter.Domain​
The required parameter Domain is not supplied.​
Domain不能为空。​
400​
MissingParameter.FunctionId​
The required parameter FunctionId is not supplied.​
参数FunctionId不能为空。​
400​
MissingParameter.InboundAuthorizerConfiguration​
The required parameter InboundAuthorizerConfiguration is not supplied.​
参数InboundAuthorizerConfiguration不能为空。​
400​
MissingParameter.Key​
The required parameter Key is not supplied.​
参数Key不能为空。​
400​
MissingParameter.Name​
The required parameter Name is not supplied.​
名称不能为空。​
400​
MissingParameter.NetworkConfiguration​
The required parameter NetworkConfiguration is not supplied.​
参数NetworkConfiguration不能为空。​
400​
MissingParameter.NetworkConfigurations​
The required parameter NetworkConfigurations is not supplied.​
参数NetworkConfigurations不能为空。​
400​
MissingParameter.NetworkType​
The required parameter NetworkType is not supplied.​
参数NetworkType不能为空。​
400​
MissingParameter.OutboundAuthorizerConfiguration​
The required parameter OutboundAuthorizerConfiguration is not supplied.​
参数OutboundAuthorizerConfiguration不能为空。​
400​
MissingParameter.Parameter​
The required parameter Parameter is not supplied.​
参数Parameter不能为空。​
400​
MissingParameter.Path​
The required parameter Path is not supplied.​
参数Path不能为空。​
400​
MissingParameter.ProtocolType​
The required parameter ProtocolType is not supplied.​
参数ProtocolType不能为空。​
400​
MissingParameter.TlsMode​
The required parameter TlsMode is not supplied.​
参数TlsMode不能为空。​
400​
MissingParameter.VpcId​
The required parameter VpcId is not supplied.​
参数VpcId不能为空。​
​
​
最近更新时间:2026.09.18 14:21:15
这个页面对您有帮助吗?
有用
有用
无用
无用