MCP Endpoint for AI Agents

LogTide serves a Model Context Protocol endpoint, so an AI agent such as Claude Code or Cursor can search logs, follow traces, query metrics, check alerts and triage errors and incidents. When you allow it, the agent can also act on them. The endpoint is part of the backend: there is nothing extra to deploy.

Overview

The endpoint is POST /mcp on your API origin. It uses the MCP Streamable HTTP transport in stateless mode: there is no session id and responses are JSON, so it works behind several backend replicas. GET /mcp and DELETE /mcp answer 405 with Allow: POST.

Things you can ask an agent to do:

  • Find the errors in the api service from the last hour and show the logs around the worst one.
  • Follow a trace by id, with the logs that carry the same trace id.
  • Chart a metric, group it by a label and compare it with the previous window.
  • List the alert rules that fired this week and which channels they notify.
  • Triage error groups and security incidents, then resolve, assign or comment on them.
  • Wait for a log to appear while you reproduce a bug, then read it.

Read-only by default

Write tools exist for five data kinds and only appear when the token creator turned writing on for that kind.

Nothing is deleted

No tool deletes anything, whatever the credential.

Every storage engine

The tools call the same query services as the dashboard, so they work on TimescaleDB, ClickHouse and MongoDB.

Credentials

Send the credential as Authorization: Bearer <credential> or as X-API-Key: <credential>. A user session token is not accepted on /mcp, and the endpoint always requires a key or token, also when authentication is disabled.

Credential Format Reach
Access tokenlta_ + 64 hexThe projects, data kinds and write grants chosen when it was created.
Project API key, type fulllp_ + 64 hexIts project: logs, traces, metrics and alerts, read only.
Project API key, type writelp_ + 64 hexRejected with 403. Ingest-only keys cannot read.

Access tokens

An access token is an MCP-only credential: it does not authenticate the REST API. It has an owner, a set of data kinds, a set of projects and an optional expiry.

  • Organization token. Created by owners and admins in Settings > Access tokens. It belongs to the organization, so it keeps working when its creator leaves.
  • Personal token. Created by any user in Settings > Account > Access tokens. It acts with the access the user has right now, and becomes invalid if the user is disabled or deleted.
  • Data kinds. Logs, Traces, Alerts, Metrics, Security, Errors, Monitoring, Dashboards and Sessions. In the create dialog each kind is set to Off, Read or Read and write. Only Alerts, Security, Errors, Monitoring and Dashboards can be set to Read and write.
  • Projects. A selection of projects, or all projects, which includes projects created later.
  • Expiry. Never, 30 days, 90 days or 1 year.

The token starts with lta_ and is shown once, right after creation. It cannot be retrieved afterwards, so copy it then. Write grants are fixed at creation: to change them, create a new token and revoke the old one. Tokens that existed before write grants were introduced stay read-only.

To revoke a token, use the revoke button in the token list. Revocation and expiry take effect immediately. Personal tokens are not revoked by signing out of all sessions or by a password reset, which only end user sessions: revoke them from the account settings. Creating and revoking tokens is written to the audit log.

The projects a token reaches are resolved on every request:

  • An organization token reaches the selected projects that still belong to the organization, or all of its non-deleted projects.
  • A personal token reaches the selected projects (or every project of every organization the user belongs to), limited to what the user can access right now.
  • Soft-deleted projects are never reachable.

Project API keys

A project API key of type full also works on /mcp. It reads logs, traces, metrics and alerts of its own project and never writes. It cannot read the other data kinds (security, errors, monitoring, dashboards, sessions): use an access token for those. API key origin and IP allowlists apply on /mcp exactly as on the rest of the API. See API Reference for how API keys are created and used.

Grant only what the agent needs

A data kind gives access to everything that kind's tools return for the selected projects, including log lines attached to error groups and detections. Pick the kinds and projects the agent actually needs, and prefer a short expiry.

Connecting a Client

Use https://api.logtide.dev/mcp for LogTide Cloud and https://<your-backend>/mcp for a self-hosted install. After you create an access token, the dashboard shows the same configuration snippet with your instance URL.

Claude Code

claude mcp add --transport http logtide https://api.logtide.dev/mcp \
  --header "Authorization: Bearer lta_..."

Cursor and other clients

Clients that read an mcpServers JSON file (Cursor and similar) use the same entry. Put it in the client's MCP configuration file:

{
  "mcpServers": {
    "logtide": {
      "type": "http",
      "url": "https://api.logtide.dev/mcp",
      "headers": {
        "Authorization": "Bearer lta_..."
      }
    }
  }
}

For a self-hosted install, replace the URL with https://<your-backend>/mcp. Any client that supports MCP Streamable HTTP with custom headers can connect the same way.

Header formats

Both headers accept an access token or a project API key:

Authorization: Bearer lta_...
Authorization: Bearer lp_...
X-API-Key: lp_...

Self-Hosting Notes

/mcp is served by the backend, not the frontend. If the frontend and the API share one origin behind a reverse proxy, route /mcp to the backend the same way as /api. The bundled docker/docker-compose.traefik.yml already does.

Organization access tokens are counted by the access_tokens.max capability, which is unlimited unless you configure an entitlement. See Usage & Metering.

The write rate limit and the wait_for_logs concurrency limit are kept in the memory of each backend process, because the endpoint is stateless and Redis is optional. With several replicas the effective limit is the documented number times the number of replicas.

Tools Reference

The tool list a client sees depends on the credential. A data kind the credential does not have hides that kind's tools, and a kind it cannot write hides that kind's write tools. Every tool declares readOnlyHint, true for reads and false for writes. Results are JSON text. A tool failure (unknown project, bad argument, missing data kind or write grant, invalid query, rate limit) comes back as a tool result with isError: true, not as a protocol error. Unexpected failures are reported as Internal error without details.

Choosing the project

Tools that read project data take projectId. It is optional when the credential reaches exactly one project and required otherwise. A project that does not exist and one outside the credential give the same Project not found or not accessible error. Tools on organization-level objects (channels, members, saved searches, detection packs) take organizationId, optional when the credential reaches exactly one organization. Single-item tools such as get_log or get_incident check the item's organization and project against the credential.

Time ranges (from, to) are ISO 8601 with an offset. Tools with both cap the range at 31 days and require from before to. When from is omitted the default window is the last hour for logs, traces and metrics, and the last 24 hours for sessions, web vitals, detections and the security overview. list_error_groups has no default window. Single-item reads are not limited by the window.

Start here

Tool What it does Access
list_projectsReturns projects, dataKinds (what the credential can read) and writableDataKinds (what it can also change). Call this first.Read, any credential
list_membersId, display name and role of the organization's members, so an agent can assign work. Account emails are not returned.Read, any credential with a write grant

Logs

Tool What it does Access
search_logsSearches logs, newest first. query uses the LogTide query language (for example error AND service:api). limit 1 to 200 (default 50), cursor paging.Read
get_logThe full record, never shortened.Read
get_log_contextNeighbouring logs. before and after 0 to 50, default 10 each.Read
list_servicesService names that wrote logs in the range.Read
top_errorsMost frequent error and critical messages, with counts.Read
wait_for_logsWaits for new logs matching service, level and q. See the limits below.Read
find_correlated_logsLogs that share an identifier value (request id, user id, trace id) within windowMinutes of a reference time.Read

level values are debug, info, warn, error and critical. wait_for_logs waits up to timeoutSeconds (1 to 30, default 10) and returns at most limit logs (1 to 50, default 20), or { logs: [], timedOut: true }. It returns shortly after the first match, collecting up to half a second more to batch a burst, and only returns logs ingested after the call started. It listens for live notifications. When those are not available it polls every two seconds and filters on the log timestamp, so a log shipped with a timestamp older than the start of the call can be missed in that mode.

Traces

Tool What it does Access
search_tracesFilters service, errorsOnly, minDurationMs. limit 1 to 100 (default 20), offset 0 to 1000. Durations are in milliseconds.Read
get_traceThe trace and its spans, at most 500 (spanCount is the total, spansTruncated says whether spans were left out). With includeLogs and the Logs data kind it also returns the logs carrying the trace id.Read

Metrics

Tool What it does Access
list_metricsMetric names a project received in the range, with their type. Optional search.Read
get_metric_labelsLabel keys of a metric, or the values of one key (labelKey).Read
query_metricAggregates one metric (avg, sum, rate, ...) into series. The bucket size is chosen automatically. Optional groupBy (up to 2 keys) and label filters. At most 20 series and 300 points per series, and truncated says when something was cut.Read
metrics_overviewPer service, each metric with its latest, average, minimum and maximum value and point count over the range.Read

Alerts

Tool What it does Access
list_alert_rulesRules of the project plus organization-wide rules of its organization. Without projectId, every reachable project. Each rule lists its notification channels (id, name, type).Read
get_alert_historyFirings, newest first. ruleId, limit 1 to 100, offset 0 to 1000.Read
list_notification_channelsId, name, type and enabled flag of the organization's channels. Nothing from the channel configuration. Available with the Alerts kind, or with write on Security (enable_detection_pack needs channel ids).Read
create_alert_ruleCreates a log threshold, rate-of-change or metric rule in a project, or an organization-wide rule when projectId is omitted.Write
update_alert_ruleEdits a rule, including enabling and disabling it. Disabling a rule resolves its open incident and sends the resolve notifications.Write
snooze_alert_ruleSnoozes until a date within 365 days, or null to end the snooze.Write

Creating or updating a metric alert rule needs the Metrics kind, and a log based rule needs the Logs kind, on top of write on Alerts. Snoozing needs only write on Alerts. Rules notify through channels only: channelIds come from list_notification_channels and each must belong to the rule's organization. Webhook URLs and email recipients cannot be set through MCP.

Security

Tool What it does Access
list_incidents, get_incidentIncidents with filters status, severity, source. The detail includes comments, history, linked detections and the stored IP reputation and geolocation data of attacker IPs.Read
list_detectionsSigma rule matches, newest first.Read
security_overviewThe dashboard statistics for 24 hours (default), 7 or 30 days.Read
list_sigma_rules, get_sigma_ruleRules with filters. The detail has the rule YAML and recent matches.Read
list_detection_packsPacks with their activation state.Read
update_incidentStatus, severity, assignee, title, description. An invalid transition returns the service's error.Write
acknowledge_incidentMoves an open incident to investigating.Write
add_incident_commentAdds a comment.Write
set_sigma_rule_enabledEnables or disables a rule. Enabling honors the active rule limit.Write
enable_detection_packEnables a pack for the organization, creating organization-wide rules. Honors the active rule limit.Write

There is no tool to disable a detection pack. Do that from the LogTide UI: disabling turns the rules the pack created off and keeps them with their detection history and exceptions. New IP reputation or GeoIP lookups are not exposed: only data already stored on an incident is returned.

Errors

Tool What it does Access
list_error_groupsFilters status, search, service, from, to, sort, with limit and offset. No default window: groups of any age are listed. Groups without a project are not listed.Read
get_error_groupTrend and a small page of recent events with stack frames. Raw stack traces are truncated.Read
get_error_group_logsThe logs of a group.Read
update_error_groupresolve, reopen, ignore (forever, until a date or until a number of events) or assign to a member. There is no merge.Write

Monitoring

Tool What it does Access
list_monitors, get_monitorStatus, recent results, uptime summary and outages.Read
list_status_incidents, get_status_incidentStatus page incidents with their updates.Read
list_maintenancesScheduled maintenances.Read
project_healthIngestion health of a project: status, last event time, open and recently resolved health issues and 24 hour counters.Read
list_hardware_hosts, get_hardware_hostHosts reported by the hardware agent.Read
set_monitor_enabledPauses or resumes a monitor. Pausing resolves the open incident.Write
create_maintenanceSchedules a maintenance. Status page subscribers are notified as from the UI. Accepts autoUpdateStatus.Write
update_maintenanceChanges a maintenance. Subscribers are not notified. Accepts autoUpdateStatus.Write

Monitors are returned with the target reduced to scheme, host and port, and without HTTP headers or credentials. Monitors cannot be created or have their target edited through MCP.

Dashboards and saved searches

Tool What it does Access
list_dashboards, get_dashboardThe definition of a dashboard, without panel data (the agent should query logs and metrics directly). A panel that reads a project the credential cannot reach comes back as { id, type, title, hidden: true } and hiddenPanels counts them.Read
list_saved_searchesSaved log searches.Read
create_dashboardCreates a dashboard, project-scoped or organization-wide, with optional panels.Write
add_dashboard_panelAppends a panel, validated like in the dashboard editor.Write
create_saved_searchCreates a saved log search, within the saved-search limit.Write

An organization token sees shared dashboards and searches only. A personal token also sees the user's own private ones. See Custom Dashboards.

Sessions

Tool What it does Access
list_sessionsSessions with filters hasErrors and service. limit 1 to 50, cursor paging.Read
get_session_eventsThe events of a session. Default 100, at most 300, long metadata shortened.Read
web_vitals_summaryp75, rating and distribution per web vital, and the busiest routes.Read

The session user field comes from your own log data and is returned as stored, so it may contain an email address. Reading sessions is recorded in the audit log like on the REST API.

Writes

Writing is opt-in per data kind and chosen when the token is created. A token with any write grant shows a write badge in the token list. A read-only token does not list write tools, and calling one by name fails. Project API keys never write.

  • Same checks as the REST API. A write goes through validation, plan and capability limits, project and organization ownership checks and the active rule limits.
  • Audited with the token. Each write adds an audit log entry with the action the REST route records (for example rule.created, dashboard.updated or detectionpack.enabled), with via: "mcp" and the token id in its metadata. Writes whose REST route has no audit entry get one from the tool.
  • Personal token required for some actions. create_dashboard, add_dashboard_panel, create_saved_search, acknowledge_incident and add_incident_comment need a person as author. An organization token calling them gets a tool error that says so.
  • Owner or admin only. create_maintenance and update_maintenance keep the UI rule. An organization token counts as admin, and a personal token acts with the role the user has in that organization right now.
  • Nothing is deleted. No tool deletes anything. The write tools never set webhook URLs, email recipients or monitor targets.
  • Detection packs. A pack can be enabled through MCP but not disabled. Disable it from the UI.
  • Write rate limit. 30 write calls per minute per credential, per backend process. An attempt counts when it reaches the command: one refused earlier by permissions or validation is not counted, one refused by the command itself (a plan limit, for example) is. The error is Write rate limit reached, retry in a minute.

Writes change real data

The create dialog warns that a write-enabled token can change data in LogTide. Give it only to agents you trust, and keep write grants to the kinds the agent needs.

Privacy and Limits

What is never returned

  • Webhook URLs, channel configuration (URLs, headers, auth, routing keys) and email recipients, in alert rules, Sigma rules and channels. Channels appear by id, name, type and enabled flag only.
  • Monitor targets beyond scheme, host and port, and monitor HTTP headers or credentials.
  • Email addresses of LogTide accounts (members, assignees, authors, recipients). Assignees and authors appear by display name.
  • Anything the credential cannot reach: other projects, other organizations, soft-deleted projects.
  • The audit log, usage and metering, API keys and access tokens, and organization, member and admin settings.

Values that come from your own log data, such as the session user field or a log message, are returned as stored and may contain an email address or other personal data. If that is a concern, configure PII masking on the project before ingestion.

Project scoping

Items that have no project (organization-wide Sigma rules, detection packs, project-less incidents, detections and error groups, organization-wide dashboards) are readable and writable only with a credential that reaches every non-deleted project of the organization. An incident that groups detections from projects the credential cannot read is returned with crossProject: true and without its aggregate fields. The observed value of an organization-wide alert firing is returned as null with valueRedacted: true when the credential does not reach every project.

Result size and windows

  • List results shorten a message over 2,000 characters, with a marker pointing to get_log, and replace metadata over 4,000 characters of JSON with { "_truncated": true, "keys": [...] }.
  • Tools with from and to cap the range at 31 days. Longer ranges are rejected with Time range cannot exceed 31 days.
  • Lists have a maximum page size, and offsets stop at 1000 where a tool takes one.
  • JSON-RPC batch requests (arrays of more than one message) are rejected with 400.

Rate limits

  • Requests are rate limited per credential, with the same global limit as the rest of the API.
  • Write tools: 30 calls per minute per credential, as described in Writes.
  • wait_for_logs: at most 2 waits at the same time per credential, each up to 30 seconds.

Troubleshooting

Symptom Likely cause
401No credential, or an unknown, revoked or expired one. A user session token is not accepted. The response carries WWW-Authenticate: Bearer.
403A write type API key (ingest-only keys cannot read), or a request from an origin or IP outside the key's allowlist.
405The client sent GET or DELETE. Only POST is served: check that the client is configured for Streamable HTTP, not SSE.
Requests reach the frontend instead of the APIThe reverse proxy does not route /mcp to the backend. See Self-Hosting Notes.
Project not found or not accessibleThe project id does not exist, is soft-deleted, or is outside the credential. Both cases give the same message. Call list_projects to see what the credential reaches, and pass projectId when it reaches more than one.
A tool is missing from the listThe token does not have that data kind, or has it read only (write tools are hidden). Create a new token with the kind or the write grant, then revoke the old one. A project API key only offers logs, traces, metrics and alerts tools.
A write tool fails with a permission messageSome actions need a personal token, and maintenances need an owner or admin. See Writes.
Time range cannot exceed 31 daysThe from to to range is too long. Ask for a shorter window.
Write rate limit reached, retry in a minuteMore than 30 write calls in a minute for that credential.
A token stopped workingIt was revoked or expired, or it is a personal token of a user who was disabled or deleted. Revocation and expiry apply immediately.
Esc

Type to search across all documentation pages