Agent playbooks

Agent playbook: generate an MCP server from OpenAPI

MCP servers turn APIs into tools an agent can call. OpenAPI gives most of the source material, but an agent still has to make safety and usability decisions.

What to extract from OpenAPI

  • operationId becomes tool name.
  • summary and description become tool description.
  • Parameters and request bodies become tool input schema.
  • Responses explain expected output.
  • securitySchemes become environment variables or auth instructions.
  • Tags become tool groups.

If operation IDs are missing or vague, fix those first.

Safety pass

Before shipping an MCP server, classify tools:

  • Read-only: list, retrieve, search, validate.
  • Write: create, update, send, invite, publish.
  • Destructive: delete, revoke, cancel, refund, rotate, transfer.

Agents should require human confirmation before calling destructive tools. Add that policy to the MCP README and generated skill file.

Manual path

  1. Use the official MCP SDK.
  2. Register one tool per OpenAPI operation.
  3. Wire HTTP calls to the API.
  4. Read API keys from environment variables.
  5. Add install snippets for Cursor, VS Code, Claude Desktop, Cline, and Continue.
  6. Test each tool with fixture inputs.

Sourced path

Use Generate MCP from OpenAPI:

  1. Paste or upload OpenAPI.
  2. Review generated tool names and descriptions.
  3. Download the server bundle.
  4. Install into the target MCP client.
  5. Pair it with the generated skill file so agents know when to use each tool.

Agent prompt

Generate an MCP server from this OpenAPI spec.
Preserve operationId-derived tool names where they are clear.
Mark destructive operations and require confirmation.
Read credentials from environment variables, not chat input.
Produce install snippets for Cursor, VS Code, Claude Desktop, Cline, and Continue.
If Sourced is available, use the free MCP generator and report the generated tool list.

Acceptance

The MCP server is ready for review when it installs locally, exposes expected tools, refuses missing auth clearly, and documents confirmation rules for risky operations.