Event Sources
An event source is a long-lived connection from FYAI to an external MCP server that pushes notifications — price ticks, build status, sensor readings, anything the server emits on its own. FYAI keeps the connection open, reconnects if it drops, and publishes every notification it receives as an event in your project.
In the app, event sources are called event transports.
Event sources, webhooks and data sources
| Direction | What it is for | |
|---|---|---|
| Event source | FYAI connects out to a server and listens | Live streams that feed data sources and agent context. |
| Webhook | An external system posts in to FYAI | Starting workflow runs from external events. |
| Data source | — | Accumulates rows for dashboards and agents. An Event Stream (live) data source is backed by an event source. |
Event sources don't start workflow runs. To start a workflow from an external event, use a webhook.
What uses the events
- Event Stream (live) data sources. Each event from the bound event source is added to the data source's rows (appended, upserted by key, or replacing the rows, as the data source is configured), and bound dashboards update. See Creating Data Sources.
- Chat agents. Agents in chat sessions in the same project see recent events — up to the latest 20 from the last 5 minutes — as context before each reply.
Create an event source
Event sources are created from the data source editor:
- Go to Resources → Data Sources and create a data source.
- Choose the connector Event Stream (live).
- Open Event transport and choose + New transport….
- Fill in the New Event Source dialog (fields below) and click Save.
The new transport is selected automatically. To change it later, select it and click the edit (pencil) button, Edit selected transport. Each transport is listed as "name — transport".
Fields
| Field | Description |
|---|---|
| Name | Required. Must be unique in the project. |
| Description | Optional. |
| Transport | WebSocket or Server-Sent Events (SSE). |
| URL | Required. For WebSocket, a ws:// or wss:// endpoint. For SSE, the server's HTTP endpoint. |
| Headers | SSE only. Key–value pairs sent with the connection. |
| Enabled | Clear it to stop FYAI connecting. |
The SSE transport connects using MCP's streamable HTTP transport.
The Transport list also offers Stdio (local process), but stdio event sources are no longer supported — FYAI won't run an MCP server process for you. Saving a stdio transport fails with "Failed to save event source." Host the server elsewhere and connect to it over WebSocket or SSE.
Connection behaviour
- FYAI connects to every enabled event source when its agent service starts, and keeps the connection open.
- New event sources, and changes to existing ones (including Enabled), are picked up the next time the agent service restarts — for example after a platform update — not immediately.
- If the connection fails, it retries, waiting longer each time (from 5 seconds up to 5 minutes between attempts).
- Each MCP notification from the server becomes an event whose type is the notification's method name. FYAI also emits
event_source.connectedandevent_source.errorevents of its own; data sources ignore these.
API and MCP
Event sources can also be managed through the API (/event-sources on the agent service: list, create, read, update, delete) and the Platform MCP server tools list_event_sources, create_event_source, get_event_source, update_event_source and delete_event_source. The API also accepts optional filter_rules.