Rokha OAuth API

Connect third-party accounts and MCP servers

GitHub OpenAPI

Operations 10

GET /.well-known/oauth-authorization-server MCP-auth-spec authorization-server metadata (RFC 8414) #
GET /.well-known/oauth-protected-resource MCP-auth-spec protected-resource metadata (RFC 9728) #
GET /api/oauth/callback/{provider} OAuth redirect callback (browser; not called directly) #
POST /api/oauth/connect/mcp Connect any MCP-auth-spec server (dynamic client registration) #
GET /api/oauth/connect/{provider} Start a Tier-1 OAuth Connect (returns the consent URL) #
GET /api/oauth/connections List the caller's OAuth connections + available providers #
GET /api/oauth/resolve Auth ladder: how does this MCP server authenticate? #
GET /oauth/authorize OAuth 2.1 authorization endpoint (PKCE S256) #
POST /oauth/register Dynamic client registration (RFC 7591) #
POST /oauth/token OAuth 2.1 token endpoint (authorization_code + refresh_token) #

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/rokha-ai:rokha-ai-oauth-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

rokha-ai-oauth-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    name: Rokha
    url: https://rokha.ai
  description: 'The public API of Rokha, the Agent Lab. Build a tool,

    run it for real with a trace, sell it or hire it out. Agents use the same

    doors over MCP at `/mcp/jsonrpc`. Versioning: `GET /api/schema/version`.'
  license:
    name: MIT
    url: https://github.com/rokha-ai/rokha-sdk/blob/main/LICENSE
  title: Rokha Public OAuth API
  version: 1.0.0
servers:
- description: Local development (default Erebus port)
  url: http://localhost:3000
- description: Production (hosted Erebus)
  url: https://erebus.rokha.ai
security: []
tags:
- description: Connect third-party accounts and MCP servers
  name: OAuth
paths:
  /.well-known/oauth-authorization-server:
    get:
      description: Advertises authorize/token/register endpoints, PKCE S256, and the authorization_code + refresh_token grants.
      operationId: oauthAuthorizationServerMetadata
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: metadata
      summary: MCP-auth-spec authorization-server metadata (RFC 8414)
      tags:
      - OAuth
  /.well-known/oauth-protected-resource:
    get:
      description: 'Names Rokha''s authorization server + scopes for the MCP door. Modern

        MCP clients fetch this after a 401 (the `/mcp/jsonrpc` 401 carries a

        `WWW-Authenticate: Bearer resource_metadata="…"` header) to auto-start

        the OAuth flow.'
      operationId: oauthProtectedResourceMetadata
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: metadata
      summary: MCP-auth-spec protected-resource metadata (RFC 9728)
      tags:
      - OAuth
  /api/oauth/callback/{provider}:
    get:
      description: 'The provider''s redirect target. Authenticated by a sealed state

        parameter (no JWT). Exchanges the code, stores the grant, and

        redirects home with `?oauth=&status=connected`.'
      operationId: oauthCallback
      parameters:
      - in: path
        name: provider
        required: true
        schema:
          type: string
      responses:
        '307':
          description: Redirect home with a status query param
      summary: OAuth redirect callback (browser; not called directly)
      tags:
      - OAuth
  /api/oauth/connect/mcp:
    post:
      description: 'The Tier-2 handshake: given `{ server_url }`, Rokha probes the server,

        discovers its protected-resource + authorization-server metadata,

        dynamically registers itself as a client (RFC 7591), and returns a

        PKCE consent `redirect_url`. On approval the token is stored in the

        vault as `mcp-`, bound to that server, refreshed automatically.'
      operationId: oauthConnectMcp
      requestBody:
        content:
          application/json:
            schema:
              properties:
                server_url:
                  type: string
              required:
              - server_url
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: '{ redirect_url, mode, issuer, alias }'
      security:
      - bearerAuth: []
      summary: Connect any MCP-auth-spec server (dynamic client registration)
      tags:
      - OAuth
  /api/oauth/connect/{provider}:
    get:
      description: 'Begin a one-click Connect for a known provider (github, google, x,

        atlassian, microsoft, slack, notion, gitlab, discord, reddit, linear).

        Returns `redirect_url` to open in a browser; on approval the token

        lands in the caller''s vault as `oauth-` (account-wide,

        refreshed automatically), usable via `secret_refs`. 503 if the

        provider isn''t configured on the deployment.'
      operationId: oauthConnect
      parameters:
      - in: path
        name: provider
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: '{ redirect_url, provider, alias }'
      security:
      - bearerAuth: []
      summary: Start a Tier-1 OAuth Connect (returns the consent URL)
      tags:
      - OAuth
  /api/oauth/connections:
    get:
      operationId: oauthConnections
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: '{ connected: [...], available: [...] }'
      security:
      - bearerAuth: []
      summary: List the caller's OAuth connections + available providers
      tags:
      - OAuth
  /api/oauth/resolve:
    get:
      description: 'Classify any MCP server URL so a client knows the ONE next step:

        `open` (no credential — just call it), `key` (save a token in the

        vault once, then attach via `secret_refs`), `tier1` (a known provider —

        one-click account-wide OAuth Connect at `/api/oauth/connect/{provider}`),

        or `oauth_spec` (the server speaks the MCP auth spec — connect it

        directly via `POST /api/oauth/connect/mcp`; Rokha discovers its auth

        server and dynamically registers as a client). The response `hint`

        spells out the step.'
      operationId: oauthResolve
      parameters:
      - in: query
        name: server
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: '{ mode, hint, provider?, alias? }'
      security:
      - bearerAuth: []
      summary: 'Auth ladder: how does this MCP server authenticate?'
      tags:
      - OAuth
  /oauth/authorize:
    get:
      description: 'The browser lands here from an MCP client. Validates the client +

        registered redirect_uri + S256 PKCE, then redirects to the `/connect`

        consent page where the human logs in and approves. On approval a

        single-use, PKCE-bound code redirects back to the client.'
      operationId: oauthAuthorize
      parameters:
      - in: query
        name: client_id
        required: true
        schema:
          type: string
      - in: query
        name: redirect_uri
        required: true
        schema:
          type: string
      - in: query
        name: response_type
        required: true
        schema:
          enum:
          - code
          type: string
      - in: query
        name: code_challenge
        required: true
        schema:
          type: string
      - in: query
        name: code_challenge_method
        required: true
        schema:
          enum:
          - S256
          type: string
      - in: query
        name: state
        schema:
          type: string
      responses:
        '307':
          description: Redirect to the consent page
      summary: OAuth 2.1 authorization endpoint (PKCE S256)
      tags:
      - OAuth
  /oauth/register:
    post:
      description: An MCP client self-registers with `{ client_name, redirect_uris[] }` and gets a public PKCE `client_id` (no secret).
      operationId: oauthRegisterClient
      requestBody:
        content:
          application/json:
            schema:
              properties:
                client_name:
                  type: string
                redirect_uris:
                  items:
                    type: string
                  type: array
              required:
              - redirect_uris
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: '{ client_id, redirect_uris, token_endpoint_auth_method }'
      summary: Dynamic client registration (RFC 7591)
      tags:
      - OAuth
  /oauth/token:
    post:
      description: '`grant_type=authorization_code` (with `code`, `code_verifier`,

        `client_id`, `redirect_uri`) exchanges a consented code for a Bearer

        access token + a rotating refresh token — the Bearer the MCP doors

        accept. `grant_type=refresh_token` renews without another human consent.'
      operationId: oauthToken
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              properties:
                client_id:
                  type: string
                code:
                  type: string
                code_verifier:
                  type: string
                grant_type:
                  type: string
                redirect_uri:
                  type: string
                refresh_token:
                  type: string
              required:
              - grant_type
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: '{ access_token, token_type, expires_in, refresh_token, scope }'
      summary: OAuth 2.1 token endpoint (authorization_code + refresh_token)
      tags:
      - OAuth
components:
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: 'JWT issued by `/api/wallets/verify` (after `/api/wallets/challenge`),

        or `/api/auth/google/callback`. Send as

        `Authorization: Bearer <token>`. Refresh via `/api/auth/refresh`

        before expiry (24h default).

        '
      scheme: bearer
      type: http