AnthropicClaude 托管智能体

校验凭据 MCP OAuth

校验保险库中一条 MCP OAuth 凭据是否仍然有效。

POST /anthropic/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate◐ 部分支持

请求参数

  • vault_idstring必填

    path: 保险库 ID(路径或查询参数)。

  • credential_idstring必填

    path: 路径参数:凭据 ID。

  • vault_idstring必填

    query: 保险库 ID(路径或查询参数)。

返回

400

只适用于 OAuth 凭据,对其他类型返回 400。结果总是 HTTP 200,status 为 valid、invalid 或 unknown;mcp_probe 只在未通过时给出失败的一步,refresh 只在尝试了续期时给出。

错误按 Claude Managed Agents 格式返回,参见 错误码

响应

HTTP 200

Successful response

application/json

名称类型说明
credential_idstringUnique identifier of the credential that was validated.
has_refresh_tokenbooleanWhether the credential has a refresh token configured.
mcp_probenull | objectThe failing step of an MCP validation probe.
mcp_probe.http_responsenull | objectAn HTTP response captured during a credential validation probe.
mcp_probe.methodstringThe MCP method that failed (for example `initialize` or `tools/list`).
refreshnull | objectOutcome of a refresh-token exchange attempted during credential validation.
refresh.http_responsenull | objectAn HTTP response captured during a credential validation probe.
refresh.statusstringOutcome of a refresh-token exchange attempted during credential validation. - `succeeded` - The token endpoint returned a new access token. - `failed` - The token endpoint returned an error response. See `http_response` for detail. - `connect_error` - The token endpoint could not be reached (DNS, TLS, or connection error). - `no_refresh_token` - No refresh token is stored for the credential, so no exchange was attempted.
statusstringOverall verdict of a credential validation probe.
typestring
validated_atstringA timestamp in RFC 3339 format
vault_idstringIdentifier of the vault containing the credential.

示例前提

此示例针对前面创建的 static 凭据,因此实测返回 400 invalid_request_error。要获得校验结果,请先通过一键授权完成用户授权,再将 credential_id 换成产生的 OAuth Secret ID。校验 OAuth 凭据返回 HTTP 200,状态为 valid、invalid 或 unknown。