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

# List MCP servers

> List all MCP servers available to the caller's organization.
Returns paginated results with server details including connection status.




## OpenAPI

````yaml get /api/servers
openapi: 3.1.0
info:
  title: Barndoor Platform API
  version: 1.0.0
  description: >
    REST API for the Barndoor Platform - manage MCP servers, OAuth connections,
    and proxy MCP requests.


    ## Authentication


    All endpoints require a JWT Bearer token obtained through Barndoor's

    OAuth 2.0 authorization-code flow with PKCE. The SDK handles the OAuth

    flow automatically using interactive login.


    ## MCP Integration


    The `/mcp/{mcp_server_name}` endpoints provide streaming proxy access to
    third-party MCP servers

    (Salesforce, Notion, Slack, etc.) with automatic authentication and session
    management.
  contact:
    name: Barndoor Support
    url: https://barndoor.ai
servers:
  - url: https://{organization_id}.platform.barndoor.ai
    description: Trial (Production)
    variables:
      organization_id:
        description: Your organization identifier
        default: your-org
  - url: https://{organization_id}.platform.barndoor.ai
    description: Enterprise (Production)
    variables:
      organization_id:
        description: Your organization identifier
        default: your-org
  - url: https://{organization_id}.platform.barndooruat.com
    description: Enterprise (Production)
    variables:
      organization_id:
        description: Your organization identifier
        default: your-org
  - url: https://{organization_id}.platform.barndoordev.com
    description: Enterprise (Production)
    variables:
      organization_id:
        description: Your organization identifier
        default: your-org
security:
  - BearerAuth: []
tags:
  - name: Servers
    description: Manage MCP server instances
  - name: Connections
    description: Manage OAuth connections to MCP servers
  - name: Policies
    description: Manage access control policies for agents and servers
  - name: Agents
    description: Manage AI agent registrations
  - name: MCP Proxy
    description: Proxy requests to MCP servers
  - name: Identity
    description: Retrieve identity information for the authenticated user
paths:
  /api/servers:
    get:
      tags:
        - Servers
      summary: List MCP servers
      description: >
        List all MCP servers available to the caller's organization.

        Returns paginated results with server details including connection
        status.
      operationId: listServers
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number (1-based)
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
          description: Number of items per page (max 100)
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: Search servers by name or slug
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - pending
              - active
              - error
          description: Filter by server status
        - name: connection_status
          in: query
          required: false
          schema:
            type: string
            enum:
              - available
              - pending
              - connected
              - error
              - not_connected
          description: >-
            Filter by connection status. `not_connected` expands to pending,
            error, and available.
      responses:
        '200':
          description: Paginated list of MCP servers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginationResponse_ServerResponse_'
        '401':
          description: Unauthorized - invalid or missing JWT token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PaginationResponse_ServerResponse_:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ServerDetail'
          description: Array of servers for current page
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
          description: Pagination metadata
      required:
        - data
        - pagination
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Error type identifier
          example: ServerNotFound
        message:
          type: string
          description: Human-readable error message
          example: Server with ID '123' not found
        details:
          type: object
          description: Additional error details
          additionalProperties: true
    ServerDetail:
      allOf:
        - $ref: '#/components/schemas/ServerSummary'
        - type: object
          properties:
            url:
              type: string
              format: uri
              nullable: true
              description: MCP base URL from the server directory
              example: https://api.salesforce.com/mcp
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
          description: Current page number
        limit:
          type: integer
          title: Limit
          description: Items per page
        total:
          type: integer
          title: Total
          description: Total number of items
        pages:
          type: integer
          title: Pages
          description: Total number of pages
        previous_page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Previous Page
          description: Previous page number (null if first page)
        next_page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Page
          description: Next page number (null if last page)
      type: object
      required:
        - page
        - limit
        - total
        - pages
        - previous_page
        - next_page
      title: PaginationMeta
      description: Pagination metadata.
    ServerSummary:
      type: object
      required:
        - id
        - name
        - slug
        - connection_status
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the server
          example: 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Human-readable name of the server
          example: Salesforce Production
        slug:
          type: string
          description: URL-friendly identifier used in API paths
          pattern: ^[a-z0-9-]+$
          example: salesforce
        provider:
          type: string
          nullable: true
          description: Third-party provider name
          example: salesforce
        connection_status:
          type: string
          enum:
            - available
            - pending
            - connected
            - error
          description: |
            Current connection status:
            - `available`: Server is available but not connected
            - `pending`: Connection is in progress or credentials missing
            - `connected`: Server is connected and ready to use
            - `error`: Connection failed or encountered an error
          example: connected
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        JWT token obtained through Barndoor's OAuth 2.0 authorization-code

        flow with PKCE.


        The token should be included in the Authorization header:

        `Authorization: Bearer <your-jwt-token>`


        Use the Barndoor SDK's `loginInteractive()` function to obtain tokens
        automatically.

````