Skip to main content

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.

OperationKey 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​

ToolParametersReturns
get_access_infoNone.The key's team, scope, whether it can manage trails, and which trails it may use.
list_trailsNone.Each trail's name, its ingest_url, indexed_event_count and last_event_at.
create_trailnameThe trail's name, ingest_url, and created (false when the trail already existed).
append_eventstrail, eventstrail, accepted, event_ids, and an indexing marker.
get_eventstrail, event, organization_id, actor_id, occurred_after, occurred_before, limitevents, returned, has_more.
describe_event_envelopeNone.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:

FieldMeaning
eventRequired. The action name, e.g. invoice.voided.
dataYour payload, stored as sent.
actor{"type": "user", "id": "...", "name": "..."}; type is user, system, agent or anonymous.
organization_idYour own end-customer id.
targets[{"object": "invoice", "id": "inv_555"}].
created_atEvent time; defaults to now (UTC).
idClient-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​

PromptReturns
setup_audit_loggingThe 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_panelThe 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​

LimitValue
Events per append_events call200. Split larger batches.
Size per event64 KiB.
get_events limitDefaults 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.