### Run the Kong setup with start.sh Source: https://mcpblaze.com/docs/migrate The one-command way to start Kong. Requires only Docker. The script checks Docker, boots the gateway, waits until healthy, prints what loaded (services, consumers), and smoke-tests that auth is enforced. The API comes up at http://localhost:8000///... and forwards to the same upstream as before. ```bash unzip my-api-kong.zip -d my-api cd my-api/kong bash start.sh ``` -------------------------------- ### Export a Kong bundle and start the gateway with start.sh Source: https://mcpblaze.com/docs/migrate Export a Kong bundle, unzip it, and start the gateway with start.sh. Docker is the only prerequisite; the output shows the build progress, the loaded services and consumers, and the smoke test result. The gateway is then live on localhost:8000 and the Admin API on 8001. ```bash # ~0:00 export the bundle $ apiblaze export my-api --kong -o my-api-kong.zip Queuing kong export of my-api@1.0.0… Building bundle.... ✓ Saved my-api-kong.zip (412 KB) Read MIGRATION-REPORT.json inside the zip for the full fidelity ledger. Kong: unzip, then `cd kong && docker compose up` (see kong/README.md). # ~0:25 unzip it and start the gateway (Docker is the only prerequisite) $ unzip -q my-api-kong.zip -d my-api && cd my-api/kong $ bash start.sh ▶ Starting Kong (docker compose up)… ✓ Kong is up ▶ Loaded configuration services: 2 consumers: 148 (via the Kong Admin API on 8001) ▶ Smoke test ✓ auth is enforced (no credentials → 401) Your gateway is live: API http://localhost:8000/1.0.0/prod/... Admin API http://localhost:8001 ``` -------------------------------- ### Install apiblaze CLI and export a Kong bundle or data Source: https://mcpblaze.com/docs/migrate Install the apiblaze CLI once, then export a runnable Kong bundle with --kong or a target-neutral data export with --data. The command queues the export, waits while it builds, and saves the zip locally. ```bash # install once npm install -g apiblaze # export a runnable Kong bundle apiblaze export my-api --kong -o my-api-kong.zip # or a target-neutral data export apiblaze export my-api --data ``` -------------------------------- ### Create an API proxy with apiblaze Source: https://mcpblaze.com/docs This command initiates the interactive setup for an API proxy, allowing you to define authentication and resource locking rules based on an OpenAPI specification. ```bash $ npx apiblaze create --target ./openapi.yaml Create an API proxy ? Proxy name: nino → Your API will live at https://nino.abz.run/1.0.0/dev ? How should callers sign in? Sign in with an account (OAuth) # default · --apikey for keys ? Which sign-in? Hosted sign-in with GitHub ? Do you want to prevent unauthorized users from taking unauthorized actions? Yes Reading your OpenAPI spec… ? Lock these to the person who created them (or an admin): (space toggles · a = all · enter accepts) ◉ reservations — only the person who created a reservation, or an admin, can view, change or delete it ◉ orders — only the person who created an order, or an admin, can view or change it ? Create API proxy "nino" from ./openapi.yaml? Yes ✔ Proxy created! ? Who is the admin? Their email address (Enter to skip): you@example.com ✓ https://nino.abz.run/1.0.0/dev — callers sign in with GitHub ✓ reservations + orders locked to their creator ✓ admin: you@example.com — active on first sign-in ? Connect an agent to it now? Claude Code (detected) # also Codex · "Not now" ✓ Claude Code connected — it will ask you to sign in with GitHub the first time you use it ``` -------------------------------- ### Clone and launch ResiResi demo (macOS/Linux and Windows) Source: https://mcpblaze.com/docs/full-test-project Clones the ResiResi demo repository and starts the local lab. Use the first block on macOS/Linux; the second on Windows (PowerShell or cmd). The Windows launcher is a plain batch file, so no execution-policy issues and double-clicking works. Keep the terminal open; closing it or pressing Ctrl-C stops everything cleanly. ```bash git clone https://github.com/jayjaychicago/rr cd rr ./launch.sh ``` ```batch git clone https://github.com/jayjaychicago/rr cd rr .\.launch.cmd ``` -------------------------------- ### Unzip and inspect the migration bundle layout Source: https://mcpblaze.com/docs/migrate Shows the full folder tree of the migration bundle after unzipping. Read MIGRATION-REPORT.json first, and use SCHEMA.md for a plain-language guide to every file. ```text my-api-kong.zip ├── MIGRATION-REPORT.json ← read this first: what carried over, and how well ├── SCHEMA.md ← plain-language guide to every file ├── project-config.json ← your upstreams, routes, CORS, rate limits ├── openapi.json ← your API spec ├── transforms.json ← request/response rewrites ├── authz/ ← authorization rules + live relationship data ├── tenants// ← per tenant: login config, users, groups, keys │ ├── auth/ ← app clients, login providers, JWT issuers │ ├── users/ (+ scim/) ← end users + SCIM 2.0 for easy import │ └── keys/ ← API-key metadata + hashes ├── auth/keycloak-realm.json← a ready-to-import replacement login system └── kong/ ← everything to run it on Kong (next section) ``` -------------------------------- ### Create a proxy with curl Source: https://mcpblaze.com/docs POST to https://api.apiblaze.com/proxy with no auth header. Provide exactly one source (target, target_url, openapi, or github). Names auto-generate if omitted; this example sets name to pokeproxy. Created without an account, the proxy serves on tryabz.run. ```bash curl -sX POST https://api.apiblaze.com/proxy \ -H 'content-type: application/json' \ -d '{ "target": "https://pokeapi.co", "name": "pokeproxy" }' ``` -------------------------------- ### Create and enforce authorization rules with npx apiblaze Source: https://mcpblaze.com/docs Use the CLI to define rules in plain English. Rules start in watch-only mode by default and can be toggled to enforcement mode using the --enforce flag. ```bash $ npx apiblaze rule "users see only their own reservations; \ managers see all" reserv ✓ rule created — watch-only for now: reporting what it WOULD block, blocking nothing # happy with the report? turn it on: $ npx apiblaze rule "…" reserv --enforce GET /reservations/42 # john · owner → 200 GET /reservations/42 # alice · nobody → 403 GET /reservations/42 # maria ∈ managers → 200 ``` -------------------------------- ### Initialize APIblaze sidecar and approve origins Source: https://mcpblaze.com/docs Run in a Next.js app to install the APIblaze sidecar and dev inspector, then approve or deny origins. Approved origins route through APIblaze; unapproved ones go direct. The init command also generates a dev-only /abz-inspector page (skip with --no-inspector) and creates temporary proxies that require no login. ```bash $ npx apiblaze init # in your Next.js app; wires the sidecar + dev inspector $ npm run dev [apiblaze/sidecar] active — approved origins route through APIblaze; the rest go direct. [apiblaze/sidecar] direct (not approved) → https://api.stripe.com $ npx apiblaze sidecar approve api.stripe.com ✓ proxy created — api.stripe.com now routes through APIblaze $ npx apiblaze sidecar deny analytics.example.com # stop suggesting it $ npx apiblaze sidecar remove api.stripe.com # go direct again (deletes the proxy) ``` -------------------------------- ### Create APIblaze keys server route (NextAuth) Source: https://mcpblaze.com/docs/widgets Server route for NextAuth / Auth.js v5. Create the APIblaze keys handler with your cpKey and a getUser function that returns tenant, userId, and optional email. Export the handler as GET and POST. This is the only code you write; the widget never sees your APIblaze key. ```typescript import { createApiblazeKeys } from 'apiblaze/server'; import { auth } from '@/auth'; // your NextAuth config file const apiblazeKeys = createApiblazeKeys({ cpKey: process.env.APIBLAZE_CP_KEY!, getUser: async () => { const session = await auth(); if (!session?.user) return null; // not signed in → widget asks them to return { tenant: session.user.companyId, // ① your org/team id — or session.user.id userId: session.user.id, // ② email: session.user.email ?? undefined, // ③ }; }, }); export const GET = apiblazeKeys.handler; export const POST = apiblazeKeys.handler; ``` -------------------------------- ### Create groups widget route with createApiblazeGroups Source: https://mcpblaze.com/docs/widgets Server route for the groups widget, identical to the keys route except for the function name. Uses the same APIBLAZE_CP_KEY and getUser logic to identify the customer and user. Exports GET and POST handlers for the APIblaze groups widget. ```typescript import { createApiblazeGroups } from 'apiblaze/server'; // ← the only change vs. the keys route import { auth } from '@/auth'; const apiblazeGroups = createApiblazeGroups({ cpKey: process.env.APIBLAZE_CP_KEY!, // the SAME widget key getUser: async () => { // the SAME getUser const session = await auth(); if (!session?.user) return null; return { tenant: session.user.companyId, // ① which CUSTOMER userId: session.user.id, // ② which PERSON email: session.user.email ?? undefined, // ③ links identity (dev-portal, admin rights) }; }, }); export const GET = apiblazeGroups.handler; export const POST = apiblazeGroups.handler; ``` -------------------------------- ### Verify an existing API key or JWT with start.sh flags Source: https://mcpblaze.com/docs/migrate Optional flags for start.sh to confirm a real credential works. --key expects a 200 for an existing API key; --token expects a 200 for a JWT. ```bash bash start.sh --key # expects 200 bash start.sh --token # expects 200 ``` -------------------------------- ### Create proxy and mint keys with --apikey Source: https://mcpblaze.com/docs The --apikey flag enables key-protected access and prints bootstrap keys. Use the apikeys mint command to issue keys to specific tenants or users. ```bash # without --apikey, create sets up sign-in and mints NO key — this flag is how you ask for keys $ npx apiblaze create --target https://api.example.com --apikey ✓ Live → https://bravotiger4821.tryabz.run/1.0.0/prod API key (prod): sk_prod_… # also minted for dev & test # issue a key to one named person — calls made with it count as them: $ npx apiblaze apikeys mint --tenant acme --for alice@example.com ``` -------------------------------- ### npx apiblaze create — one command, no signup Source: https://mcpblaze.com/docs No description ```bash $ npx apiblaze create --target https://pokeapi.co ? How should callers sign in? Sign in with an account (OAuth) # the default — no API key is minted ✓ Live → https://bravotiger4821.tryabz.run/1.0.0/prod · callers sign in with GitHub Portal: https://quietfox5093.portal.apiblaze.com/1.0.0 Claim URL: https://dashboard.apiblaze.com/claim?claimCode=G7QN-… # call it — sign in once as a user of the API, then send the token $ TOKEN=$(npx apiblaze consumer login --tenant quietfox5093 >/dev/null && npx apiblaze consumer tokens --json | jq -r .access_token) $ curl https://bravotiger4821.tryabz.run/1.0.0/prod/api/v2/pokemon/ditto -H "Authorization: Bearer $TOKEN" # prefer keys? add --apikey and the keys are printed instead (see Authentication) ``` ```bash # prefer keys? add --apikey and the keys are printed instead (see Authentication) ``` -------------------------------- ### Configure OAuth sign-in methods Source: https://mcpblaze.com/docs Demonstrates three OAuth configurations: APIblaze-hosted GitHub sign-in, custom JWT issuer trust, and APIblaze-hosted login using a custom OAuth application. ```bash # APIblaze-hosted GitHub sign-in (managed — nothing to register). This is what create # does with no auth flag at all; --oauth just spells it out. $ npx apiblaze create --target https://api.example.com --oauth # YOUR hosted login: the proxy trusts your JWT issuer $ npx apiblaze create --target https://api.example.com \ --oauth '{"iss":"https://login.acme.com/","aud":"acme-api","jwks":"https://login.acme.com/.well-known/jwks.json"}' # APIblaze-hosted login page with YOUR OAuth app (github · google · microsoft · facebook · auth0) $ npx apiblaze create --target https://api.example.com \ --oauth '{"provider":"google","clientId":"xxxx.apps.googleusercontent.com","clientSecret":"GOCSPX-xxxx"}' ``` -------------------------------- ### Run the four apiblaze builder agents Source: https://mcpblaze.com/docs Shows the npx commands for the four builder agents: general, openapi, authz, and mcp. Each proposes configuration, you review, then publish or enable. Billed per turn. ```bash $ npx apiblaze agent # general: describe what you want, it makes the calls $ npx apiblaze agent openapi acme # drafts your OpenAPI spec from real captured traffic, # then /publish — or opens a GitHub PR to your repo $ npx apiblaze agent authz acme # drafts access rules, tests them on real # traffic watch-only, /enable to enforce $ npx apiblaze agent mcp acme # picks routes to become MCP tools, /publish ``` -------------------------------- ### Create proxy with default GitHub OAuth Source: https://mcpblaze.com/docs Initializes a proxy with the default APIblaze-managed GitHub sign-in. This is equivalent to running the command without the --oauth flag. ```bash $ npx apiblaze create --target https://api.example.com --oauth # the same as plain `npx apiblaze create --target https://api.example.com` — no API key is minted ``` -------------------------------- ### npx apiblaze create --target https://pokeapi.co/api/v2/pokemo --apikey (no signup) Source: https://mcpblaze.com/docs No description ```bash $ npx apiblaze create --target https://pokeapi.co/api/v2/pokemo▍ --apikey ``` -------------------------------- ### APIBlaze Consumer Portal and CLI Commands Source: https://mcpblaze.com/docs Access the hosted portal via URL or manage consumer tasks using the apiblaze CLI. ```bash # the hosted portal — login, self-serve keys, try endpoints live https://{project}.portal.apiblaze.com/{version} # or from the terminal: $ npx apiblaze consumer login # device-flow login to a tenant's portal $ npx apiblaze consumer apikeys # list keys (reveals expiring ones), offer to create $ npx apiblaze consumer tokens # show the access / refresh / id tokens ``` -------------------------------- ### Add a version and retarget an environment with npx apiblaze Source: https://mcpblaze.com/docs Use these CLI commands to add a new API version, point an environment to a different URL, and set the base domain. Each environment has its own API keys, so a leaked dev key never touches prod. ```bash # add a 2.0.0 alongside the existing 1.0.0 (serves at /2.0.0/…) $ npx apiblaze create --name myapi --target https://api-v2.example.com --apiversion 2.0.0 # point one environment somewhere else $ npx apiblaze target myapi --env dev --url https://dev.example.com # choose which version/environment the bare domain serves $ npx apiblaze domain set-base myapi ``` -------------------------------- ### Create proxy and retrieve claim URL Source: https://mcpblaze.com/docs Use this curl command to create a proxy and obtain the claim_url from the response to permanently associate the proxy with your account. ```bash $ curl -sX POST https://api.apiblaze.com/proxy \ -H 'content-type: application/json' \ -d '{ "target": "https://pokeapi.co" }' { "project_id": "bravotiger4821", … "claim_url": "https://dashboard.apiblaze.com/claim?claimCode=G7QN-…" } ``` -------------------------------- ### apiblaze CLI commands Source: https://mcpblaze.com/docs A collection of common CLI commands for interacting with apiblaze, including creating proxies, managing configurations, and authentication. ```bash npx apiblaze apichat --target # chat with any API, no login npx apiblaze create --target https://pokeapi.co # go live behind GitHub sign-in, no signup npx apiblaze create --target ./openapi.yaml # …from a spec: also offers to lock down what people create npx apiblaze create --target https://pokeapi.co --apikey # …with API keys instead of sign-in npx apiblaze rule myapi # review / change the ownership rules npx apiblaze init # sidecar into a Next.js app npx apiblaze dev 3000 # tunnel localhost, stream traffic npx apiblaze login && npx apiblaze claim # claim it to your account npx apiblaze config myapi # browse & change EVERY setting ``` -------------------------------- ### Create a proxy from an inline OpenAPI document with curl Source: https://mcpblaze.com/docs Use this curl command to provision a proxy from an inline OpenAPI document. Routes, schemas, and docs arrive pre-populated. Replace the placeholder with the full OpenAPI YAML or JSON document as a string. ```bash curl -sX POST https://api.apiblaze.com/proxy \ -H 'content-type: application/json' \ -d '{ "openapi": "" }' ``` -------------------------------- ### Manage API proxy administration and configuration Source: https://mcpblaze.com/docs Commands for managing admin access, reviewing rules, and toggling authorization enforcement. ```bash npx apiblaze admins add teammate@example.com --tenant ninodefaulttenant — make someone an admin npx apiblaze rule nino — review or change the rules npx apiblaze config nino authorization.enforce_authorization false — turn enforcement off ``` -------------------------------- ### POST /proxy Source: https://mcpblaze.com/docs Creates a new proxy by providing exactly one source (target, openapi, or github). All other options are optional and defaulted. No auth header is required. ```APIDOC ## POST /proxy ### Description Creates a new proxy by providing exactly one source (target, openapi, or github). All other options are optional and defaulted. No auth header is required. ### Method POST ### Endpoint https://api.apiblaze.com/proxy ### Parameters #### Request Body - **target** (string) - Required (if no other source) - The target URL to proxy. - **target_url** (string) - Optional - Alias for target. - **openapi** (string) - Optional - OpenAPI spec source. - **github** (string) - Optional - GitHub source. - **name** (string) - Optional - Name for the proxy. Auto-generated if omitted. - **tenant** (string) - Optional - Tenant identifier. - **product_slug** (string) - Optional - Product slug. ### Request Example { "target": "https://pokeapi.co", "name": "pokeproxy" } ### Response #### Success Response (200) - **proxy** (object) - The created proxy details. #### Response Example { "proxy": { "domain": "tryabz.run", "name": "pokeproxy" } } ``` -------------------------------- ### Prove existing consumer keys still work with curl Source: https://mcpblaze.com/docs/migrate Sends an existing API key to the running gateway. A real key yields 200; without a key yields 401. Use X-API-Key header, not Authorization. Behind this, the bundled apiblaze-auth plugin matches the SHA-256 of the incoming key against the exported hash table and also verifies JWTs. The plugin lives in plugins/ as readable Lua and is wired via KONG_PLUGINS. ```bash # with a real key → 200; without it → 401 curl -i http://localhost:8000/1.0.0/prod/ -H "X-API-Key: " ``` -------------------------------- ### Import Keycloak realm with kcadm.sh Source: https://mcpblaze.com/docs/migrate Use this command to import the pre-filled Keycloak realm from the export. After running it, you must set each identity provider's client secret and import your users from the SCIM 2.0 file in the Keycloak admin console. ```bash # import the realm kcadm.sh create realms -f auth/keycloak-realm.json # then, in the Keycloak admin console: # 1. set each identity provider's client secret (register your own OAuth app) # 2. import your users from tenants//users/scim/users.json (SCIM 2.0) ``` -------------------------------- ### Publish an MCP server with npx apiblaze agent mcp Source: https://mcpblaze.com/docs Publish a proxy as a Model Context Protocol server using the apiblaze agent mcp command. The resulting server address follows the pattern {project}-{tenant}.mcp.apiblaze.com/{version}/{environment}. Access is OAuth-gated and tools speak real MCP over JSON-RPC 2.0. ```bash $ npx apiblaze agent mcp acme you › expose search + order lookup as tools agent › search_products(q, limit) get_order(order_id) /publish ✓ Published MCP server — acme-acmecorp.mcp.apiblaze.com/1.0.0/prod ``` -------------------------------- ### Run apichat with a target OpenAPI specification Source: https://mcpblaze.com/docs Executes the apichat command to create a live proxy and MCP server for the specified OpenAPI target. ```bash $ npx apiblaze apichat --target https://apiblaze.com/pokeapi_openapi.yaml ✓ proxy live → https://pokeapi4821.tryabz.run/1.0.0/prod ✓ MCP server → pokeapi4821.mcp.apiblaze.com you › what types is ditto? agent › GET /api/v2/pokemon/ditto … → Ditto is a Normal-type Pokémon. (the exact curl for every call is printed above each answer) ``` -------------------------------- ### Create proxy with custom Google OAuth provider Source: https://mcpblaze.com/docs Configures the developer portal to use a custom Google OAuth application. Supported providers include github, google, microsoft, facebook, and auth0. ```bash $ npx apiblaze create --target https://api.example.com \ --oauth '{"provider":"google","clientId":"xxxx.apps.googleusercontent.com","clientSecret":"GOCSPX-xxxx"}' # providers: github · google · microsoft · facebook · auth0 # advanced (token types, scopes, callback URLs): use the curl tab or --config ``` -------------------------------- ### Enforce access policy with npx apiblaze rule Source: https://mcpblaze.com/docs/full-test-project Run this command to enforce the access policy described in plain English. It creates a rule on the specified proxy that restricts access to reservations and the full reservations list, leaving other routes open. The --enforce flag applies the rule immediately. ```bash npx apiblaze rule "Bookings belong to whoever makes them. A reservation may be opened by its owner or by members of the existing group \"reservationists\". The full reservations list is for \"reservationists\" only. Leave every other route open." --enforce ``` -------------------------------- ### Create chat server route with createApiblazeChat Source: https://mcpblaze.com/docs/widgets Server route for the chat widget using NextAuth / Auth.js v5. It holds the proxy key, calls your getUser to identify the signed-in user, and exports the handler as POST. Return null from getUser when nobody is signed in to disable chat. ```typescript import { createApiblazeChat } from 'apiblaze/server'; import { auth } from '@/auth'; const chat = createApiblazeChat({ project: 'acme', // ① your proxy's name apiKey: process.env.APIBLAZE_CHAT_DP_KEY!, // ② an API key for that proxy getUser: async () => { const session = await auth(); if (!session?.user) return null; // signed out → no chat return { userId: session.user.id }; // ③ which person is chatting }, }); export const POST = chat.handler; ``` -------------------------------- ### npx apiblaze apichat — chat with an AI to configure an API Source: https://mcpblaze.com/docs Run this command in your terminal to add APIblaze as an MCP server to Claude Code or Codex. After it runs, you can ask your AI chatbot to create proxies, add logins, invite teammates, or point custom domains. Requires an account; `npx apiblaze login` is free and takes a few seconds. ```bash $ npx apiblaze apichat --target https://api.mcp.apiblaze.com/openapi.json ``` -------------------------------- ### Verify no-key request returns 401 on Kong Source: https://mcpblaze.com/docs/migrate Verify that a request without a key returns HTTP 401, exactly as it did on apiblaze. This confirms auth is enforced. ```bash # and with no key it still refuses — exactly like it did on apiblaze $ curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8000/1.0.0/prod/orders 401 ``` -------------------------------- ### Mint an API key for a specific user Source: https://mcpblaze.com/docs Issue an API key to a specific user so that all calls made with that key are attributed to them. ```bash npx apiblaze apikeys mint --tenant «nino» --for «alice@example.com» ``` -------------------------------- ### Set APIBLAZE_CP_KEY environment variable Source: https://mcpblaze.com/docs/widgets Set this environment variable in your .env file. Create a Widget key (not a full admin key) in the APIblaze Dashboard under Developers. The same key powers both the API key and Users & Groups widgets. ```plaintext APIBLAZE_CP_KEY=sk_prod_… ``` -------------------------------- ### Mount ChatWidget in a page Source: https://mcpblaze.com/docs/widgets Page component that mounts the ChatWidget. It renders a floating chat bubble by default and streams replies live from the given endpoint. The storageKey is per-user to keep transcripts separate on shared machines. ```tsx import { ChatWidget } from 'apiblaze/react'; export default function Page() { return ( ); } ``` -------------------------------- ### Curl your API on Kong with an existing consumer key Source: https://mcpblaze.com/docs/migrate Curl your API on Kong with a consumer key that was never re-issued. The response shows HTTP 200 with the consumer username and the order data. ```bash # ~3:10 your API, on your Kong — with a key you never re-issued $ curl -i http://localhost:8000/1.0.0/prod/orders -H "X-API-Key: ab_live_9f2c…" HTTP/1.1 200 OK Content-Type: application/json X-Consumer-Username: acme-corp {"orders":[{"id":"ord_8813","total":4200}]} ``` -------------------------------- ### Authenticate and call a locked API Source: https://mcpblaze.com/docs Log in as a consumer and use the generated access token to perform a request against a locked resource. ```bash $ TOKEN=$(npx apiblaze consumer login --tenant ninodefaulttenant >/dev/null && npx apiblaze consumer tokens --json | jq -r .access_token) $ curl https://nino.abz.run/1.0.0/dev/reservations -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### npx apiblaze agent Source: https://mcpblaze.com/docs General builder agent that writes configuration based on a description. It proposes changes, you review, then /publish. Billed per turn. ```APIDOC ## npx apiblaze agent ### Description General builder agent that writes configuration based on a description. It proposes changes, you review, then /publish. Billed per turn. ### Usage npx apiblaze agent ### Parameters None explicitly documented. ### Example $ npx apiblaze agent ```