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

# Platform MCP

> Connect an MCP client to the Akua API with two tools: search the API, then run a short JavaScript program against it

The Akua MCP server lets your AI tool, such as Claude Code, Codex, Cursor or VS Code, use your Akua Workspace. It reaches the same public API the dashboard and the CLI use, with your own access and nothing more.

```text
https://mcp.akua.dev
```

> [!NOTE]
>
> Start with the [CLI](https://docs.akua.dev/agent-setup.md) when your coding agent sets Akua up for you.
> Add this server when you also want your AI tool to read and operate your
> Workspace through MCP. It is optional, and the CLI works without it.

## Connect a client

The Akua MCP server is `https://mcp.akua.dev`. It speaks the Streamable HTTP transport and signs
you in with OAuth: on first use your tool opens your browser, you sign in to Akua, and the tool
keeps the session.

For a coding agent in your terminal:

> [tab] Claude Code
>
> Add the server, then sign in from Claude Code with `/mcp` or from your shell:
>
> ```bash
> claude mcp add --transport http akua https://mcp.akua.dev
> claude mcp login akua
> ```
>
> Add `--scope user` to the first command to use Akua in every project.

> [tab] Codex
>
> Add the server and sign in:
>
> ```bash
> codex mcp add akua --url https://mcp.akua.dev
> codex mcp login akua
> ```
>
> Or add it to `~/.codex/config.toml` yourself, then run `codex mcp login akua`:
>
> ```toml
> [mcp_servers.akua]
> url = "https://mcp.akua.dev"
> ```

> [tab] opencode
>
> Add the server and sign in:
>
> ```bash
> opencode mcp add akua --url https://mcp.akua.dev
> opencode mcp auth akua
> ```
>
> In `opencode.jsonc` the same server is:
>
> ```json
> {
>   "$schema": "https://opencode.ai/config.json",
>   "mcp": {
>     "servers": {
>       "akua": {
>         "type": "remote",
>         "url": "https://mcp.akua.dev"
>       }
>     }
>   }
> }
> ```

> [tab] Antigravity
>
> In Antigravity CLI, type `/mcp` to open the MCP manager. To add Akua for every project, add
> it to `~/.gemini/config/mcp_config.json`:
>
> ```json
> {
>   "mcpServers": {
>     "akua": {
>       "serverUrl": "https://mcp.akua.dev"
>     }
>   }
> }
> ```
>
> Antigravity signs you in through your browser the first time it connects. Gemini CLI users
> on an enterprise license or a paid API key use the **Gemini CLI** tab.

> [tab] Gemini CLI
>
> Gemini CLI works with an enterprise license or a paid API key; everyone else uses
> **Antigravity**.
>
> Add the server for your user, then sign in from Gemini CLI:
>
> ```bash
> gemini mcp add --transport http --scope user akua https://mcp.akua.dev
> ```
>
> ```text
> /mcp auth akua
> ```
>
> In `~/.gemini/settings.json` the same server is:
>
> ```json
> {
>   "mcpServers": {
>     "akua": {
>       "httpUrl": "https://mcp.akua.dev"
>     }
>   }
> }
> ```

> [tab] Goose
>
> [Add Akua to Goose](goose://extension?url=https%3A%2F%2Fmcp.akua.dev&type=streamable_http&id=akua&name=Akua&description=Akua%20Workspace)
> with one click. In the terminal, run `goose configure`, choose **Add Extension**, then
> **Remote Extension (Streamable HTTP)**, and enter `https://mcp.akua.dev`.
>
> In `~/.config/goose/config.yaml` the same extension is:
>
> ```yaml
> extensions:
>   akua:
>     name: Akua
>     type: streamable_http
>     uri: https://mcp.akua.dev
>     enabled: true
>     timeout: 300
> ```
>
> Goose opens your browser to sign in the first time it connects.

> [tab] Amp
>
> Add the server:
>
> ```bash
> amp mcp add akua https://mcp.akua.dev
> ```
>
> Or add it to `amp.mcpServers` in your Amp settings:
>
> ```json
> {
>   "amp.mcpServers": {
>     "akua": {
>       "url": "https://mcp.akua.dev"
>     }
>   }
> }
> ```
>
> Amp opens your browser to sign in when it starts.

For an editor or IDE extension:

> [tab] VS Code
>
> In a Copilot chat session, run **Chat: Open Customizations**, select **MCP Servers**, then
> **Add Server**. Enter `https://mcp.akua.dev` and choose **Global** > **Copilot Global**.
>
> Or add Akua to `~/.copilot/mcp-config.json` (every workspace) or to `.mcp.json` at the root
> of your workspace:
>
> ```json
> {
>   "mcpServers": {
>     "akua": {
>       "type": "http",
>       "url": "https://mcp.akua.dev"
>     }
>   }
> }
> ```
>
> When Copilot offers it, sign in with **Authenticate** in the server's actions.

> [tab] Cursor
>
> [Add Akua to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=akua&config=eyJ1cmwiOiJodHRwczovL21jcC5ha3VhLmRldiJ9)
> with one click, or add it to `~/.cursor/mcp.json` (every project) or `.cursor/mcp.json`
> (one project):
>
> ```json
> {
>   "mcpServers": {
>     "akua": {
>       "url": "https://mcp.akua.dev"
>     }
>   }
> }
> ```
>
> Cursor asks you to sign in the first time it connects.

> [tab] Cline
>
> In the Cline extension, open **MCP Servers**, then **Remote Servers**. Enter `akua` as the
> name and `https://mcp.akua.dev` as the URL, choose Streamable HTTP, and click **Add Server**.
>
> In the Cline CLI, add it with one command:
>
> ```bash
> cline mcp add akua https://mcp.akua.dev --transport http --yes
> ```
>
> Or add Akua to `cline_mcp_settings.json`. Set `type` to `streamableHttp`; without it, Cline
> uses the older SSE transport:
>
> ```json
> {
>   "mcpServers": {
>     "akua": {
>       "type": "streamableHttp",
>       "url": "https://mcp.akua.dev"
>     }
>   }
> }
> ```
>
> In the Cline CLI, run `cline mcp` and choose **Authorize OAuth** to sign in. If the extension
> doesn't offer a sign-in, send an Akua API token as described under any other MCP client.

> [tab] Devin Desktop
>
> Devin Desktop is the new name for Windsurf. Add Akua for every project to
> `~/.config/devin/mcp_config.json`:
>
> ```json
> {
>   "mcpServers": {
>     "akua": {
>       "url": "https://mcp.akua.dev"
>     }
>   }
> }
> ```
>
> Then open **Customize** > **MCPs** in the Agents window. When Akua shows
> **Needs authentication**, click **Authenticate** to sign in.
>
> With the Devin CLI, add the server and sign in from the terminal instead:
>
> ```bash
> devin mcp add -s user akua https://mcp.akua.dev
> devin mcp login akua
> ```
>
> In the Windsurf plugins for JetBrains and VS Code, open Cascade's MCP settings and add the
> same server with `"serverUrl": "https://mcp.akua.dev"` instead of `url`.

> [tab] Zed
>
> Open **Settings** > **AI** > **MCP Servers**, click **Add Server**, choose
> **Add Remote Server** and enter `https://mcp.akua.dev`.
>
> Or add Akua to `context_servers` in your Zed `settings.json`:
>
> ```json
> {
>   "context_servers": {
>     "akua": {
>       "url": "https://mcp.akua.dev"
>     }
>   }
> }
> ```
>
> Zed asks you to sign in the first time it connects.

**Any other MCP client.** If your tool isn't listed, connect it to `https://mcp.akua.dev` with
the Streamable HTTP transport. Most clients accept this shape:

```json
{
  "mcpServers": {
    "akua": {
      "url": "https://mcp.akua.dev"
    }
  }
}
```

The server answers an unauthenticated request with `401` and an OAuth discovery challenge,
and it accepts dynamic client registration, so a client with MCP OAuth support signs you in
by itself. A client without OAuth can send an [Akua API token](https://docs.akua.dev/apis/authentication.md)
instead, in the header `Authorization: Bearer AKUA_API_TOKEN`.

The Claude Code, Codex and Cursor setups are also in the dashboard under Connect. The server treats every request on its own: it keeps no session between requests.

Every request carries `Authorization: Bearer <credential>`. The server accepts a signed-in user credential or an Akua API token, and it answers `401` with a `WWW-Authenticate` challenge when the credential is missing or rejected. To work in a specific Workspace, send its id in the `Akua-Context` header; the server passes it on to every API call a program makes.

## Tools

The server exposes exactly two tools. Both take one argument, `code`: a JavaScript program written as statements (not a function) that ends with `return`.

### `search`

Discover API operations as typed tools. Each match has the callable path and its TypeScript signature. `search` is read-only: it cannot call the API.

```js
// Find tools by keyword, then read their signatures
return await search({ query: "clusters" })
```

```js
// Browse one namespace
return await search({ namespace: "akua.clusters", limit: 20 })
```

### `execute`

Call the API. Every operation of the public API is an async function under `tools.akua`, and its path, query, header and body fields go in one object. Find the tool with `search` first, then call it. The built-in `search` is also available inside `execute`.

```js
// List the Workspaces you can use
return await tools.akua.workspaces.list({})
```

```js
// Chain calls: find a Workspace, then list its Clusters
const ws = await tools.akua.workspaces.list({})
const first = ws.data[0]
const clusters = await tools.akua.clusters.list({ "akua-context": first.id })
return { workspace: first.name, clusters: clusters.data }
```

A failed API call throws an error that names the HTTP status. Independent calls can run together with `Promise.all`.

## Why two tools

Most MCP servers register one tool per API endpoint, so the tool list grows with the API and fills the model's context. This server keeps the list at two. The agent writes a short program that finds operations, calls them, chains the results and filters the data, in one tool call. This pattern is called Code Mode or programmatic tool calling.

> [card] [CodeAct](https://machinelearning.apple.com/research/codeact)
>
> Apple ML research on LLM code generation for tool use

> [card] [Code Mode](https://blog.cloudflare.com/code-mode/)
>
> Cloudflare's introduction of the pattern

> [card] [Programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling)
>
> Anthropic's recommended approach

## How it works

Your AI tool

search, then execute
each sends a short program

Akua

Sandbox
runs it with memory and time limits

your credential

Akua

Akua API
checks access on every call

The tool catalog is built from the public API description, so a new API operation appears as a tool without a server change. The API checks access on the server for every call, as it does for the dashboard.

## Security

> [!WARNING]
>
> Programs run in an isolated sandbox with a memory limit and a time limit. They
> have no filesystem and no network, apart from the Akua API tools.

* **No credential access**: a program cannot read or set the `Authorization` header. Each call carries only the connected user's own credential, added by the server.
* **Code size**: a program may be up to 256 KB.
* **Memory**: 64 MB per run.
* **Time**: a run stops after at most 60 seconds.
* **Tool calls**: at most 50 API calls per run, up to 8 in flight at once.
* **Request body**: at most 1 MB per API call.
* **Output**: at most 24 KB of text goes back to the agent. Longer output is cut with a marker.

## Related topics

> [card] [Agent setup](https://docs.akua.dev/agent-setup.md)
>
> Start with the CLI and add this server when it helps.

> [card] [CLI](https://docs.akua.dev/cli.md)
>
> Install, sign in and run generated commands.

> [card] [Documentation MCP](https://docs.akua.dev/ai/docs-mcp.md)
>
> Search the Akua docs from your agent, without signing in.
