Discord · Capability

Discord OAuth2 API — OAuth2

Discord OAuth2 API — OAuth2. 4 operations. Lead operation: Discord Authorize. Self-contained Naftiko capability covering one Discord business surface.

Run with Naftiko DiscordOAuth2

What You Can Do

GET
Authorize — Discord Authorize
/v1/oauth2/authorize
GET
Getoauth2keys — Discord Get OAuth2 keys
/v1/oauth2/keys
POST
Gettoken — Discord Get access token
/v1/oauth2/token
POST
Revoketoken — Discord Revoke access token
/v1/oauth2/token/revoke

MCP Tools

discord-authorize

Discord Authorize

read-only idempotent
discord-get-oauth2-keys

Discord Get OAuth2 keys

read-only idempotent
discord-get-access-token

Discord Get access token

read-only
discord-revoke-access-token

Discord Revoke access token

Capability Spec

oauth2-oauth2.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Discord OAuth2 API — OAuth2
  description: 'Discord OAuth2 API — OAuth2. 4 operations. Lead operation: Discord Authorize. Self-contained Naftiko capability
    covering one Discord business surface.'
  tags:
  - Discord
  - OAuth2
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    DISCORD_API_KEY: DISCORD_API_KEY
capability:
  consumes:
  - type: http
    namespace: oauth2-oauth2
    baseUri: https://discord.com/api/v10
    description: Discord OAuth2 API — OAuth2 business capability. Self-contained, no shared references.
    resources:
    - name: oauth2-authorize
      path: /oauth2/authorize
      operations:
      - name: authorize
        method: GET
        description: Discord Authorize
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: response_type
          in: query
          type: string
          description: OAuth2 grant type (code or token)
          required: true
        - name: client_id
          in: query
          type: string
          description: Your application's client ID
          required: true
        - name: scope
          in: query
          type: string
          description: Space-delimited list of OAuth2 scopes
          required: true
        - name: state
          in: query
          type: string
          description: Unique string for CSRF protection
        - name: redirect_uri
          in: query
          type: string
          description: Registered redirect URI
        - name: prompt
          in: query
          type: string
          description: Controls the authorization prompt behavior
    - name: oauth2-keys
      path: /oauth2/keys
      operations:
      - name: getoauth2keys
        method: GET
        description: Discord Get OAuth2 keys
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: oauth2-token
      path: /oauth2/token
      operations:
      - name: gettoken
        method: POST
        description: Discord Get access token
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: oauth2-token-revoke
      path: /oauth2/token/revoke
      operations:
      - name: revoketoken
        method: POST
        description: Discord Revoke access token
        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.DISCORD_API_KEY}}'
  exposes:
  - type: rest
    namespace: oauth2-oauth2-rest
    port: 8080
    description: REST adapter for Discord OAuth2 API — OAuth2. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/oauth2/authorize
      name: oauth2-authorize
      description: REST surface for oauth2-authorize.
      operations:
      - method: GET
        name: authorize
        description: Discord Authorize
        call: oauth2-oauth2.authorize
        with:
          response_type: rest.response_type
          client_id: rest.client_id
          scope: rest.scope
          state: rest.state
          redirect_uri: rest.redirect_uri
          prompt: rest.prompt
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/oauth2/keys
      name: oauth2-keys
      description: REST surface for oauth2-keys.
      operations:
      - method: GET
        name: getoauth2keys
        description: Discord Get OAuth2 keys
        call: oauth2-oauth2.getoauth2keys
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/oauth2/token
      name: oauth2-token
      description: REST surface for oauth2-token.
      operations:
      - method: POST
        name: gettoken
        description: Discord Get access token
        call: oauth2-oauth2.gettoken
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/oauth2/token/revoke
      name: oauth2-token-revoke
      description: REST surface for oauth2-token-revoke.
      operations:
      - method: POST
        name: revoketoken
        description: Discord Revoke access token
        call: oauth2-oauth2.revoketoken
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: oauth2-oauth2-mcp
    port: 9090
    transport: http
    description: MCP adapter for Discord OAuth2 API — OAuth2. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: discord-authorize
      description: Discord Authorize
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: oauth2-oauth2.authorize
      with:
        response_type: tools.response_type
        client_id: tools.client_id
        scope: tools.scope
        state: tools.state
        redirect_uri: tools.redirect_uri
        prompt: tools.prompt
      outputParameters:
      - type: object
        mapping: $.
    - name: discord-get-oauth2-keys
      description: Discord Get OAuth2 keys
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: oauth2-oauth2.getoauth2keys
      outputParameters:
      - type: object
        mapping: $.
    - name: discord-get-access-token
      description: Discord Get access token
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: oauth2-oauth2.gettoken
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: discord-revoke-access-token
      description: Discord Revoke access token
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: oauth2-oauth2.revoketoken
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.