> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-chore-regenerate-agent-sdk-openapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit an MCP OAuth callback URL



## OpenAPI

````yaml /openapi/agent-sdk.json post /api/mcp/oauth/callback/{job_id}
openapi: 3.1.0
info:
  description: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
  title: OpenHands Agent Server
  version: 1.52.0
servers: []
security: []
paths:
  /api/mcp/oauth/callback/{job_id}:
    post:
      tags:
        - MCP
      summary: Submit an MCP OAuth callback URL
      operationId: submit_mcp_oauth_callback_api_mcp_oauth_callback__job_id__post
      parameters:
        - in: path
          name: job_id
          required: true
          schema:
            title: Job Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPOAuthCallbackRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPOAuthStatusResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    MCPOAuthCallbackRequest:
      description: Callback URL copied from a browser OAuth redirect.
      properties:
        callback_url:
          minLength: 1
          title: Callback Url
          type: string
      required:
        - callback_url
      title: MCPOAuthCallbackRequest
      type: object
    MCPOAuthStatusResponse:
      description: Current state of an install-time OAuth MCP probe.
      properties:
        authorization_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Authorization Url
        callback_ready:
          default: false
          title: Callback Ready
          type: boolean
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_kind:
          anyOf:
            - enum:
                - timeout
                - connection
                - unknown
              type: string
            - type: 'null'
          title: Error Kind
        job_id:
          title: Job Id
          type: string
        oauth_state:
          anyOf:
            - $ref: '#/components/schemas/MCPOAuthStateResponse'
            - type: 'null'
        ok:
          title: Ok
          type: boolean
        status:
          enum:
            - pending
            - authorizing
            - succeeded
            - failed
          title: Status
          type: string
        tool_result:
          anyOf:
            - $ref: '#/components/schemas/MCPToolCallResult'
            - type: 'null'
        tools:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tools
      required:
        - ok
        - status
        - job_id
      title: MCPOAuthStatusResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    MCPOAuthStateResponse:
      properties:
        client_info:
          anyOf:
            - additionalProperties: true
              properties:
                client_secret:
                  anyOf:
                    - type: string
                    - type: 'null'
                  title: Client Secret
              title: MCPOAuthClientInfoState
              type: object
            - type: 'null'
          title: Client Info
        token_expires_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Token Expires At
        tokens:
          anyOf:
            - additionalProperties: true
              properties:
                access_token:
                  anyOf:
                    - type: string
                    - type: 'null'
                  title: Access Token
                refresh_token:
                  anyOf:
                    - type: string
                    - type: 'null'
                  title: Refresh Token
              title: MCPOAuthTokenState
              type: object
            - type: 'null'
          title: Tokens
      title: MCPOAuthStateResponse
      type: object
    MCPToolCallResult:
      description: |-
        Verbatim outcome of the requested ``tool_call``.

        The endpoint stays provider-neutral: many servers report upstream
        failures (e.g. Slack's ``{"ok": false, "error": "invalid_auth"}``)
        as ordinary text content with ``isError`` unset, so interpreting the
        payload is the caller's job.
      properties:
        is_error:
          description: The MCP-level isError flag of the result.
          title: Is Error
          type: boolean
        text:
          description: Concatenated text content of the result.
          title: Text
          type: string
      required:
        - is_error
        - text
      title: MCPToolCallResult
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-Session-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.