Ocelot · Capability

Ocelot Administration API

The Ocelot Administration API allows runtime changes to the Ocelot .NET API Gateway configuration via an authenticated HTTP API. It supports retrieving and overwriting the active configuration and clearing output cache regions without restarting the gateway. The API is authenticated via Bearer tokens issued by Ocelot's built-in IdentityServer or an external identity provider.

Run with Naftiko OcelotAPI

What You Can Do

POST
Issueadmintoken — Issue an admin access token
/administration/connect/token
GET
Getconfiguration — Get current Ocelot configuration
/administration/configuration
POST
Setconfiguration — Overwrite Ocelot configuration
/administration/configuration
DELETE
Clearcacheregion — Clear an output cache region
/administration/outputcache/{region}

MCP Tools

issueadmintoken

Issue an admin access token

getconfiguration

Get current Ocelot configuration

read-only idempotent
setconfiguration

Overwrite Ocelot configuration

clearcacheregion

Clear an output cache region

idempotent

Capability Spec

ocelot-capability.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Ocelot Administration API
  description: The Ocelot Administration API allows runtime changes to the Ocelot .NET API Gateway configuration via an authenticated
    HTTP API. It supports retrieving and overwriting the active configuration and clearing output cache regions without restarting
    the gateway. The API is authenticated via Bearer tokens issued by Ocelot's built-in IdentityServer or an external identity
    provider.
  tags:
  - Ocelot
  - API
  created: '2026-05-06'
  modified: '2026-05-06'
capability:
  consumes:
  - type: http
    namespace: ocelot
    baseUri: http://localhost:5000
    description: Ocelot Administration API HTTP API.
    authentication:
      type: bearer
      token: '{{OCELOT_TOKEN}}'
    resources:
    - name: administration-connect-token
      path: /administration/connect/token
      operations:
      - name: issueadmintoken
        method: POST
        description: Issue an admin access token
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: administration-configuration
      path: /administration/configuration
      operations:
      - name: getconfiguration
        method: GET
        description: Get current Ocelot configuration
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: setconfiguration
        method: POST
        description: Overwrite Ocelot configuration
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: administration-outputcache-region
      path: /administration/outputcache/{region}
      operations:
      - name: clearcacheregion
        method: DELETE
        description: Clear an output cache region
        inputParameters:
        - name: region
          in: path
          type: string
          required: true
          description: Cache region name as configured in FileCacheOptions
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    port: 8080
    namespace: ocelot-rest
    description: REST adapter for Ocelot Administration API.
    resources:
    - path: /administration/connect/token
      name: issueadmintoken
      operations:
      - method: POST
        name: issueadmintoken
        description: Issue an admin access token
        call: ocelot.issueadmintoken
        outputParameters:
        - type: object
          mapping: $.
    - path: /administration/configuration
      name: getconfiguration
      operations:
      - method: GET
        name: getconfiguration
        description: Get current Ocelot configuration
        call: ocelot.getconfiguration
        outputParameters:
        - type: object
          mapping: $.
    - path: /administration/configuration
      name: setconfiguration
      operations:
      - method: POST
        name: setconfiguration
        description: Overwrite Ocelot configuration
        call: ocelot.setconfiguration
        outputParameters:
        - type: object
          mapping: $.
    - path: /administration/outputcache/{region}
      name: clearcacheregion
      operations:
      - method: DELETE
        name: clearcacheregion
        description: Clear an output cache region
        call: ocelot.clearcacheregion
        with:
          region: rest.region
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    port: 9090
    namespace: ocelot-mcp
    transport: http
    description: MCP adapter for Ocelot Administration API for AI agent use.
    tools:
    - name: issueadmintoken
      description: Issue an admin access token
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: ocelot.issueadmintoken
      outputParameters:
      - type: object
        mapping: $.
    - name: getconfiguration
      description: Get current Ocelot configuration
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: ocelot.getconfiguration
      outputParameters:
      - type: object
        mapping: $.
    - name: setconfiguration
      description: Overwrite Ocelot configuration
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: ocelot.setconfiguration
      outputParameters:
      - type: object
        mapping: $.
    - name: clearcacheregion
      description: Clear an output cache region
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: ocelot.clearcacheregion
      with:
        region: tools.region
      inputParameters:
      - name: region
        type: string
        description: Cache region name as configured in FileCacheOptions
        required: true
      outputParameters:
      - type: object
        mapping: $.
binds:
- namespace: env
  keys:
    OCELOT_TOKEN: OCELOT_TOKEN