Add an MCP server credential to a vault.
Request headers
|
Header |
Required |
Description |
|
|
Yes |
Bearer token for authentication. Format: |
|
|
Yes |
Must be |
Path parameters
|
Parameter |
Type |
Required |
Description |
|
|
string |
Yes |
Unique identifier of the vault to add the credential to. |
Request body
|
Field |
Type |
Required |
Description |
|
|
string |
Yes |
URL of the MCP server this credential authorizes. |
|
|
string |
Yes |
Transport protocol. One of |
|
|
string |
Yes |
Credential type. Currently only |
|
|
string |
Yes |
Access token presented to the MCP server. Required when |
Example request
curl -X POST "https://api.qoder.com.cn/api/v1/cloud/vaults/vault_019e3bb940277f0db05ab74291acf6ef/credentials" \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json" \
-d '{
"mcp_server_url": "https://example.com/mcp-stream",
"protocol": "streamable_http",
"type": "static_bearer",
"access_token": "your-access-token"
}'
Example response
HTTP 201 Created
{
"id": "vcred_019e3bb98877759e862750b495c1fce8",
"vault_id": "vault_019e3bb940277f0db05ab74291acf6ef",
"mcp_server_url": "https://example.com/mcp-stream",
"protocol": "streamable_http",
"type": "static_bearer",
"status": "active",
"created_at": "2026-05-18T15:34:35.387093Z",
"updated_at": "2026-05-18T15:34:35.387093Z"
}
Response fields
|
Field |
Type |
Description |
|
|
string |
Unique identifier of the credential, prefixed with |
|
|
string |
ID of the vault that owns the credential. |
|
|
string |
URL of the MCP server this credential authorizes. |
|
|
string |
Transport protocol. One of |
|
|
string |
Credential type. |
|
|
string |
Credential state. New credentials default to |
|
|
string |
Creation timestamp in ISO 8601 format. |
|
|
string |
Last-updated timestamp in ISO 8601 format. |
Errors
|
HTTP |
Type |
Trigger |
|
400 |
|
A required field is missing: |
|
401 |
|
Missing or invalid authentication token. |
|
404 |
|
The specified vault does not exist or was deleted. |
Notes
-
For security, the
access_tokenvalue is never returned in the response. -
A vault can hold multiple credentials.
-
Credentials become
activeimmediately after creation.
For the full error envelope, see Errors.