Intercambiar un código de un solo uso por acceso MCP
POST /oauth/token
Solicitud de formulario de cliente público con verificador S256 y redirección/recurso exactos. Devuelve un token qm. exclusivo de MCP, nunca una credencial API del espacio de trabajo. Caduca dentro de una hora o de la vida restante de la sesión, lo que ocurra antes. Sin token de actualización. Repetir un código revoca su concesión.
Autenticación
Esta operación no requiere una sesión autenticada. Las comprobaciones de Origin y los límites de solicitudes siguen aplicándose.
[]
Parámetros
[]
Cuerpo de la solicitud
{
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"client_id": {
"type": "string"
},
"grant_type": {
"const": "authorization_code"
},
"code": {
"type": "string"
},
"code_verifier": {
"type": "string",
"minLength": 43,
"maxLength": 128
},
"redirect_uri": {
"type": "string"
},
"resource": {
"const": "https://qscan.dev/mcp"
}
},
"required": [
"client_id",
"grant_type",
"code",
"code_verifier",
"redirect_uri",
"resource"
]
}
}
}
}
Respuestas
{
"200": {
"description": "MCP-only bearer",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"token_type": {
"const": "Bearer"
},
"expires_in": {
"type": "integer"
},
"scope": {
"const": "mcp:tools"
}
},
"required": [
"access_token",
"token_type",
"expires_in",
"scope"
]
}
}
}
},
"400": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"401": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"403": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"413": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"415": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"429": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"503": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
}
}
Las referencias como #/components/schemas/Asset se resuelven en los esquemas compartidos. Descarga el contrato OpenAPI para generar clientes. Esta página se genera automáticamente; describe la API de desarrollo implementada, no endpoints previstos.