Skip to main content

Tools from an OpenAPI definition

If a service has a REST API described by an OpenAPI definition but no MCP server, Breign can generate agent actions from that definition: one action per API operation, which you choose.

Before you start​

  • You need the Create a tool permission.
  • You need the API's OpenAPI 3.0 or 3.1 definition, in JSON or YAML: its address, a file, or its text. Swagger 2.0 isn't supported.
  • If the API needs authentication: a token, or the right to create an OAuth application at the provider.

Steps​

  1. On the Tools page, click Add a tool, then OpenAPI API.
  2. Provide the OpenAPI definition: URL, File or Paste. Click Analyze. Breign reports how many actions it found, read and write.
  3. Check the Base URL: where calls are sent. Change it for a self-hosted instance.
  4. Choose the authentication. Breign marks the method it Detected in the definition:
    • None: the API is public;
    • Bearer token;
    • Header: a header name and value;
    • OAuth 2: create an OAuth application at the provider with the Redirect URI shown, then enter its client ID and secret. The requested scopes are listed.
  5. Choose the scope: one organization token shared by everyone, or a personal connection where each user connects their account (Connect my account) or enters their own token (Save my token). See Shared or personal connection.
  6. Choose actions: tick the operations agents may call. Read only keeps only reading operations, a safe start.
  7. Click Create. You see "OpenAPI tool created".

Then link the tool to your agents. See Equip your agent.

Update when the API changes​

Open the tool and click Import the definition again. Breign shows what changed; new actions are not allowed until you tick them. Click Update.

If something goes wrong​

  • "Swagger 2.0 is not supported…": convert the definition to OpenAPI 3 first.
  • "The definition is larger than the maximum size (2 MiB).": keep only the operations you need.
  • "…external $ref: bundle it into one file.": the definition references other files. Bundle it into a single file.
  • "The definition URL points to a private address.": Breign can't fetch definitions from your private network. Upload the file or paste it instead.
  • "The definition declares no OAuth 2 (authorizationCode flow).": choose another authentication method, or complete the definition.
  • "Tool created, but the OAuth 2 setup failed…": open the tool and check the client ID, secret and redirect URI.