| Servicio | URL / Endpoint | Estado | AcciΓ³n |
|---|---|---|---|
| Cargando... | |||
| Nombre | Tipo | DescripciΓ³n | ParΓ‘metros |
|---|---|---|---|
| Cargando... | |||
| ID | Proveedor | Modelo | Max tokens |
|---|
| ID | Base URL | Auth | Endpoints |
|---|
| ID | Transport | Endpoint / Comando |
|---|
Registrar cuenta bot en matrix.org
Crea una cuenta nueva (separada de la tuya personal). Usa un nombre como mi-bot.
O registrar en Synapse propio
register_new_matrix_user -c homeserver.yaml \ -u mi-bot -p TU_PASSWORD --no-admin \ http://localhost:8008
Verificar la cuenta
Inicia sesiΓ³n en app.element.io con la cuenta bot para confirmar que funciona.
MΓ©todo recomendado: API REST
curl -XPOST 'https://matrix.org/_matrix/client/v3/login' \
-H 'Content-Type: application/json' \
-d '{
"type": "m.login.password",
"user": "@mi-bot:matrix.org",
"password": "TU_PASSWORD"
}'
Copia el valor de access_token de la respuesta.
Verificar el token
curl 'https://matrix.org/_matrix/client/v3/account/whoami' \ -H 'Authorization: Bearer syt_TU_TOKEN'
Debe responder con tu user_id. Error 401 = token invΓ‘lido.
Alternativa: desde Element
ConfiguraciΓ³n β Seguridad y privacidad β Tokens de acceso β Mostrar token
Editar .env en la raΓz del proyecto
MATRIX_HOMESERVER_URL=https://matrix.org MATRIX_ACCESS_TOKEN=syt_tu_token_real MATRIX_USER_ID=@mi-bot:matrix.org ANTHROPIC_API_KEY=sk-ant-xxxxx PORT=9099
Reiniciar el bot
DespuΓ©s de editar .env, reinicia para que tome los cambios:
pm2 restart matrix-ai-bots
O usa el botΓ³n "Reiniciar bot" del dashboard.
Validar con diagnΓ³stico
Ve a la secciΓ³n DiagnΓ³stico y ejecuta los checks.
Invitar al bot a una sala
En Element, crea una sala o usa una existente. Invita al bot por su User ID. Con autoJoin: true acepta automΓ‘ticamente.
Primer comando
!ping
El bot debe responder Pong! π’
Mensajes directos (DM)
Abre un DM con el bot. En DMs no necesitas prefijo β cualquier mensaje se procesa directamente por el orquestador.
| !ping | Verifica que el bot responde |
| !help | Lista todos los comandos disponibles |
| !ai <texto> | EnvΓa al orquestador (usa todos los agentes) |
| !agent <id> <texto> | Fuerza un agente especΓfico (ej: !agent analyst analiza esto) |
| !agents | Lista los agentes configurados |
| !tools | Lista herramientas disponibles (incluye MCP y APIs) |
| @bot <texto> | MenciΓ³n directa en cualquier sala |
Agregar en config.yaml
apis:
mi-api:
baseUrl: https://api.ejemplo.com/v1
auth:
type: bearer
tokenEnvVar: MI_API_TOKEN # var de entorno con el token
timeout: 10000
endpoints:
- name: listar_items
description: Lista items activos
method: GET
path: /items
queryParams: [status, limit]
- name: crear_item
description: Crea un nuevo item
method: POST
path: /items
Autorizar al agente
Agrega el nombre de la tool al allowedTools del agente en config.yaml:
agents:
- id: collector
allowedTools:
- api_mi-api_listar_items
- api_mi-api_crear_item
Servidor MCP local (stdio)
mcpServers:
filesystem:
transport: stdio
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/ruta/permitida"]
Servidor MCP remoto (HTTP)
mcpServers:
mi-mcp:
transport: http
url: https://mi-servidor.com/mcp
headers:
Authorization: "Bearer mi-token"
Las tools se descubren automΓ‘ticamente
Al arrancar, el bot conecta al servidor MCP y registra todas sus tools como mcp_<id>_<toolname>. AparecerΓ‘n en la secciΓ³n Herramientas con el badge mcp.
mcp_<id>_<tool> que los agentes pueden invocar
api_<id>_<endpoint> β asΓgnalas luego en Agentes