MCP server
Santati exposes the audit-trail domain — the same trails and events the REST API serves — as a Model Context Protocol (MCP) server at https://santati.io/mcp. It speaks MCP Streamable HTTP, so hosted agent clients such as Claude Code, Cursor and Lovable can create trails, append events to them, and read back what landed using six tools and two prompts. For Lovable specifically, see Lovable.
Authentication
Every request carries a team API key as a bearer token:
Authorization: Bearer sat_sk_...
The key's scope and trail restrictions apply here with one difference from the REST API: append_events
publishes through the ingest pipeline and so requires a manage-scope key, while POST /api/v0/events/ also
accepts a write key.
| Operation | Key required |
|---|---|
Reading (get_access_info, list_trails, get_events, describe_event_envelope) | Any team API key. |
Creating trails (create_trail) | A manage-scope key that is not limited to specific trails. |
Emitting events (append_events) | A manage-scope key, even though a write key may emit over REST; a key limited to specific trails may only append to those. |
Mint one in the app under Audit Log → API keys.
Tools
| Tool | Parameters | Returns |
|---|---|---|
get_access_info | None. | The key's team, scope, whether it can manage trails, and which trails it may use. |
list_trails | None. | Each trail's name, its ingest_url, indexed_event_count and last_event_at. |
create_trail | name | The trail's name, ingest_url, and created (false when the trail already existed). |
append_events | trail, events | trail, accepted, event_ids, and an indexing marker. |
get_events | trail, event, organization_id, actor_id, occurred_after, occurred_before, limit | events, returned, has_more. |
describe_event_envelope | None. | The event envelope this server emits and indexes: fields, meanings, and the idempotency rule. |
create_trail accepts letters, digits, - and _, 1–64 characters. Creating a trail that already exists is not an error: the existing trail comes back with created set to false.
Each entry in append_events's events list is an object:
| Field | Meaning |
|---|---|
event | Required. The action name, e.g. invoice.voided. |
data | Your payload, stored as sent. |
actor | {"type": "user", "id": "...", "name": "..."}; type is user, system, agent or anonymous. |
organization_id | Your own end-customer id. |
targets | [{"object": "invoice", "id": "inv_555"}]. |
created_at | Event time; defaults to now (UTC). |
id | Client-generated idempotency key; a ULID is generated when empty. Re-sending the same id never indexes a second event. |
All get_events filters are optional; they narrow by trail, exact event name, organization id, actor id, and event time, and match the REST API's semantics. get_events reads newest first.
Prompts
| Prompt | Returns |
|---|---|
setup_audit_logging | The Lovable setup prompt with this deployment's API URL: store the key as a secret, record events through @santati/node or the HTTP API, leave an audit rule in AGENTS.md. |
add_activity_panel | The activity-panel prompt: an Activity side panel that reads the app's events back, scoped by tenant and role. |
Clients that list prompts (Claude Code, Cursor) can insert them directly; Lovable's chat connectors expose a server's tools, so in Lovable paste the prompt from the setup page or import the skill instead.
Limits
| Limit | Value |
|---|---|
Events per append_events call | 200. Split larger batches. |
| Size per event | 64 KiB. |
get_events limit | Defaults to 50, capped at 200. has_more says whether older events remain. |
A failure part-way through append_events reports how many events were already accepted before it. Re-sending the batch is safe when each event carries a stable id.
Client configuration
{"mcpServers": {"santati": {"url": "https://santati.io/mcp", "headers": {"Authorization": "Bearer sat_sk_…"}}}}
Claude Code:
claude mcp add --transport http santati https://santati.io/mcp --header "Authorization: Bearer sat_sk_…"
Consistency
append_events publishes to the ingest pipeline, which relays each event back for indexing. Writes are eventually consistent: get_events may not show a just-appended event for a second or two.