> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apigene.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Mcp Server Logout

> Clear the current user's MCP OAuth token for a native MCP server.

Deletes only this user's stored token (Mongo + Redis) and drops cached
MCP clients so Copilot and the MCP gateway both re-authorize on next use.
Idempotent: succeeds when no token is stored.



## OpenAPI

````yaml post /api/mcp-server/logout/{server_id}
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/mcp-server/logout/{server_id}:
    post:
      tags:
        - MCP Server
      summary: Mcp Server Logout
      description: >-
        Clear the current user's MCP OAuth token for a native MCP server.


        Deletes only this user's stored token (Mongo + Redis) and drops cached

        MCP clients so Copilot and the MCP gateway both re-authorize on next
        use.

        Idempotent: succeeds when no token is stored.
      operationId: mcp_server_logout
      parameters:
        - name: server_id
          in: path
          required: true
          schema:
            type: string
            title: Server Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````