apiblaze 0.21.79 → 0.21.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +51 -37
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__
34
34
  var version;
35
35
  var init_package = __esm({
36
36
  "package.json"() {
37
- version = "0.21.79";
37
+ version = "0.21.80";
38
38
  }
39
39
  });
40
40
 
@@ -15581,15 +15581,15 @@ brand: mcpblaze
15581
15581
  What is in this folder, the fastest way to an MCP server for it, and what comes after.
15582
15582
  ${olderCopiesSection(copies, brand)}
15583
15583
  ${folder}
15584
- ## The MCP server and its two links come first; everything else after
15584
+ ## Three phases: finish one, then ask before the next
15585
15585
 
15586
- 1. **Find the API.** None found above: look where the code keeps it (a frontend's API base URL, \`vercel.json\`,
15587
- \`render.yaml\`, the README); still none: ask the user for its address, or better, its OpenAPI spec URL, before anything else.
15588
- 2. **Ask once, then run it.** ${question} Add \`--compliant\` (\`--compliant all\` for Claude and ChatGPT) to \`create\` when a
15589
- listing is the goal; run \`dev\` as its own detached process (\`nohup ${run2} dev \u2026 > mcpblaze-dev.log 2>&1 < /dev/null &\`).
15590
-
15591
- Then, with the user: the listing, \`${run2} connector <name>\` (\`--compliant chatgpt\` or \`all\`), whose page link goes
15592
- to the user first; \`${run2} connector <name> --status\` says what is left. The pages below cover the rest.
15586
+ 1. **The MCP server and its two links.** No API found above: look where the code keeps it (a frontend's API base URL,
15587
+ \`vercel.json\`, \`render.yaml\`, the README); still none: ask the user for its address or its OpenAPI spec URL.
15588
+ ${question} Run \`dev\` as its own detached process (\`nohup ${run2} dev \u2026 > mcpblaze-dev.log 2>&1 < /dev/null &\`).
15589
+ A \`--name\` you pick gets four random characters (\`resiresi7k3x\`): names are global. Give the user both links, then stop.
15590
+ 2. **Ask: make it more useful?** Tools shaped around what people ask for, sign-in, who can do what: \`${run2} skills ship\`.
15591
+ 3. **Ask: list it in Claude and ChatGPT?** \`${run2} connector <name>\` (\`--compliant chatgpt\` or \`all\`), whose page
15592
+ link goes to the user first; \`${run2} connector <name> --status\` says what is left.
15593
15593
 
15594
15594
  ## What MCPblaze is
15595
15595
 
@@ -15640,41 +15640,48 @@ function shipMcpMarkdown() {
15640
15640
  const run2 = "npx mcpblaze@latest";
15641
15641
  return withLatest(`# An MCP server for their API, with MCPblaze
15642
15642
 
15643
- **Links first.** Make the MCP server before designing anything. A deployed API (a URL, or its spec's URL) goes straight
15644
- to step 4; steps 1\u20133 then tune what it made (\`mcp ops hide|show|set\`, \`mcp instructions set\`). Only an app on this
15645
- machine, or an API with no spec anyone can fetch, does 1\u20133 first.
15643
+ Three phases. Finish one, then ask the user before starting the next.
15644
+
15645
+ ## Phase 1: the MCP server and its two links
15646
+
15647
+ Deployed (a URL, or its spec's URL): \`${run2} create --target <spec or URL>\`. On this machine: \`${run2} dev --port <port>\`
15648
+ (\`--openapi <file>\` when there is a spec) as its own detached process (\`nohup ${run2} dev \u2026 > mcpblaze-dev.log 2>&1 < /dev/null &\`);
15649
+ the log says "is live on the internet" after about 20 seconds. A \`--name\` you pick gets four random characters
15650
+ (\`resiresi7k3x\`): names are global. Either prints the MCP server and Scorecard links and saves the key to \`.env.local\`
15651
+ itself; never show a key in the chat. Give the user both links, then ask: "Want to make it more useful?"
15652
+
15653
+ ## Phase 2: a more useful MCP
15646
15654
 
15647
15655
  1. **Read what is here.** The route files (every path and method, what each handler does, the id each POST returns), an
15648
15656
  existing \`openapi.yaml\` / \`openapi.json\` / spec route, env files, how the app is protected today (a header, a session,
15649
15657
  nothing). The code is the best source there is: it says what each route does better than any spec.
15650
- A frontend-only folder: find the backend's base URL it calls, then the same against that URL (a spec if it serves one;
15651
- \`dev\` captures the routes if not). A black box with no code and no spec: \`dev\` captures the routes nobody documented.
15658
+ A frontend-only folder: find the backend's base URL it calls, then the same against that URL.
15652
15659
  2. **Decide the jobs, then the tools \u2014 from the code** (\`${run2} skills mcp\` has the method): what a person would ask an
15653
15660
  agent for; the one or two operations per job; a dozen tools with verb names and descriptions that say what comes back
15654
15661
  and when to use each; the instruction; which writes need confirmation. For a spec URL, the same against the spec.
15655
- Explain your choices and show the first-pass draft catalogue before anything is written.
15656
- 3. **The spec, if there is none.** Write \`./openapi.yaml\` for the operations the design kept, with the descriptions already
15657
- written (operation \`summary\` = the tool title, \`description\` = the tool description). Nothing else goes in.
15658
- 4. **Make it.** Deployed: \`${run2} create --target <spec or URL>\` (add \`--compliant\` now if a listing is the goal,
15659
- \`--compliant all\` for Claude and ChatGPT).
15660
- On this machine: \`${run2} dev --port <port> --openapi ./openapi.yaml\` as its own detached process
15661
- (\`nohup ${run2} dev \u2026 > mcpblaze-dev.log 2>&1 < /dev/null &\`); the log says "is live on the internet" after
15662
- about 20 seconds. Either prints the MCP address and saves the key to \`.env.local\` itself; never show a key in the chat.
15663
- Then \`${run2} mcp catalogue show <name>\` and the \`mcp ops hide|show|set\` / \`mcp instructions set\` touches for what
15664
- the automatic catalogue did not get right (a spec with more operations than the design kept: hide the rest).
15665
- 5. **Sign-in.** Ask once: "Should agents sign in as your users, and where?" Their own OAuth app or OIDC issuer \u2192 the matching
15666
- \`--oauth\` shape printed by \`${run2} create --help\`; nothing of their own \u2192 the default GitHub sign-in. \`--apikey\`
15667
- alongside keeps a key door. Later changes: \`${run2} tenant\` (providers, app clients).
15668
- 6. **Who can do what.** \`${run2} rule <name>\` lists the record families the spec can lock to the person who created them
15662
+ Explain your choices and show the draft catalogue before anything is written.
15663
+ 3. **Apply it.** \`${run2} mcp catalogue show <name>\`, then \`mcp ops hide|show|set\` / \`mcp instructions set\` (a spec with
15664
+ more operations than the design kept: hide the rest). An app on this machine with no spec: write \`./openapi.yaml\` for
15665
+ the operations kept (\`summary\` = the tool title, \`description\` = the tool description) and restart \`dev\` with
15666
+ \`--openapi ./openapi.yaml\`.
15667
+ 4. **Sign-in.** Ask once: "Should agents sign in as your users, and where?" Nothing of their own: the GitHub sign-in it
15668
+ already has. Their own OAuth app or OIDC issuer: \`${run2} tenant\` (providers, app clients; \`${run2} create --help\`
15669
+ prints the \`--oauth\` shapes).
15670
+ 5. **Who can do what.** \`${run2} rule <name>\` lists the record families the spec can lock to the person who created them
15669
15671
  (one question, pre-approved families; \`--enforce\` turns it on, \`--off\` turns it off and keeps the rules). An admin
15670
15672
  who can override: the dashboard, Tenant \u2192 Admins.
15671
- 7. **Try it from Claude Code.** \`claude mcp add --transport http <name> <the MCP address it printed>\`, then \`/mcp\` and
15673
+ 6. **Try it from Claude Code.** \`claude mcp add --transport http <name> <the MCP address it printed>\`, then \`/mcp\` and
15672
15674
  sign in; call one tool. What a reviewer does, before a reviewer does it.
15673
- 8. **List it.** \`${run2} connector <name>\` (Claude; \`--compliant chatgpt\` or \`all\` for OpenAI's directory), unless the
15674
- create already ran with \`--compliant\`. Give the user the page link first, then follow \`${run2} skills connector\`: the MCP address (one CNAME; relay the exact record),
15675
- sign-in and the test account, the listing and the review-team answers that you write by its rules, the tests (one
15676
- \`claude -p\` per use case, from \`--status\`), and the packet. It needs the hosted app, not a tunnel. Stop any time;
15677
- \`${run2} connector <name> --status\` says what is left. The user submits the packet to Anthropic or OpenAI themselves.
15675
+
15676
+ Then ask: "Want it listed in Claude and ChatGPT?"
15677
+
15678
+ ## Phase 3: listed in Claude and ChatGPT
15679
+
15680
+ \`${run2} connector <name>\` (Claude; \`--compliant chatgpt\` or \`all\` for OpenAI's directory). Give the user the page link
15681
+ first, then follow \`${run2} skills connector\`: the MCP address (one CNAME; relay the exact record), sign-in and the test
15682
+ account, the listing and the review-team answers that you write by its rules, the tests (one \`claude -p\` per use case,
15683
+ from \`--status\`), and the packet. It needs the hosted app, not a tunnel. Stop any time;
15684
+ \`${run2} connector <name> --status\` says what is left. The user submits the packet to Anthropic or OpenAI themselves.
15678
15685
 
15679
15686
  Report what you did in plain words: the MCP address, who can sign in, what is locked, what is left on the scorecard.
15680
15687
 
@@ -23390,10 +23397,17 @@ async function runOpPerf(o = {}) {
23390
23397
  }
23391
23398
 
23392
23399
  // src/commands/op.ts
23393
- var OPERATOR_EMAILS = /* @__PURE__ */ new Set(["julienpmjacquet@gmail.com", "chkev@umich.edu"]);
23394
23400
  function isOperatorLogin() {
23395
- const email = loadCredentials()?.email?.toLowerCase();
23396
- return !!email && OPERATOR_EMAILS.has(email);
23401
+ const token = loadCredentials()?.accessToken;
23402
+ if (!token) return false;
23403
+ const part = token.split(".")[1];
23404
+ if (!part) return false;
23405
+ try {
23406
+ const claims = JSON.parse(Buffer.from(part, "base64url").toString("utf8"));
23407
+ return claims.isOperator === true;
23408
+ } catch {
23409
+ return false;
23410
+ }
23397
23411
  }
23398
23412
  var OP_COMMANDS = [
23399
23413
  { cmd: "cli-policy", blurb: 'Minimum CLI version the platform accepts (--min x.y.z --reason "\u2026" [--force], --reject-unversioned)' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apiblaze",
3
- "version": "0.21.79",
3
+ "version": "0.21.80",
4
4
  "description": "APIblaze CLI — Chat with your APIs, Manage your API keys, users and groups with the APIblaze serverless proxy",
5
5
  "keywords": [
6
6
  "apiblaze",