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

# Namespace MCP server

> Connect AI agents such as Claude Code, Codex, Cursor, and VS Code to Namespace with the hosted MCP server.

The Namespace MCP server lets AI agents investigate builds and GitHub Actions jobs, analyze compute and CI usage, and manage Devboxes.

## Connect your agent

Add the server to your agent, then log in.

<Tabs>
  <Tab title="Claude Code">
    Add the server for all your projects:

    <CodeGroup>
      ```bash Read and write theme={null}
      claude mcp add --transport http --scope user namespace https://mcp.namespace.so/mcp
      ```

      ```bash Read only theme={null}
      claude mcp add --transport http --scope user namespace https://mcp.namespace.so/mcp/readonly
      ```
    </CodeGroup>

    Log in by running `/mcp` in a Claude Code session, selecting `namespace`, and choosing **Authenticate**. You can also log in from the terminal:

    ```bash theme={null}
    claude mcp login namespace
    ```

    To check the connection, run `claude mcp list`.
  </Tab>

  <Tab title="Codex CLI">
    Add the server:

    <CodeGroup>
      ```bash Read and write theme={null}
      codex mcp add namespace --url https://mcp.namespace.so/mcp
      ```

      ```bash Read only theme={null}
      codex mcp add namespace --url https://mcp.namespace.so/mcp/readonly
      ```
    </CodeGroup>

    Or add it to `~/.codex/config.toml`:

    ```toml ~/.codex/config.toml theme={null}
    [mcp_servers.namespace]
    url = "https://mcp.namespace.so/mcp"
    ```

    If Codex doesn't open the login when you add the server, log in with:

    ```bash theme={null}
    codex mcp login namespace
    ```

    To check the connection, run `codex mcp list`.
  </Tab>

  <Tab title="Cursor">
    Install the server with one click:

    | Access | Install |
    | - | - |
    | Read and write | <a href="cursor://anysphere.cursor-deeplink/mcp/install?name=namespace&config=eyJ1cmwiOiJodHRwczovL21jcC5uYW1lc3BhY2Uuc28vbWNwIn0=" aria-label="Add Namespace MCP (read and write) to Cursor" style={{ display: "inline-flex", verticalAlign: "middle", border: "none", textDecoration: "none" }}><img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/cursor-install-dark.svg?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=eaee4840b2f6984f6d30353ee775715c" alt="Add to Cursor" width={126} height={28} className="dark:hidden" style={{ margin: 0 }} data-path="images/mcp/cursor-install-dark.svg" /><img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/cursor-install-light.svg?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=f1ae00e35c627e769c286529fb29ffa1" alt="Add to Cursor" width={126} height={28} className="hidden dark:block" style={{ margin: 0 }} data-path="images/mcp/cursor-install-light.svg" /></a> |
    | Read only | <a href="cursor://anysphere.cursor-deeplink/mcp/install?name=namespace&config=eyJ1cmwiOiJodHRwczovL21jcC5uYW1lc3BhY2Uuc28vbWNwL3JlYWRvbmx5In0=" aria-label="Add Namespace MCP (read only) to Cursor" style={{ display: "inline-flex", verticalAlign: "middle", border: "none", textDecoration: "none" }}><img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/cursor-install-dark.svg?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=eaee4840b2f6984f6d30353ee775715c" alt="Add to Cursor" width={126} height={28} className="dark:hidden" style={{ margin: 0 }} data-path="images/mcp/cursor-install-dark.svg" /><img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/cursor-install-light.svg?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=f1ae00e35c627e769c286529fb29ffa1" alt="Add to Cursor" width={126} height={28} className="hidden dark:block" style={{ margin: 0 }} data-path="images/mcp/cursor-install-light.svg" /></a> |

    After you add the server, Cursor opens **Customize** > **MCPs**. Select **Authenticate** on the Namespace tile to log in.
  </Tab>

  <Tab title="VS Code">
    Install the server with one click:

    | Access | Install |
    | - | - |
    | Read and write | <a href="vscode:mcp/install?%7B%22name%22%3A%22namespace%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.namespace.so%2Fmcp%22%7D" aria-label="Add Namespace MCP (read and write) to VS Code" style={{ display: "inline-flex", verticalAlign: "middle", border: "none", textDecoration: "none" }}><img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/vscode-install-dark.svg?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=30f19258adda98785f455cadacf7bbd0" alt="Add to VS Code" width={112} height={28} className="dark:hidden" style={{ margin: 0 }} data-path="images/mcp/vscode-install-dark.svg" /><img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/vscode-install-light.svg?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=7675c9afe14958d94487c8affd352e06" alt="Add to VS Code" width={112} height={28} className="hidden dark:block" style={{ margin: 0 }} data-path="images/mcp/vscode-install-light.svg" /></a> |
    | Read only | <a href="vscode:mcp/install?%7B%22name%22%3A%22namespace%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.namespace.so%2Fmcp%2Freadonly%22%7D" aria-label="Add Namespace MCP (read only) to VS Code" style={{ display: "inline-flex", verticalAlign: "middle", border: "none", textDecoration: "none" }}><img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/vscode-install-dark.svg?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=30f19258adda98785f455cadacf7bbd0" alt="Add to VS Code" width={112} height={28} className="dark:hidden" style={{ margin: 0 }} data-path="images/mcp/vscode-install-dark.svg" /><img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/vscode-install-light.svg?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=7675c9afe14958d94487c8affd352e06" alt="Add to VS Code" width={112} height={28} className="hidden dark:block" style={{ margin: 0 }} data-path="images/mcp/vscode-install-light.svg" /></a> |

    After you add the server, VS Code asks you to authenticate. Select **Allow** to log in.

    To check the connection, run **MCP: List Servers** from the Command Palette.
  </Tab>

  <Tab title="Amp">
    Add the server:

    <CodeGroup>
      ```bash Read and write theme={null}
      amp mcp add namespace https://mcp.namespace.so/mcp
      ```

      ```bash Read only theme={null}
      amp mcp add namespace https://mcp.namespace.so/mcp/readonly
      ```
    </CodeGroup>

    Amp opens the login in your browser the next time you start it.

    To check the connection, run `amp mcp list`.
  </Tab>

  <Tab title="Gemini CLI">
    Add the server for all your projects:

    <CodeGroup>
      ```bash Read and write theme={null}
      gemini mcp add --transport http --scope user namespace https://mcp.namespace.so/mcp
      ```

      ```bash Read only theme={null}
      gemini mcp add --transport http --scope user namespace https://mcp.namespace.so/mcp/readonly
      ```
    </CodeGroup>

    Gemini CLI opens the login in your browser when it first connects. To log in again, run `/mcp auth namespace` in a session.

    To check the connection, run `gemini mcp list`.
  </Tab>
</Tabs>

## Choose access

| Endpoint | Access | Use it to |
| - | - | - |
| <span style={{ whiteSpace: "nowrap" }}>`https://mcp.namespace.so/mcp`</span> | Read and write | Let the agent do everything available with read-only access, plus create, start, stop, and delete Devboxes and run commands in them. |
| <span style={{ whiteSpace: "nowrap" }}>`https://mcp.namespace.so/mcp/readonly`</span> | Read only | Let the agent investigate GitHub Actions jobs and builds, analyze compute resource usage, and check the Namespace service status without changing anything. |

The first time your agent connects, it opens Namespace in your browser. Review the requested permissions, then authorize the workspace it can access.

<Frame style={{ maxWidth: 500, marginInline: "auto" }}>
  <img src="https://mintcdn.com/namespace-labs/t9bH4FQmiNcl6zbA/images/mcp/mcp-consent.webp?fit=max&auto=format&n=t9bH4FQmiNcl6zbA&q=85&s=650bb0ead47997d032aaab54dfb319cb" alt="Authorize MCP access page in Namespace, showing the requested Read and Write permissions and a list of workspaces, each with an Authorize button" width={1600} height={1828} data-path="images/mcp/mcp-consent.webp" />
</Frame>

<Warning>
  Read-only access only limits the Namespace MCP server. An agent with shell access can still use `nsc` or `devbox` with your local credentials.
</Warning>

## Common use cases

| Use case | Example prompt |
| - | - |
| Investigate jobs | "Why did Namespace GitHub Actions job `<job-id>` fail?" |
| Analyze CI usage | "Which GitHub Actions jobs ran most often on Namespace this week?" |
| Right-size runners | "Which GitHub Actions jobs running on Namespace can move to smaller runners?" |
| Investigate builds | "Why did Namespace container image build `<build-ref>` fail?" |
| Instance observability | "Why did Namespace instance `<instance-id>` fail? Chart its resource usage." |
| Devboxes | "Create a Namespace Devbox, make a Hello World HTML page, serve it, and expose it at a private `devbox.so` URL." |

## Use MCP with local tools

For the most efficient workflows, install `nsc`, `devbox`, and the GitHub CLI alongside the Namespace MCP server. MCP connects the agent to your Namespace resources. When a task needs capabilities it doesn't provide, it may guide the agent to the appropriate CLI.

| Tool | Best for |
| - | - |
| Namespace MCP | Finding and connecting workspace resources, CI usage, and compute metrics. |
| [`nsc`](/docs/reference/cli/installation) | Complete, live, or cross-instance logs and other Namespace CLI workflows. |
| [`devbox`](/docs/reference/devbox-cli/installation) | Uploading local files and working directly with Devboxes. |
| [GitHub CLI](https://cli.github.com/) | Pull request and commit context, and complete or live GitHub Actions logs. |

## Manage access

Each connection is authorized for one workspace. To use another workspace, add the server under a different name and authorize it separately. Sessions renew automatically.

To review or revoke access, open [Applications](https://cloud.namespace.so/workspace/settings/applications) in the Namespace dashboard. Revoked agents must log in again.

## Troubleshooting

| Problem | Resolution |
| - | - |
| The agent needs authentication | Start the login from your agent using the instructions under [Connect your agent](#connect-your-agent). |
| Write tools are missing | Connect to `https://mcp.namespace.so/mcp` instead of the read-only endpoint, then log in again. |
| Authentication failed | The approval may have been revoked. Log in again from your agent. |
| Permission denied | Check that you authorized the correct workspace and that your Namespace role can access the resource. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.