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

# Uso con mcp-remote

> Conectar al MCP de Manglai usando el paquete mcp-remote

## ¿Qué es mcp-remote?

[mcp-remote](https://www.npmjs.com/package/mcp-remote) es un proxy que permite a clientes MCP que solo soportan **stdio** (como Claude Desktop, Cursor, Windsurf) conectarse a servidores MCP remotos vía **SSE** (Server-Sent Events).

## Uso directo

```bash theme={null}
npx mcp-remote https://mcp.manglai.io/sse --header "Authorization:Bearer TU_TOKEN"
```

## Configuración en Cursor

Archivo: `.cursor/mcp.json`

```json theme={null}
{
  "mcpServers": {
    "manglai": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.manglai.io/sse",
        "--header",
        "Authorization:Bearer ${MANGLAI_TOKEN}"
      ],
      "env": {
        "MANGLAI_TOKEN": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
      }
    }
  }
}
```

## Configuración en Claude Desktop

Archivo: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)

```json theme={null}
{
  "mcpServers": {
    "manglai": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.manglai.io/sse",
        "--header",
        "Authorization:Bearer ${MANGLAI_TOKEN}"
      ],
      "env": {
        "MANGLAI_TOKEN": "tu_token_aqui"
      }
    }
  }
}
```

## Variables de entorno

Para no hardcodear el token directamente:

```json theme={null}
"env": {
  "MANGLAI_TOKEN": "tu_token"
}
```

También puedes exportarlo en tu shell (macOS/Linux):

```bash theme={null}
export MANGLAI_TOKEN="eyJhbGciOiJIUzI1NiIs..."
```

## Nota sobre headers

Evita espacios alrededor del `:` en el header:

```bash theme={null}
# Correcto
"Authorization:Bearer token"

# Incorrecto (puede fallar en algunos clientes)
"Authorization: Bearer token"
```
