> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infragrid.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Give MCP-compatible agents nine bounded tools backed by Infragrid's public API.

`@infragrid/mcp` is a local stdio adapter for Infragrid's public REST API. It gives MCP-compatible agents a curated tool set without exposing databases, provider control planes, browser daemons, or internal stores.

The server uses the same workspace key, scopes, quotas, idempotency, and display-safe resources as the REST API and SDKs.

<Note>
  Version 0.1.0 is implemented in the source workspace and requires Node.js 20 or newer. The package is not yet represented as published to npm.
</Note>

## Configure after npm release

Add a stdio server to your MCP client:

```json theme={null}
{
  "mcpServers": {
    "infragrid": {
      "command": "npx",
      "args": ["-y", "@infragrid/mcp"],
      "env": {
        "INFRAGRID_API_KEY": "ig_live_..."
      }
    }
  }
}
```

## Run from a source checkout

<Steps>
  <Step title="Install and build">
    ```bash theme={null}
    npm ci
    npm run build --workspace @infragrid/sdk
    npm run build --workspace @infragrid/mcp
    ```
  </Step>

  <Step title="Point your MCP client at the built server">
    ```json theme={null}
    {
      "mcpServers": {
        "infragrid": {
          "command": "node",
          "args": [
            "/absolute/path/to/agentic-browser/packages/mcp/dist/stdio.js"
          ],
          "env": {
            "INFRAGRID_API_KEY": "ig_live_..."
          }
        }
      }
    }
    ```
  </Step>

  <Step title="Restart the client">
    Confirm that the Infragrid server connects and exposes the expected tools before asking the agent to run work.
  </Step>
</Steps>

## Tool catalog

| Tool                   | Key inputs                                                 | Required scope          | Behavior                                       |
| ---------------------- | ---------------------------------------------------------- | ----------------------- | ---------------------------------------------- |
| `list_blueprints`      | `limit?`                                                   | `blueprints:read`       | List active published Blueprints; read-only    |
| `get_blueprint`        | `blueprintId`                                              | `blueprints:read`       | Retrieve one display-safe Blueprint; read-only |
| `run_blueprint`        | `blueprintId`, `inputs?`, `revisionId?`, `idempotencyKey?` | `blueprints:run`        | Start a pinned Blueprint run                   |
| `list_blueprint_runs`  | `blueprintId?`, `limit?`, `cursor?`                        | `blueprint_runs:read`   | Cursor-page API-triggered runs; read-only      |
| `get_blueprint_run`    | `runId`                                                    | `blueprint_runs:read`   | Get status and safe outputs; read-only         |
| `cancel_blueprint_run` | `runId`                                                    | `blueprint_runs:cancel` | Idempotent, destructive cancellation           |
| `start_browser_task`   | `task`, `metadata?`, `idempotencyKey?`                     | `runs:write`            | Start one free-form browser task               |
| `get_browser_run`      | `runId`                                                    | `runs:read`             | Get one browser run; read-only                 |
| `cancel_browser_run`   | `runId`                                                    | `runs:write`            | Idempotent, destructive cancellation           |

## Example prompts

```text theme={null}
List the published Blueprints available to this workspace.

Run the account-review Blueprint for account_id acct_123,
pin its latest published revision, and use idempotency key
account-review-acct-123-v1. Then wait by checking the run status.

Start a browser task that opens example.com and summarizes the page.
Use idempotency key example-summary-v1.
```

## Operational behavior

* Protocol frames are written to stdout; diagnostics go to stderr.
* Successful calls return both JSON text and structured content.
* Tool output is capped at 256 KB.
* Public errors are flattened into bounded, display-safe MCP tool errors.
* `INFRAGRID_BASE_URL` should be set only for an explicitly selected development API.
* The adapter has no tool for draft Blueprint authoring or raw browser observations.

<Warning>
  The MCP server can start paid cloud work and cancel active runs. Give it only the scopes required for the tools you intend an agent to use, and keep client approval policies enabled for mutation tools.
</Warning>


## Related topics

- [Infragrid overview](/overview.md)
- [Versioning](/production/versioning.md)
- [Changelog](/changelog.md)
- [Limits](/production/limits.md)
- [API overview](/reference/overview.md)
