# Fiber AI — MCP Server

> Connect Fiber to AI agents via Model Context Protocol (Streamable HTTP).
> Three endpoints on this page: v2 (API key, top operations), v3 (OAuth/SSO,
> full coverage), and core (5 meta-tools). Full client setup, auth, and the
> smaller lite server: <https://docs.fiber.ai/build/mcp>

## Endpoints

| Name | URL | Auth |
| --- | --- | --- |
| V2 | `https://mcp.fiber.ai/mcp/v2` | API key |
| V3 | `https://mcp.fiber.ai/mcp/v3` | OAuth / SSO |
| Core | `https://mcp.fiber.ai/mcp` | API key |

**Claude / ChatGPT web:** start with **V3 + OAuth**.
**Cursor, Claude Code, Codex CLI, ChatGPT desktop:** **V2 + API key** is
usual; V3 when you want SSO.

## API key (V2 and Core)

Create one at <https://fiber.ai/app/api>, then:

```bash
export FIBER_API_KEY="YOUR_FIBER_API_KEY"
```

Pass it as header `x-api-key` (or `Authorization: Bearer`). OAuth is **V3
only** — do not point an OAuth / Sign-in flow at V2 or Core.

## Ask the agent (recommended for coding agents)

Paste into Cursor, Claude Code, or Codex CLI:

**V2:**

```text
Read https://docs.fiber.ai/build/mcp and install Fiber MCP V2 for this agent.
Authenticate with my Fiber API key in the MCP server config as a header
(x-api-key or Authorization: Bearer) — not as a one-off chat paste.
Ask me to paste the key from fiber.ai/app/api. Do not invent a key or leave
a placeholder in the config.
```

**V3:**

```text
Read https://docs.fiber.ai/build/mcp and install Fiber MCP V3 for this agent.
Use the OAuth server URL. I will sign in when the client asks.
```

## Claude and ChatGPT (web)

On <https://www.fiber.ai/mcp#mcp-connect> (V3 OAuth):

1. Claude: Settings → Connectors → Add custom connector →
   `https://mcp.fiber.ai/mcp/v3` → Connect / sign in.
2. ChatGPT: Settings → Plugins → enable Developer mode → Browse plugins →
   **+** → Server URL `https://mcp.fiber.ai/mcp/v3`, Authentication OAuth →
   Create → Connect.

ChatGPT **desktop** can use V2 with an `x-api-key` header (separate from
Codex CLI). Details in the docs.

## Quick install

### Cursor (V2)

Terminal (macOS):

```bash
open 'cursor://anysphere.cursor-deeplink/mcp/install?name=fiber-ai-v2&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLmZpYmVyLmFpL21jcC92MiJ9'
```

Then add `x-api-key` in **Cursor Settings → Customize → MCP**, use
`.mcp.json` below, or use Ask the agent above.

### Claude Code (V2)

```bash
claude mcp add --transport http fiber-ai-v2 https://mcp.fiber.ai/mcp/v2 \
  --header "x-api-key: $FIBER_API_KEY"
```

### Codex CLI (V2)

No `--header` flag. Use a bearer env var (Fiber accepts Bearer):

```bash
export FIBER_API_KEY="YOUR_FIBER_API_KEY"
codex mcp add fiber-ai-v2 --url https://mcp.fiber.ai/mcp/v2 \
  --bearer-token-env-var FIBER_API_KEY
```

### Gemini CLI (V2)

```bash
gemini mcp add --transport http \
  --header "x-api-key: $FIBER_API_KEY" \
  fiber-ai-v2 https://mcp.fiber.ai/mcp/v2
```

### OpenCode (V2, `opencode.json`)

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "fiber-ai-v2": {
      "type": "remote",
      "url": "https://mcp.fiber.ai/mcp/v2",
      "oauth": false,
      "headers": { "x-api-key": "{env:FIBER_API_KEY}" }
    }
  }
}
```

### VS Code (V2, `.vscode/mcp.json`)

```json
{
  "servers": {
    "fiber-ai-v2": {
      "type": "http",
      "url": "https://mcp.fiber.ai/mcp/v2",
      "headers": { "x-api-key": "${env:FIBER_API_KEY}" }
    }
  }
}
```

### All three servers (.mcp.json)

```json
{
  "mcpServers": {
    "fiber-ai-v2": {
      "type": "http",
      "url": "https://mcp.fiber.ai/mcp/v2",
      "headers": { "x-api-key": "${env:FIBER_API_KEY}" }
    },
    "fiber-ai-v3": {
      "type": "http",
      "url": "https://mcp.fiber.ai/mcp/v3"
    },
    "fiber-ai-core": {
      "type": "http",
      "url": "https://mcp.fiber.ai/mcp",
      "headers": { "x-api-key": "${env:FIBER_API_KEY}" }
    }
  }
}
```

## Canonical reference

- Setup guide (every client, API key vs OAuth, lite server): <https://docs.fiber.ai/build/mcp>
- Plugin (includes MCP config): <https://github.com/fiber-ai/fiber-ai-plugin>
- Official MCP registry (`ai.fiber/mcp`): <https://registry.modelcontextprotocol.io/?q=fiber>
- API routing: <https://api.fiber.ai/llms.txt>
