Cloudflare · Capability

Cloudflare Workers API — Secrets

Cloudflare Workers API — Secrets. 2 operations. Lead operation: Cloudflare List Worker Secrets. Self-contained Naftiko capability covering one Cloudflare business surface.

Run with Naftiko CloudflareSecrets

What You Can Do

GET
Listsecrets — Cloudflare List Worker Secrets
/v1/accounts/{account-id}/workers/scripts/{script-name}/secrets
PUT
Addsecret — Cloudflare Add Worker Secret
/v1/accounts/{account-id}/workers/scripts/{script-name}/secrets

MCP Tools

cloudflare-list-worker-secrets

Cloudflare List Worker Secrets

read-only idempotent
cloudflare-add-worker-secret

Cloudflare Add Worker Secret

idempotent

Capability Spec

workers-secrets.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Cloudflare Workers API — Secrets
  description: 'Cloudflare Workers API — Secrets. 2 operations. Lead operation: Cloudflare List Worker Secrets. Self-contained
    Naftiko capability covering one Cloudflare business surface.'
  tags:
  - Cloudflare
  - Secrets
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    CLOUDFLARE_API_KEY: CLOUDFLARE_API_KEY
capability:
  consumes:
  - type: http
    namespace: workers-secrets
    baseUri: https://api.cloudflare.com/client/v4
    description: Cloudflare Workers API — Secrets business capability. Self-contained, no shared references.
    resources:
    - name: accounts-account_id-workers-scripts-script_name-secrets
      path: /accounts/{account_id}/workers/scripts/{script_name}/secrets
      operations:
      - name: listsecrets
        method: GET
        description: Cloudflare List Worker Secrets
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: addsecret
        method: PUT
        description: Cloudflare Add Worker Secret
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.CLOUDFLARE_API_KEY}}'
  exposes:
  - type: rest
    namespace: workers-secrets-rest
    port: 8080
    description: REST adapter for Cloudflare Workers API — Secrets. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/accounts/{account-id}/workers/scripts/{script-name}/secrets
      name: accounts-account-id-workers-scripts-script-name-secrets
      description: REST surface for accounts-account_id-workers-scripts-script_name-secrets.
      operations:
      - method: GET
        name: listsecrets
        description: Cloudflare List Worker Secrets
        call: workers-secrets.listsecrets
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: addsecret
        description: Cloudflare Add Worker Secret
        call: workers-secrets.addsecret
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: workers-secrets-mcp
    port: 9090
    transport: http
    description: MCP adapter for Cloudflare Workers API — Secrets. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: cloudflare-list-worker-secrets
      description: Cloudflare List Worker Secrets
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: workers-secrets.listsecrets
      outputParameters:
      - type: object
        mapping: $.
    - name: cloudflare-add-worker-secret
      description: Cloudflare Add Worker Secret
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: workers-secrets.addsecret
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.