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

# Authenticate MCP OAuth

> Start OAuth flow and wait for callback (opens browser)



## OpenAPI

````yaml /openapi.json post /mcp/{name}/auth/authenticate
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /mcp/{name}/auth/authenticate:
    post:
      summary: Authenticate MCP OAuth
      description: Start OAuth flow and wait for callback (opens browser)
      operationId: mcp.auth.authenticate
      parameters:
        - in: query
          name: directory
          schema:
            type: string
        - in: query
          name: workspace
          schema:
            type: string
        - schema:
            type: string
          in: path
          name: name
          required: true
      responses:
        '200':
          description: OAuth authentication completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPStatus'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      x-codeSamples:
        - lang: js
          source: |-
            import { createCognitioClient } from "@cognitio/sdk

            const client = createCognitioClient()
            await client.mcp.auth.authenticate({
              ...
            })
components:
  schemas:
    MCPStatus:
      anyOf:
        - $ref: '#/components/schemas/MCPStatusConnected'
        - $ref: '#/components/schemas/MCPStatusDisabled'
        - $ref: '#/components/schemas/MCPStatusFailed'
        - $ref: '#/components/schemas/MCPStatusNeedsAuth'
        - $ref: '#/components/schemas/MCPStatusNeedsClientRegistration'
    BadRequestError:
      type: object
      properties:
        data: {}
        errors:
          type: array
          items:
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
        success:
          type: boolean
          const: false
      required:
        - data
        - errors
        - success
    NotFoundError:
      type: object
      properties:
        name:
          type: string
          const: NotFoundError
        data:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - name
        - data
    MCPStatusConnected:
      type: object
      properties:
        status:
          type: string
          const: connected
      required:
        - status
    MCPStatusDisabled:
      type: object
      properties:
        status:
          type: string
          const: disabled
      required:
        - status
    MCPStatusFailed:
      type: object
      properties:
        status:
          type: string
          const: failed
        error:
          type: string
      required:
        - status
        - error
    MCPStatusNeedsAuth:
      type: object
      properties:
        status:
          type: string
          const: needs_auth
      required:
        - status
    MCPStatusNeedsClientRegistration:
      type: object
      properties:
        status:
          type: string
          const: needs_client_registration
        error:
          type: string
      required:
        - status
        - error

````

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