# MCP Server

> Connect Claude Code, Codex, OpenCode, Cursor, VS Code, and other MCP clients to Pyrite Cloud.

## Endpoint

```text
https://api.pyrite.cloud/mcp
```

Pyrite uses the **Streamable HTTP** transport.

## Authentication

Create a **Team API Key** in Pyrite Cloud and use it as a Bearer Token:

```http
Authorization: Bearer <TEAM_API_KEY>
```

We recommend storing your key in an environment variable:

```bash
export PYRITE_TOKEN="<TEAM_API_KEY>"
```

---

## Claude Code

Add Pyrite directly from the CLI:

```bash
claude mcp add --transport http pyrite https://api.pyrite.cloud/mcp \
  --header "Authorization: Bearer <TEAM_API_KEY>"
```

Verify the connection:

```bash
claude mcp list
```

Alternatively, create `.mcp.json`:

```json
{
  "mcpServers": {
    "pyrite": {
      "type": "http",
      "url": "https://api.pyrite.cloud/mcp",
      "headers": {
        "Authorization": "Bearer ${PYRITE_TOKEN}"
      }
    }
  }
}
```

---

## Codex

Add Pyrite from the CLI:

```bash
codex mcp add pyrite \
  --url https://api.pyrite.cloud/mcp \
  --bearer-token-env-var PYRITE_TOKEN
```

Verify:

```bash
codex mcp list
```

Alternatively, add it to `~/.codex/config.toml`:

```toml
[mcp_servers.pyrite]
url = "https://api.pyrite.cloud/mcp"
bearer_token_env_var = "PYRITE_TOKEN"
```

---

## OpenCode

Add Pyrite from the CLI:

```bash
opencode mcp add pyrite \
  --url https://api.pyrite.cloud/mcp \
  --header "Authorization=Bearer $PYRITE_TOKEN"
```

Verify:

```bash
opencode mcp list
```

Alternatively, add it to `opencode.jsonc`:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "pyrite": {
        "type": "remote",
        "url": "https://api.pyrite.cloud/mcp",
        "oauth": false,
        "headers": {
          "Authorization": "Bearer {env:PYRITE_TOKEN}"
        }
      }
    }
  }
}
```

---

## Cursor

Create `.cursor/mcp.json` in your project, or `~/.cursor/mcp.json` for a global configuration:

```json
{
  "mcpServers": {
    "pyrite": {
      "url": "https://api.pyrite.cloud/mcp",
      "headers": {
        "Authorization": "Bearer ${env:PYRITE_TOKEN}"
      }
    }
  }
}
```

Verify from the Cursor CLI:

```bash
agent mcp list
```

To view the available Pyrite tools:

```bash
agent mcp list-tools pyrite
```

---

## VS Code

Add Pyrite from the VS Code CLI:

```bash
code --add-mcp '{"name":"pyrite","type":"http","url":"https://api.pyrite.cloud/mcp","headers":{"Authorization":"Bearer ${env:PYRITE_TOKEN}"}}'
```

Alternatively, create `.vscode/mcp.json`:

```json
{
  "servers": {
    "pyrite": {
      "type": "http",
      "url": "https://api.pyrite.cloud/mcp",
      "headers": {
        "Authorization": "Bearer ${env:PYRITE_TOKEN}"
      }
    }
  }
}
```

You can also use the Command Palette:

```text
MCP: Add Server
```

To verify the connection:

```text
MCP: List Servers
```

---

## Other MCP Clients

Use the following connection details:

```text
Transport: Streamable HTTP
URL:       https://api.pyrite.cloud/mcp
Header:    Authorization: Bearer <TEAM_API_KEY>
```

Keep your Team API Key private and never commit it to source control.
