tencent cloud

APIs

CreateMCPToken

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-11-24 20:47:17

1. API Description

Domain name for API request: car.intl.tencentcloudapi.com.

This API is used to create an MCP token (issue a token).

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateMCPToken.
Version Yes String Common Params. The value used for this API: 2022-01-10.
Region No String Common Params. This parameter is not required for this API.
ExpireSeconds Yes Integer

Token expiration time

Value range: [0, 2592000]

Unit: seconds

Default value: 86400

If this parameter is not specified, the default timeout is 1 day. The expiration time is the current time + the timeout period.

TokenName No String

Token name (comment)

Format: Only a combination of Chinese characters, English letters, digits, and hyphens ("-") is supported.

Maximum length: 16 characters

UserId No String

User Id

Format: Only a combination of letters (A-Za-z), digits (0-9), and underscores (_) is supported.

This UserId is always used to operate cloud rendering concurrent resources. Maximum length: 64 characters

3. Output Parameters

Parameter Name Type Description
TokenId String

TokenId

Token String

MCP Token

Keep the current value safe. It is required for subsequent communication with the MCP Server. Once lost, it cannot be viewed again.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating an MCP Token

This example shows you how to get an MCP Token.

Input Example

POST / HTTP/1.1
Host: car.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateMCPToken
<Common request parameters>

{
    "ExpireSeconds": 50000,
    "TokenName": "token*****id01",
    "UserId": "v**to***_token_userid01"
}

Output Example

{
    "Response": {
        "Token": "mcptok_1e993fa723ed62f56************************a435a95e361f11fdf49ce3c",
        "TokenId": "tok_59f*******76ee22",
        "RequestId": "4f151245-7a15-4ccf-9139-191add823c61"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure.UnauthorizedOperation Request unauthorized.
FailedOperation Operation failed.
InvalidParameter Parameter error.
InvalidParameter.JsonParseError JSON parsing error.
InvalidParameterValue Invalid parameter value.
LimitExceeded.MCPToken The number of MCP Tokens exceeds the quota limit.
OperationDenied Operation denied.
ResourceInUse The resource is occupied.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan