# MCP server

Source: https://docs.oiy.ai/docs/developers/mcp

Connect a compatible AI client to Oiy services, storage, and templates.



## Build locally [#build-locally]

Node.js 22 or later and a preview source checkout are required.

```sh
pnpm install
pnpm --filter @oiy-ai/mcp build
node packages/oiy-ai-mcp/dist/cli.js --help
node packages/oiy-ai-mcp/dist/cli.js --print-config
node packages/oiy-ai-mcp/dist/cli.js --doctor
```

The npm package is not yet published. Do not use `npx @oiy-ai/mcp` until a registry release is announced.

`--print-config` emits an entry with absolute Node/CLI paths and the API origin. It does not include your key or modify client files. Merge its `oiy-ai` entry into the existing server map; keep other entries intact. Regenerate it after moving the installation.

`--doctor` reads the catalog and identity endpoint with a ten-second timeout per request. It makes no resource mutations and does not print identity fields or credentials. A missing key returns exit code 1 for incomplete setup. Successful diagnostics do not prove GPU availability.

## Configure your client [#configure-your-client]

```json
{
  "mcpServers": {
    "oiy-ai": {
      "command": "node",
      "args": ["/absolute/path/computing-center/packages/oiy-ai-mcp/dist/cli.js"]
    }
  }
}
```

Replace the path with your local build. Use your client's environment or secret store to pass `OIY_API_KEY` to the child process. The optional `OIY_API_URL` must be an HTTPS origin, except for loopback development.

Desktop clients may not inherit terminal environment variables. Configure the key in the client’s environment or secret store and restart its MCP process.

The server uses stdio JSON-RPC. Catalog discovery works without a key; account operations require authentication.

## Available tools [#available-tools]

| Tool                                        | Purpose                                                                        |
| ------------------------------------------- | ------------------------------------------------------------------------------ |
| `oiy_catalog`                               | Regions, availability, pricing, starter templates                              |
| `oiy_templates` / `oiy_save_template`       | Read or save portable templates                                                |
| `oiy_billing`                               | Full-window summaries or bounded cursor-paginated ledger history               |
| `oiy_registries` / `oiy_save_registry`      | Read metadata or save pull access using local secret-environment references    |
| `oiy_account`                               | Balance and resource counts                                                    |
| `oiy_services`                              | Paginated services, detail, or `view=draft` with an ID                         |
| `oiy_rename_service`                        | Display-name update checked against `expectedName`                             |
| `oiy_create_service` / `oiy_update_service` | Create or revision-check configuration                                         |
| `oiy_service_action`                        | Start, stop, restart, resize                                                   |
| `oiy_sleep_policy`                          | Idle sleep configuration                                                       |
| `oiy_inspect_service`                       | Bounded events, activity, and logs                                             |
| `oiy_metrics`                               | Monitoring status, observed-sample statistics, and optional bounded history    |
| `oiy_exec`                                  | Bounded command execution                                                      |
| `oiy_storage`                               | Volume lifecycle, ownership, and charges                                       |
| `oiy_create_volume` / `oiy_update_volume`   | Create, rename, or expand independent storage                                  |
| `oiy_delete`                                | Delete a service, volume, template, or image-access entry with ID confirmation |

`oiy_save_template` accepts either `spec` or `source: { serviceId, revision, name?, description? }`. Source capture preserves configuration but does not copy secret values or files. [Service reuse guide](/docs/services/reuse).

The `oiy://guide` resource explains lifecycle and storage behavior.

## Review consequential actions [#review-consequential-actions]

Tools can allocate billable compute or delete data. An AI client should obtain your intent before spending or deleting. Tool annotations and confirmation IDs assist review but do not grant authority.

Every state-changing intent needs a unique `requestId` (8–128 characters). Use the same key only for the identical retry after inspecting state. The client never automatically retries mutations or commands.
