Skip to main content
Glama
comunidad-pro-tech-mcp

comunidad-pro-tech-mcp

by LuciferEwah
README.md
# comunidad-pro-tech-mcp

Servidor MCP local (`stdio`) oficial para conectar **Comunidad Pro Tech** en cualquier cliente de IA (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Codex CLI, opencode, Gemini CLI, Zed, Antigravity).

Disponible en **Node.js (`npx` / npm)** y **Python (`uvx` / `pip`)** con **cero dependencias externas**.
Soporta **OAuth 2.1 con vigencia de 15 días** (abre el navegador para iniciar sesión con Google/email y renueva solo; cada 15 días pide re-login automáticamente) o **token Bearer** (`COMUNIDAD_API_TOKEN`).

---

## Instalación y login rápido (OAuth 2.1 · cada 15 días)

No necesitas copiar tokens si no quieres: al iniciar por primera vez (o con `--login`) abre tu navegador en Comunidad Pro Tech, autorizas el condominio y guarda la sesión localmente en `~/.config/comunidad-pro-tech-mcp/tokens.json` (`0600`).

### Opción A — Node.js (`npx`)
```bash
# Login explícito en navegador (opcional: también se abre solo al primer uso)
npx -y github:LuciferEwah/comunidad-pro-tech-mcp --login

# O una vez publicado en npm:
npx -y comunidad-pro-tech-mcp --login
```

### Opción B — Python (`uvx` / `pip`, Python >= 3.10)
```bash
# Login explícito en navegador con uvx directo desde GitHub:
uvx --from git+https://github.com/LuciferEwah/comunidad-pro-tech-mcp.git comunidad-pro-tech-mcp --login

# O instalando con pip:
pip install "git+https://github.com/LuciferEwah/comunidad-pro-tech-mcp.git"
comunidad-pro-tech-mcp --login
```

*(Para cerrar sesión local: `--logout`.)*

---

## Cómo conectarlo en tu cliente MCP

Si omites `COMUNIDAD_API_TOKEN`, usará **OAuth 2.1 (15 días)**. Si prefieres token fijo, agrega `"env": { "COMUNIDAD_API_TOKEN": "cpt_live_TU_TOKEN" }`.

### Claude Desktop / Cursor / Windsurf

Con **Node.js (`npx`)** (OAuth automático cada 15 días):
```json
{
  "mcpServers": {
    "comunidad-pro-tech": {
      "command": "npx",
      "args": ["-y", "github:LuciferEwah/comunidad-pro-tech-mcp"]
    }
  }
}
```

Con **Python (`uvx`)** (OAuth automático cada 15 días):
```json
{
  "mcpServers": {
    "comunidad-pro-tech": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/LuciferEwah/comunidad-pro-tech-mcp.git",
        "comunidad-pro-tech-mcp"
      ]
    }
  }
}
```

### Claude Code
```bash
# Remoto directo con OAuth 2.1 (sin npx ni Python):
claude mcp add --transport http comunidad-pro-tech https://app.comunidad-pro-tech.com/api/mcp

# Local stdio con Node.js (OAuth 15 días):
claude mcp add comunidad-pro-tech -- npx -y github:LuciferEwah/comunidad-pro-tech-mcp

# Local stdio con Python (OAuth 15 días):
claude mcp add comunidad-pro-tech -- uvx --from git+https://github.com/LuciferEwah/comunidad-pro-tech-mcp.git comunidad-pro-tech-mcp
```

### VS Code (`.vscode/mcp.json`)
```json
{
  "servers": {
    "comunidad-pro-tech": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/LuciferEwah/comunidad-pro-tech-mcp.git",
        "comunidad-pro-tech-mcp"
      ]
    }
  }
}
```

### Codex CLI (`~/.codex/config.toml`)
```toml
[mcp_servers.comunidad-pro-tech]
command = "uvx"
args = ["--from", "git+https://github.com/LuciferEwah/comunidad-pro-tech-mcp.git", "comunidad-pro-tech-mcp"]
```

---

## Opciones de CLI y variables de entorno

| Flag | Variable de entorno | Descripción |
|---|---|---|
| `--login` | — | Inicia sesión OAuth 2.1 en el navegador (vigencia absoluta: 15 días) |
| `--logout` | — | Elimina la sesión OAuth guardada en `~/.config/comunidad-pro-tech-mcp/tokens.json` |
| `--token <token>` | `COMUNIDAD_API_TOKEN` | Token Bearer fijo opcional (`cpt_live_...`) en lugar de OAuth |
| `--url <url>` | `COMUNIDAD_API_URL` | Endpoint MCP remoto (default: `https://app.comunidad-pro-tech.com/api/mcp`) |
| `--codemode` | `COMUNIDAD_MCP_MODE=codemode` | Activa Code Mode (`search_tools` + `execute_code`) |
| `--info` | — | Imprime el catálogo público (`GET` sin auth) y termina |

---

## Seguridad y flujo de escritura en dos pasos

- Los refresh tokens OAuth 2.1 expiran de forma absoluta a los **15 días** desde el login (las rotaciones conservan esa fecha tope), exigiendo re-autenticación cada 15 días.
- Todas las herramientas de escritura operan en **dos pasos**: `dryRun: true` (default) devuelve `preview` + `confirmationToken`, y se ejecuta repitiendo con `dryRun: false` + ese token (de un solo uso).

Documentación completa de la API: https://app.comunidad-pro-tech.com/docs/api