> ## 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 the organization's MCP policies

> Returns every MCP policy, the Baseline policy first and the rest by name, plus `policy_model`, which is always `SERVER_POLICIES` (deprecated; every organization manages MCP traffic as one policy per MCP server with a Baseline fallback).



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/dlp/admin/v1/mcp-policies
openapi: 3.1.0
info:
  title: Barndoor.ai Public API
  description: Unified public API specification for Barndoor.ai platform
  version: 2.38.0
servers:
  - url: https://{host}
    description: Barndoor public API
    variables:
      host:
        default: platform.barndoor.ai
        description: >-
          The host serving your Barndoor deployment. Defaults to production;
          override it for another environment or a dedicated deployment.
security:
  - ApiKey: []
  - OAuth2:
      - openid
      - profile
      - email
tags:
  - name: dlp
    x-group: Data Control Center
  - name: identity
    x-group: Identity
  - name: llm-gateway
    x-group: LLM Gateway
  - name: notification
    x-group: Notifications
  - name: policy
    x-group: Policies
  - name: registry
    x-group: MCP Gateway
  - name: system-management
    x-group: Log Exports
paths:
  /api/dlp/admin/v1/mcp-policies:
    get:
      tags:
        - dlp
      summary: List the organization's MCP policies
      description: >-
        Returns every MCP policy, the Baseline policy first and the rest by
        name, plus `policy_model`, which is always `SERVER_POLICIES`
        (deprecated; every organization manages MCP traffic as one policy per
        MCP server with a Baseline fallback).
      operationId: list_mcp_policies
      responses:
        '200':
          description: MCP policies
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpPoliciesResponse'
        '401':
          description: Missing or invalid bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DlpErrorResponse'
        '403':
          description: Caller lacks a tenant-admin role
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DlpErrorResponse'
components:
  schemas:
    McpPoliciesResponse:
      type: object
      required:
        - policy_model
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/McpPolicyResponse'
          description: The Baseline policy first (when it exists), then by name.
        policy_model:
          type: string
          description: >-
            Always `SERVER_POLICIES`: every organization manages MCP traffic
            with

            these routes. Kept for clients that read it.
          deprecated: true
    DlpErrorResponse:
      type: object
      description: >-
        The error body every `/admin/v1` handler returns.


        Two shapes reach the wire and both are modelled here as optional fields:

        the shared auth/role gate in [`super`] emits `{"error": ...}`, while

        [`super::json_message`] — which the handlers themselves use — emits

        `{"message": ...}`. Exactly one is present on any given response. This
        is

        documentation of what the service already does, not a new contract; a

        handler is not free to send both.
      properties:
        error:
          type:
            - string
            - 'null'
          description: Set by the authentication and tenant-admin role gate (401 and 403).
        message:
          type:
            - string
            - 'null'
          description: Set by handler-level validation and store failures.
    McpPolicyResponse:
      type: object
      required:
        - id
        - name
        - is_baseline
        - mcp_server_ids
        - rules
        - created_by
        - updated_by
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
        created_by:
          type: string
        id:
          type: string
        is_baseline:
          type: boolean
        mcp_server_ids:
          type: array
          items:
            type: string
        name:
          type: string
        rules:
          type: array
          items:
            $ref: '#/components/schemas/McpPolicyRuleResponse'
        updated_at:
          type: string
        updated_by:
          type: string
    McpPolicyRuleResponse:
      type: object
      required:
        - id
        - runtime_boundary
        - action
        - dry_run
        - agent_scope
        - principal_scope
        - detection_engine_ids
      properties:
        action:
          type: string
        agent_scope:
          $ref: '#/components/schemas/AgentScopeJson'
        detection_engine_ids:
          type: array
          items:
            type: string
        dry_run:
          type: boolean
        id:
          type: string
        label:
          type:
            - string
            - 'null'
        mask_format:
          oneOf:
            - $ref: '#/components/schemas/MaskFormat'
            - type: 'null'
        principal_scope:
          $ref: '#/components/schemas/PrincipalScopeJson'
        runtime_boundary:
          type: string
    AgentScopeJson:
      type: object
      description: Which AI agents a rule applies to.
      required:
        - mode
      properties:
        agent_ids:
          type: array
          items:
            type: string
          description: >-
            Registry agent ids. Empty for `ALL`; 1 to 200 for `ONLY` and
            `EXCEPT`.
        mode:
          type: string
          description: '`ALL`, `ONLY` or `EXCEPT`.'
      additionalProperties: false
    MaskFormat:
      type: object
      description: >-
        The `mask_format` object stored on
        `dlp.enforcement_policies.mask_format`

        and carried on the admin REST surface. `deny_unknown_fields` so a typo
        in a

        client (or a future key an older server does not understand) fails
        loudly.
      required:
        - keep
        - keep_chars
      properties:
        keep:
          $ref: '#/components/schemas/MaskKeep'
        keep_chars:
          type: integer
          format: int32
          minimum: 0
        mask_char:
          type: string
        preserve_separators:
          type: boolean
      additionalProperties: false
    PrincipalScopeJson:
      type: object
      description: Which users a rule applies to, by IdP group or role.
      required:
        - mode
      properties:
        mode:
          type: string
          description: |-
            `ALL`, `ONLY` or `EXCEPT`. A user matches a list when any of their
            groups or roles is in it.
        principals:
          type: array
          items:
            $ref: '#/components/schemas/PrincipalJson'
      additionalProperties: false
    MaskKeep:
      type: string
      enum:
        - PREFIX
        - SUFFIX
    PrincipalJson:
      type: object
      required:
        - principal_type
        - principal_id
      properties:
        principal_id:
          type: string
        principal_type:
          type: string
          description: '`GROUP` or `ROLE`.'
      additionalProperties: false
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        A Barndoor API key, sent as `Authorization: Bearer <key>`. Keys are
        prefixed `bdai_` and are opaque — do not attempt to decode one.
        Interchangeable with an OAuth 2.0 access token.
    OAuth2:
      type: oauth2
      x-issuer: https://auth.barndoor.ai/realms/barndoor
      description: >-
        An OAuth 2.0 access token from Barndoor's identity provider, sent as
        `Authorization: Bearer <token>`. Public clients must use PKCE.
        Interchangeable with an API key.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/auth
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.
        clientCredentials:
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.

````

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