# Cyberbara MCP

Endpoint: `https://cyberbara.com/api/mcp`.
Transport: stateless Streamable HTTP, JSON responses. No SSE subscription or OAuth login.
Every POST requires a valid Cyberbara API key, including initialization and tool discovery.
Existing API account restrictions, moderation, rate limits, credit charging and task ownership checks apply.

Create a key at https://cyberbara.com/settings/apikeys. Keep keys in local client configuration; never commit them.

## Install with your agent

Send this sentence to an agent with access to your local client configuration:

> Install Cyberbara MCP for me: read https://cyberbara.com/mcp/setup.md, detect my agent client and preserve existing configuration, connect to https://cyberbara.com/api/mcp using my locally stored API key or guide me to enter it locally without exposing it in chat, logs or Git, then verify tool discovery and call list_models without starting paid generation.

### Agent installation steps

1. Detect the current client and its supported MCP configuration format. Read its current official instructions if needed. Preserve all existing servers and unrelated settings; update only the `cyberbara` entry, without duplicating it.
2. Prefer native Streamable HTTP with a custom Authorization header. Use the stdio bridge below if the client only supports local servers. OAuth-only connectors cannot connect directly; explain that limitation instead of inventing an OAuth flow.
3. Reuse a Cyberbara API key already stored in the user's local private configuration, without printing it. If unavailable, direct the user to https://cyberbara.com/settings/apikeys and ask them to enter it in their private local client configuration. Do not request keys in chat or embed real credentials in a command, repository, screenshot, or log.
4. Save the client-specific configuration in its private user configuration location, outside the project repository. Restrict file permissions to the user where supported. For the stdio bridge, verify Node.js and npx are available. Do not overwrite other MCP servers.
5. Reload MCP servers or tell the user to restart the client if required. Use the client's MCP tool discovery to verify all 9 tools appear. Call `list_models`; optionally `get_balance`. Never run paid generation as an installation test.
6. Report success only after tool discovery and the model call succeed. Otherwise report the exact pending local action, such as entering the key or restarting. Do not claim a placeholder configuration is a working connection.

## Cursor / HTTP clients

Add to your local MCP configuration:

```json
{
  "mcpServers": {
    "cyberbara": {
      "url": "https://cyberbara.com/api/mcp",
      "headers": { "Authorization": "Bearer <your_api_key>" }
    }
  }
}
```

For local development replace the URL with `http://localhost:3000/api/mcp`.
Clients must support custom Bearer headers. OAuth-only connectors cannot connect directly.

## Claude Desktop / stdio clients

For clients requiring stdio, use an HTTP bridge (Node.js required):

```json
{
  "mcpServers": {
    "cyberbara": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://cyberbara.com/api/mcp",
        "--header",
        "Authorization:${CYBERBARA_AUTH_HEADER}"
      ],
      "env": { "CYBERBARA_AUTH_HEADER": "Bearer <your_api_key>" }
    }
  }
}
```

## Tools

| Tool             | Purpose                                                                     |
| ---------------- | --------------------------------------------------------------------------- |
| `list_models`    | Models, scenes and model options; optional `media_type`                     |
| `get_balance`    | Credit balance                                                              |
| `quote_credits`  | Estimate cost: `model`, `media_type`, optional `prompt`, `scene`, `options` |
| `generate_image` | Create image task                                                           |
| `generate_video` | Create video task                                                           |
| `generate_audio` | Create sound task                                                           |
| `generate_music` | Create music task                                                           |
| `get_task`       | Status and outputs for your `task_id`                                       |
| `create_upload`  | Signed PUT upload: `media_type`, `fileName`, `contentType`, `size` in bytes |

Generation accepts `model`, optional `prompt`, `scene`, `options`; required options depend on the model.
Discover models, quote, obtain spending approval, then generate once. Poll `get_task` at least 2 seconds apart.
Never retry a failed generation blindly: it may have created a task and charged credits.
`create_upload` only returns upload instructions. PUT actual bytes using the returned URL and headers, then use the asset URL in model options.
