Skip to content

Document the management API and CLI with real examples: Swagger, CLI README, CLI guide - #1528

Merged
helpcodeai merged 5 commits into
mainfrom
docs/cli-readme-swagger-examples
Nov 5, 2026
Merged

helpcodeai merged 5 commits into
mainfrom
docs/cli-readme-swagger-examples

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

The developer docs for the CLI and the management API showed few real examples, and the Swagger description dated from the first release.

Swagger (/api/docs)

  • The setup moved to packages/backend/src/common/openapi.ts. The description now says what AnythingMCP is today and covers:
    • authentication with management keys and their scopes (MCP / MANAGEMENT_READ / MANAGEMENT_ADMIN);
    • a quick start with curl and the equivalent amcp api commands;
    • rate limits: 100/min per IP, 300/min per key;
    • error codes.
  • Uses the real version (APP_VERSION) instead of 0.1.0.
  • Declares all 34 tags the controllers use, each with a description. A new spec fails when a tag is undeclared or unused. Three untagged controllers now have a tag, and the stale AI/MCP tags are gone.
  • Key-capable controllers now carry @ApiSecurity('api-key'). Before, Swagger UI never offered the X-API-Key header on any operation.
  • Adds descriptions and request/response examples to the core endpoints: adapters, connectors, MCP servers (all three codeMode values), MCP keys, roles, audit and users.
  • No runtime or validation changes.
  • operations.ts is regenerated. The only change is the shorter summary of the server activity route.

CLI README (packages/cli, also shown on npm)

  • Adds a banner and a code-mode image. Both are PNGs rendered from editable HTML in packages/cli/assets/, linked by absolute raw.githubusercontent.com/.../main/ URLs so npm can show them. They resolve once this is on main.
  • Adds npm badges, a contents list and recipes with real commands and output:
    • tool calls with real arguments;
    • jq and cron pipelines (late orders to Slack);
    • a code_execute program that loops over Shopify order pages and joins HubSpot;
    • workspace bootstrap;
    • OpenAPI import;
    • audit queries.
  • Keeps the full command reference, now in tables.
  • Sharpens the npm description and keywords.

Guide content/guides/{en,de,it}/anythingmcp-cli.mdx

  • Rewritten with the same worked examples. The website copy is updated in the matching website PR.

Merge order

This overlaps with #1525 (CLI 0.1.3): packages/cli/README.md, packages/cli/package.json, generated/operations.ts and connectors.controller.ts. Merge #1525 first. I'll then rebase this branch, carry the 0.1.3 behaviour (--version, the new 401/403 messages, the [admin] tag semantics) into the rewritten README, and regenerate operations.ts.

Test plan

  • npm run build in packages/backend
  • OpenAPI document rendered in Nest preview mode: 220 paths, 34 tags; it validates as OpenAPI 3.0 with @apidevtools/swagger-parser
  • Jest (--maxWorkers=4) on 32 related suites: 547 passed, including the new common/openapi.spec.ts
  • npm test in packages/cli: 21 passed, 2 skipped; npm run build -w packages/cli
  • node scripts/generate-cli-operations.mjs --check: up to date (204 operations)
  • Guides render on the website dev server (en/it/de)
  • Check /api/docs on Cloud after deploy. The Support and Cron tags only load on Cloud/Enterprise, so the local render couldn't show them.

Deployment modes

Cloud and self-hosted get the same document. Self-hosted operators see the self-hosted base URL (http://localhost:4000) in the description.

@helpcodeai
helpcodeai requested a review from D3nisty as a code owner November 5, 2026 09:36
@helpcodeai
helpcodeai force-pushed the docs/cli-readme-swagger-examples branch from 649a7ce to c8c9bac Compare November 5, 2026 09:42
…, examples

Move the Swagger setup to common/openapi.ts. The description now says
what AnythingMCP is today and covers authentication with management
keys and their scopes, a curl and amcp quick start, rate limits and
errors. Use the real version instead of 0.1.0, declare every tag the
controllers use (a spec fails on undeclared or unused tags), offer the
X-API-Key scheme on key-capable routes, and add descriptions and
request/response examples to the core adapters, connectors, MCP server,
key, role, audit and user endpoints. No runtime behaviour changes.
Add a banner and a code-mode image (HTML sources in packages/cli/assets),
npm badges, a contents list, and recipes with real commands and output:
tool calls, jq and cron pipelines, a code_execute program that loops
over Shopify orders and joins HubSpot, workspace bootstrap, OpenAPI
import and audit queries. Keep the full command reference. Sharpen the
npm description and keywords.
@helpcodeai
helpcodeai force-pushed the docs/cli-readme-swagger-examples branch from c8c9bac to 96547d7 Compare November 5, 2026 10:20
@helpcodeai
helpcodeai enabled auto-merge (squash) November 5, 2026 10:20
@helpcodeai
helpcodeai merged commit 2109762 into main Nov 5, 2026
14 checks passed
@helpcodeai
helpcodeai deleted the docs/cli-readme-swagger-examples branch November 5, 2026 10:34
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant