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

> ## Agent Instructions
> These docs cover three products: TrustGate (AI agent gateway), TrustGuard (runtime security), and TrustTest (AI red teaming). Start from each product overview for the definition and How it works. Prefer the .md URL next to a page in /llms.txt when you need the full article. Use /llms-full.txt for a single-file dump of the site.

# Mark a policy as MCP-wide

> Promotes a policy to run on every MCP consumer of the gateway and on the MCP Store, narrowed by its mcp_scope (groups, except_groups, registries, tools); a null mcp_scope means every MCP caller. It never runs on LLM or A2A consumers. Promoting clears global and removes the policy's consumer links in the same write; while the flag is set a consumer cannot be attached (422). The policy takes the all-consumers levels of its scope, the ones a global policy of that scope takes, so it answers 409 when another policy of the same plugin already holds one of them, global ones included. A policy that changed while it was being promoted also answers 409: reload it and retry. A retry that finds the policy already MCP-wide answers 200 with the policy as stored. A plugin without MCP support answers 422. Plugin state such as rate-limit counters is shared gateway-wide, as for a global policy. The response may carry non-blocking warnings.



## OpenAPI

````yaml /trustgate/api/openapi.json post /v1/gateways/{gateway_id}/policies/{id}/mcp-wide
openapi: 3.0.0
info:
  description: >-
    Administrative API for managing gateways and their registries, policies,
    consumers and auth credentials.
  title: TrustGate Admin API
  contact:
    name: NeuralTrust
    url: https://neuraltrust.ai/contact
    email: support@neuraltrust.ai
  version: '1.0'
servers:
  - url: /
security: []
paths:
  /v1/gateways/{gateway_id}/policies/{id}/mcp-wide:
    post:
      tags:
        - policies
      summary: Mark a policy as MCP-wide
      description: >-
        Promotes a policy to run on every MCP consumer of the gateway and on the
        MCP Store, narrowed by its mcp_scope (groups, except_groups, registries,
        tools); a null mcp_scope means every MCP caller. It never runs on LLM or
        A2A consumers. Promoting clears global and removes the policy's consumer
        links in the same write; while the flag is set a consumer cannot be
        attached (422). The policy takes the all-consumers levels of its scope,
        the ones a global policy of that scope takes, so it answers 409 when
        another policy of the same plugin already holds one of them, global ones
        included. A policy that changed while it was being promoted also answers
        409: reload it and retry. A retry that finds the policy already MCP-wide
        answers 200 with the policy as stored. A plugin without MCP support
        answers 422. Plugin state such as rate-limit counters is shared
        gateway-wide, as for a global policy. The response may carry
        non-blocking warnings.
      parameters:
        - description: Gateway id
          name: gateway_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - description: Policy id
          name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_policy_response.PolicyResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
        '409':
          description: >-
            The gateway already runs this plugin at one of the levels the policy
            would take on every MCP consumer, or the policy changed while it was
            being promoted
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
        '422':
          description: The plugin does not support MCP
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
      security:
        - BearerAuth: []
components:
  schemas:
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_policy_response.PolicyResponse:
      type: object
      properties:
        consumer_ids:
          type: array
          items:
            type: string
        created_at:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        gateway_id:
          type: string
        global:
          type: boolean
        id:
          type: string
        mcp_scope:
          description: >-
            MCPScope is echoed as stored: absent when the policy is
            consumer-wide,

            {} when a registry delete pruned every destination.
          allOf:
            - $ref: >-
                #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_policy_response.MCPScopeResponse
        mcp_wide:
          description: >-
            MCPWide marks a policy that runs on every MCP consumer of the
            gateway and

            on the MCP Store, narrowed by its mcp_scope. It is never true
            together

            with Global, and an MCP-wide policy has no consumer_ids.
          type: boolean
        mode:
          type: string
        name:
          type: string
        parallel:
          type: boolean
        priority:
          type: integer
        settings:
          type: object
          additionalProperties: {}
        slug:
          type: string
        stages:
          type: array
          items:
            type: string
        status:
          description: >-
            Status is "active" (enabled and running), "paused" (disabled) or
            "error"

            (enabled but the gateway cannot run it; see status_message).
          type: string
          enum:
            - active
            - paused
            - error
        status_message:
          description: |-
            StatusMessage is the reason the gateway cannot run the policy. It is
            present only when status is "error".
          type: string
        updated_at:
          type: string
        warnings:
          description: |-
            Warnings are non-blocking notes about the write that just succeeded,
            such as a consumer that already runs the same plugin without scope.
          type: array
          items:
            type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_policy_response.MCPScopeResponse:
      type: object
      properties:
        except_groups:
          type: array
          items:
            type: string
        groups:
          type: array
          items:
            type: string
        registry_ids:
          type: array
          items:
            type: string
        tools:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_policy_response.MCPToolRefResponse
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_policy_response.MCPToolRefResponse:
      type: object
      properties:
        registry_id:
          type: string
        tool:
          type: string
  securitySchemes:
    BearerAuth:
      type: apiKey
      name: Authorization
      in: header

````

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