MCP for AI agents

InfraBuffet provides a Model Context Protocol endpoint at /mcp. MCP clients can discover and use the same protected infrastructure and administration operations as the REST API without exposing a separate tool for every route.

Create a token

Create an API token through API tokens in the user menu, as described in API access and tokens. Copy the secret when it is shown. Any token can discover operations and read data. Changing objects requires the write grant; scheduling diffs, imports and syncs or cancelling jobs requires workflows; applying a reviewed plan requires apply. Tokens cannot be created, listed, read, or revoked through MCP.

Configure a client

Add InfraBuffet as a Streamable HTTP server at https://ibf.example.com/mcp and pass the token as a bearer credential. If your configuration uses IBF_TOKEN, export it before starting your client.

Register the server from the command line:

export IBF_TOKEN=<your token>
claude mcp add --transport http ibf https://ibf.example.com/mcp \
  --header "Authorization: Bearer $IBF_TOKEN"

Or commit a project-scoped .mcp.json. Claude Code expands ${IBF_TOKEN} when it starts, so the secret stays out of the file:

{
  "mcpServers": {
    "ibf": {
      "type": "http",
      "url": "https://ibf.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${IBF_TOKEN}"
      }
    }
  }
}

Run /mcp inside Claude Code to check that ibf is connected.

Choose one of these configurations for ~/.codex/config.toml.

Read the token from IBF_TOKEN

[mcp_servers.ibf]
url = "https://ibf.example.com/mcp"
bearer_token_env_var = "IBF_TOKEN"

Set the token directly in the config file

Replace <your token> with your InfraBuffet API token.

[mcp_servers.ibf]
url = "https://ibf.example.com/mcp"
http_headers = { Authorization = "Bearer <your token>" }

Run codex mcp list to confirm the server is registered, or /mcp inside a Codex session to see its tools.

Add a remote server to opencode.json in your project, or to ~/.config/opencode/opencode.json for all projects. OpenCode substitutes {env:IBF_TOKEN} from the environment:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "ibf": {
      "type": "remote",
      "url": "https://ibf.example.com/mcp",
      "enabled": true,
      "headers": {
        "Authorization": "Bearer {env:IBF_TOKEN}"
      }
    }
  }
}

Run opencode mcp list to check the connection.

Add the server to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for all projects. Cursor expands ${env:IBF_TOKEN}:

{
  "mcpServers": {
    "ibf": {
      "url": "https://ibf.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:IBF_TOKEN}"
      }
    }
  }
}

Open Settings → Tools & MCP and make sure ibf is enabled.

Other clients use a similar shape: a Streamable HTTP URL plus an Authorization: Bearer header. Consult your client’s documentation for environment-variable expansion and secret storage. Use HTTPS and do not commit the token. MCP does not accept browser session cookies.

Discover and execute operations

The server has four tools:

  1. ibf_search finds operation IDs by purpose, entity, action, route, or keyword. For a route shared by several operations, include the HTTP method, for example GET /api/teams/42/members.
  2. ibf_describe returns the operation’s path, query and body schemas, plus workflow notes.
  3. ibf_execute accepts {operation, id?, query?, body?}. id is the route’s single path ID; query filters accept scalar values or arrays, and body uses the same JSON fields as REST.
  4. ibf_docs lists or reads guides. Topics include form fields, block validation, dependencies, multiple providers, deduplicators, and permissions. Omit the topic to list them. Clients with resource support can read ibf://docs/<topic>.

Use small list pages and fetch details only when necessary. Domain and permission failures are tool errors carrying code, category, detail, and optional extra; invalid or revoked credentials fail the HTTP connection instead.

When a change is recorded in the audit log, the result also links to the changelog of the token owner at /admin/users/<id>/changelog, filtered to entries created since that change. The link names the owner, so it shows the token’s changes even when your browser is signed in as someone else; reading another user’s changelog requires a superuser, otherwise the page asks you to sign in as the owner. Agents are told to end a task that changed data with the link from its first change, so you can review everything they did in one place. Changes to users, teams, settings, saved filters and jobs are not audited and carry no link. The link uses IBF_PUBLIC_URL when the administrator set it, otherwise the address the agent connected to; see Configuration reference.

For infrastructure changes, read Provision → diff → apply. Calculate a diff, poll its job, review the result, and apply that exact plan. Do not treat scheduling a job as proof that it completed. See jobs and results for interruption and recovery guidance.