---
title: "使用断言获取 MCP OAuth 令牌"
method: POST
path: "/mcp-services/{id}/oauth/assertion"
tags: ["MCP服务"]
---

# 使用断言获取 MCP OAuth 令牌

`POST /mcp-services/{id}/oauth/assertion`

## Request

- Base URL: `/api/v1` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/v1/mcp-services/{id}/oauth/assertion`
- Auth: API key in header `Authorization`

以 JWT Bearer 授权（RFC 7523）提交调用方签发的断言（如 ID-JAG），为当前用户获取并保存令牌，
无需浏览器跳转。使用该服务已注册的 OAuth 客户端

## Path parameters

- `id` string, required

## Request body

- object

## Response `200`

与 oauth/status 相同

- object
  - `data` GithubComTencentWeKnoraInternalMcpOAuthAuthorizationStatus
    - `authorized` boolean
    - `expires_at` string
    - `refresh_available` boolean
    - `state` string
  - `success` boolean

## Other responses

- `400`: 断言无效或被授权服务器拒绝
- `404`: Not Found

## Changes

- **2026-10-13** `14b4b38b80b6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/tencentblueking/apis/weknora-api/changes/mcp-services/:id/oauth/assertion/post.md)

---

[API](https://skmtc.dev/tencentblueking/apis/weknora-api.md) - [All operations](https://skmtc.dev/tencentblueking/apis/weknora-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tencentblueking/apis/weknora-api/revisions/b64b227d0d54?raw)
