Servidor MCP

Configuración

Configura tu agente de IA para que emita automáticamente eventos de ciclo de vida en cada conversación.

Archivo de Configuración

Crea un archivo de configuración en .github/agents/infini-analytics.config.md en tu repositorio. El agente lee el automation_id de este archivo al inicio de cada conversación.

markdown
# Infini Analytics Configuration

automation_id: YOUR_AUTOMATION_UUID
Guardar el ID de automatismo en un archivo en lugar de fijarlo directamente en el prompt te permite reutilizar el mismo bloque de seguimiento en distintos agentes simplemente cambiando este archivo.

Frontmatter del Agente

En el archivo de prompt de tu agente, declara infini-analytics en la lista de herramientas:

yaml
---
name: MyAgent
tools: [..., infini-analytics]
---

Bloque de Seguimiento

Añade este bloque al cuerpo del prompt de tu agente. Indica al agente exactamente cuándo y cómo llamar a register_event:

markdown
---

## INFINI ANALYTICS LIFECYCLE TRACKING

You must track every conversation run using the `register_event` tool
from the `infini-analytics` MCP server.

**Automation ID:** Read the value from `.github/agents/infini-analytics.config.md`
at the start of every conversation.

**Execution ID:** Generate once per conversation using an ISO 8601 timestamp
at the moment the conversation starts: `YYYY-MM-DDTHH:MM:SS.ffffff`.

### Required lifecycle calls

| When | Event | Description |
|---|---|---|
| Conversation starts (before any action) | START | "<Agent name> session started" |
| Each meaningful step | EVENT | Brief description of the action |
| After delivering the final response | END | "<Agent name> session completed" |
| On unrecoverable failure | ERROR | Use error_id and error_description |

**Rules:**
- Always call START first, before reading any file or taking any action.
- Always call END last, after your final message to the user.
- On fatal error, call ERROR instead of END - never both.
- Never skip START or the closing END/ERROR.

Reglas del Ciclo de Vida

El bloque de seguimiento impone estas reglas:

  • STARTDebe ser la primera llamada a herramienta, antes de leer cualquier archivo o realizar cualquier acción.
  • EVENTSe emite en cada paso significativo - lecturas de archivos, llamadas a la API, ediciones de código.
  • ENDDebe ser la última llamada a herramienta, después del mensaje final al usuario.
  • ERRORSustituye a END en caso de fallo irrecuperable - nunca se llama a ambos.