Skip to main content

Logz.io MCP Server

The Logz.io Public API MCP (Model Context Protocol) server allows LLM clients (Claude, Cursor, ChatGPT, etc.) to access observability data - logs, metrics, dashboards, and alerts, and to run OrionIQ AI agents, in a standardized way. With MCP, AI agents can fetch context and trigger actions without custom integrations.

Prerequisites​

  • A Logz.io API token (create in your Logz.io account settings). The same token is used for logs, metrics, dashboards, and alerts. You don't need a separate metrics API token.
  • A supported LLM client with MCP integration. Setup instructions vary per client.

Setup​

The steps for adding the Logz.io MCP server depend on your client. Refer to each client's instructions on how to attach the Logz.io MCP server to your LLM.

Below is a generic example configuration:

{
"logz.io public api": {
"command": "npx",
"args": [
"mcp-remote",
"https://api.logz.io/mcp",
"--header",
"X-API-TOKEN:<<YOUR-LOGZIO-API-TOKEN>>"
]
}
}

Replace <<YOUR-LOGZIO-API-TOKEN>> with your actual token.

The domain prefix (api) is region-specific. Those are the regions available:

  • https://api.logz.io/mcp (US) us-east-1
  • https://api-eu.logz.io/mcp (EU) eu-central-1
  • https://api-uk.logz.io/mcp (UK) eu-west-2
  • https://api-au.logz.io/mcp (AP) ap-southeast-2
  • https://api-jp.logz.io/mcp (AP) ap-northeast-1
  • https://api-ca.logz.io/mcp (CA) ca-central-1

After setup is complete, you can query your Logz.io data. Ask questions about your logs, metrics, dashboards, or alerts - the MCP server will expose the right tools so your client can fetch results in context.

Main dashboard

Choosing the account to query​

The API token belongs to one Logz.io account, but the MCP server can query other accounts that account is allowed to read:

  • Metrics: every metrics tool requires an account_id, the metrics account to query. Use get_metrics_accounts to list the metrics accounts that your token can query. A metrics account is on the list if your token's account is one of its authorized accounts. This tool also works with read-only tokens.
  • Logs: the log search tools accept an optional account_id to search another account your token may search, such as a sub account. Use get_associated_accounts to list them; it needs an admin API token, so read-only and regular tokens can't use it. Without account_id, the token's own account is searched. scroll_logs always reads the token's own account.
  • OrionIQ agents: list_ai_agents lists only the agents of the token's own account. A run reads the accounts given in log_account_ids and metric_account_ids. Without them, it reads the data the agent is set up to read in OrionIQ; if the agent has none set up, the run fails and the result asks for account IDs. An agent that reads only logs or only metrics accepts only that kind of account.

Available tools​

The MCP server exposes tools grouped by domain. Each tool follows the MCP request/response schema.

Account management​

Tools for managing and retrieving account information:

ToolDescriptionParametersAPI Link
get_account_infoRetrieve account name and ID for the current token.NoneLink
get_associated_accountsList all accounts associated with the current account (including sub-accounts for owners). Needs an admin API token.None
get_metrics_accountsList the metrics accounts the current token can query (ID and name), for the account_id of the metrics tools. Works with read-only tokens.None

Metrics management​

Tools for querying metrics. All of them require account_id (int), the metrics account to query.

ToolDescriptionParametersAPI Link
query_prometheus_metricsRun a PromQL query at a single timestamp.account_id (int, required), query (string, required), time (string, optional), timeout (string, optional)Link
query_prometheus_metrics_rangeRun a PromQL query over a time range.account_id (int, required), query (string, required), start (string, required), end (string, required), step (string, required), timeout (string, optional)Link
get_available_metricsList the metric names available in the metrics account.account_id (int, required), match (string, optional), start (string, optional), end (string, optional), limit (int, optional)Link
get_metric_labelsList the label names of a metric.account_id (int, required), metric_name (string, required), start (string, optional), end (string, optional), limit (int, optional)Link
get_metric_seriesList the time series that match a selector, with their full label sets.account_id (int, required), match (string, required), start (string, optional), end (string, optional), limit (int, optional)Link
get_metric_metadataGet the type, help text, and unit of metrics.account_id (int, required), metric_name (string, optional), limit (int, optional)Link

Logs management​

Tools for searching, filtering, and managing logs:

ToolDescriptionParametersAPI Link
search_logsSearch logs with Elasticsearch DSL.query (object, required), size (int, optional), from (int, optional), sort (array, optional), day_offset (int, optional), account_id (int, optional)Link
scroll_logsScroll through large sets of log data in the token's own account.query (object, optional), scroll_id (string, optional), size (int, optional), scroll (string, optional)Link
search_logs_simpleFull-text search across all log fields.search_term (string, required), size (int, optional), from (int, optional), day_offset (int, optional), account_id (int, optional)Link
search_logs_by_timestampSearch logs within a specific time range.start_time (string, required), end_time (string, required), search_term (string, optional), size (int, optional), from (int, optional), day_offset (int, optional), account_id (int, optional)Link
get_all_log_typesList all log types available.NoneLink
retrieve_drop_filtersRetrieve all configured drop filters.NoneLink

Log searches cover the last 2 calendar days by default. Use day_offset to search older data.

Dashboards & folders​

Tools for creating and managing dashboards and dashboard folders:

ToolDescriptionParametersAPI Link
get_all_dashboardsList all dashboards with UIDs.NoneLink
get_dashboard_by_idRetrieve a dashboard by UID.folder_id (string, required), uid (string, required)Link
get_dashboard_creatorsList the account users who created dashboards, with their IDs and full names. Use an ID as the created_by of search_dashboards.None
create_dashboardCreate a dashboard from configuration. get_dashboard_schema_example returns a configuration you can start from.folder_id (string, required), dashboard_config (object, required)Link
update_dashboardUpdate a dashboard.folder_id (string, required), uid (string, required), dashboard_config (object, required)Link
move_dashboardMove a dashboard to a different folder.uid (string, required), folder_id (string, required), target_folder_id (string, required)Link
get_all_dashboard_foldersList all dashboard folders.with_dashboards (string, optional)Link
get_dashboard_folder_by_nameRetrieve a dashboard folder by its display name. The folder ID it returns is the folder_id other tools take.name (string, required)
search_dashboardsSearch dashboards by title, by creator, or both. Returns each match with its UID and folder.query (string, optional), created_by (int, optional), limit (int, optional), page (int, optional)
create_dashboard_folderCreate a new dashboard folder.name (string, required)Link
get_all_global_data_sourcesList all global data sources.None
get_dashboard_schema_exampleRetrieve an example dashboard configuration for create_dashboard, with one log-count panel. Replace its placeholder account ID with your log account ID.None
get_datasource_schema_exampleRetrieve an example data source schema.None

Metrics dashboards & alerts​

Tools for reading the dashboards and alert rules in Logz.io Metrics (see Metrics Alert Manager). They are separate from the dashboards in Dashboards & folders and the alerts in Alerts & insights. These tools only read. To create a dashboard, use create_dashboard. To create an alert, use create_alert.

ToolDescriptionParametersAPI Link
search_metrics_dashboardsSearch metrics dashboards. Returns each match with its UID, title, folder, tags and URL; dashboards in the General folder show General. Results come in pages of page_size; when a page is full, the result includes nextPageNumber.query (string, optional, part of the title), tags (array, optional, a dashboard must have all of them), folder_uids (array, optional, folder UIDs, not titles; general is the General folder), page_number (int, optional), page_size (int, optional, 1–1000, default 100)
get_metrics_dashboard_by_uidRetrieve a metrics dashboard: its folder, tags, time range and variables, and its panels with their row, type, data source and queries. Layout and display options are left out. Panels come in pages of limit. Each data source shows the Logz.io account it reads as accountId, which the metrics tools take as account_id. Set panel_id to get one panel exactly as it is stored.uid (string, required), panel_id (int or string, optional), limit (int, optional, 1–200, default 50), offset (int, optional)
get_all_metrics_alertsList metrics alert rules, sorted by folder, rule group and title. Returns a summary of each rule: UID, title, folder, rule group, whether it is paused, pending period, labels, summary, description, runbook URL and the dashboard panel it was created from. Set state to list only the rules that are firing or pending now, with the time they entered that state. Long summaries (over 200 characters) and descriptions (over 500) are shortened; get_metrics_alert_by_uid returns them in full.search (string, optional, part of the title), folder (string, optional, folder title or UID), paused (boolean, optional), state (firing or pending, optional), limit (int, optional, 1–200, default 50), offset (int, optional)
get_metrics_alert_by_uidRetrieve a metrics alert rule as it is defined: its queries, condition, pending period, no-data and error handling, labels and annotations.uid (string, required)

A metrics alert rule that was created from a dashboard panel returns that panel's dashboardUid and panelId. Pass them to get_metrics_dashboard_by_uid as uid and panel_id to see the panel.

note

The metrics dashboard and alert tools need an API token with the Admin or User role. Read-only tokens are refused.

Alerts & insights​

Tools for alerts and insights. The alert tools cover log alerts and metric alerts together. Each alert has a type, logs or metrics, and an ID, which the tools take as get_all_alerts returns it. In search results the type is in alertConfiguration.type: LOG_ALERT is logs and METRIC_ALERT is metrics.

ToolDescriptionParametersAPI Link
get_all_alertsSearch log and metric alerts. Returns one page of alerts (25 by default) and the total number of matches.search_term (string, optional), source (logs or metrics, optional), severities (array, optional), tags (array, optional), enabled (boolean, optional), sort_by (title, severity, tags, updatedAt, createdBy, updatedBy or enabled, optional), sort_direction (ASC or DESC, optional), page_number (int, optional), page_size (int, optional)
get_triggered_alertsSearch alert events: which alerts triggered, resolved, are pending or have no data. Covers the last 60 minutes by default, newest first.from (int, optional, UNIX seconds), to (int, optional, UNIX seconds, needs from), states (TRIGGERED, RESOLVED, PENDING or NO_DATA, array, optional), search_term (string, optional), source (logs or metrics, optional), alert_ids (array, optional), severities (array, optional), tags (array, optional), is_muted (boolean, optional), sort_by (string, optional), sort_direction (ASC or DESC, optional), page_number (int, optional), page_size (int, optional)
get_alert_by_idRetrieve an alert by type and ID.type (logs or metrics, required), id (int or string, required)
create_alertCreate a log or metric alert. Its alertConfiguration.type, LOG_ALERT or METRIC_ALERT, selects the type. get_alert_schema_example returns an alert you can start from.alert (object, required)
update_alertReplace an alert. Fields left out return to their defaults, so start from the alert that get_alert_by_id returns and change only what you need.id (int or string, required), alert (object, required)
enable_alertEnable an alert.type (logs or metrics, required), id (int or string, required)
disable_alertDisable an alert. It stops triggering and sending notifications until you enable it again.type (logs or metrics, required), id (int or string, required)
get_alert_schema_exampleRetrieve an example alert for create_alert, one log alert and one metric alert, with notes on the allowed values. Replace their placeholder account ID with your own.None
get_insightsGet insights matching criteria.from (int, optional), size (int, optional, 1–100), asc (boolean, optional), search (string, optional)Link

Severities are INFO, LOW, MEDIUM, HIGH and SEVERE.

note

Any API token can read alerts, including read-only tokens. Creating, updating, enabling and disabling alerts needs a token that can manage alerts. These tools change your account's alerts, so your AI assistant can ask you to confirm before it runs one. The MCP server can't delete alerts: delete them in Logz.io.

OrionIQ AI agents​

Tools for running OrionIQ agents, such as a root cause analysis:

ToolDescriptionParametersAPI Link
list_ai_agentsList the account's agents with their IDs, newest first. By default, lists only active agents with the Api trigger. Agents with other triggers can be run too: set trigger to any to include them, and state to any to include inactive ones.search_term (string, optional), type (string, optional), trigger (Api, Alert, Scheduled, Deployment or any, optional), state (active, inactive or any, optional), page_number (int, optional), page_size (int, optional, 1–50)
invoke_ai_agentStart an agent run. Returns a session_id right away; the run itself takes a few minutes.agent_id (string, required, the agent's ID from list_ai_agents), message (string, required), additional_context (string, optional), start_time (string, optional), end_time (string, optional), log_account_ids (array, optional), metric_account_ids (array, optional)Link
get_ai_agent_resultGet the result of a run. Waits up to wait_seconds for the run to finish, then returns either the report or loading. On loading, the run is still in progress: call the tool again to keep waiting.agent_id (string, required), session_id (string, required, as returned by invoke_ai_agent), wait_seconds (int, optional, 0–40, default 20)Link
send_ai_agent_followupAsk a follow-up question in the same session, once the previous answer is ready. While the previous answer is still loading, or its status can't be read, the follow-up is not sent. The agent keeps the conversation so far, but not the parameters of earlier turns: pass the account IDs, time range and additional context again. Read the answer with get_ai_agent_result.agent_id (string, required), session_id (string, required), message (string, required), plus the optional parameters of invoke_ai_agentLink

A run is asynchronous: start it with invoke_ai_agent, then call get_ai_agent_result until it returns the report. Through MCP, the result can be read until 15 minutes after the run started or 10 minutes after it finished, whichever comes first; after that it returns canceled or timeout. A report longer than 20 KB is shortened. The full run stays available in the Invocations tab of the Agents Hub.

note

Each agent run (invoke_ai_agent) and follow-up (send_ai_agent_followup) counts against the account's AI usage. Your AI assistant therefore asks you to confirm before it starts one, unless you explicitly asked for it. Listing agents and reading results don't count. AI must be enabled for the account, and only active agents can run: list_ai_agents shows whether each agent is active.

Best practices​

  • Always confirm which client you are using and follow its MCP setup guide.
  • Use ISO-8601/RFC3339 timestamps for metrics and log queries.
  • Start with smaller query sizes to validate setup before scaling.
  • Secure your tokens; do not hard-code in public repos.

OAuth 2.0 Support for Logz.io MCP Server​

The MCP server supports OAuth 2.0 Authorization Code flow with PKCE, allowing third-party tools such as AWS Bedrock Agent to connect without manually sharing static API tokens.

Existing integrations that pass X-API-Token directly continue to work unchanged.


How it works​

AWS Bedrock Agent 
or Similar Client MCP Server User
| | |
|── GET /.well-known/... ────────>| |
|<─ OAuth metadata ───────────────| |
| | |
|── POST /register ───────────────>| |
|<─ { client_id, client_secret } ─| |
| | |
|── redirect user to /authorize ──────────────────────────────>|
| |<── enters Logz.io token ─|
|<── redirect with ?code=... ──────────────────────────────────|
| | |
|── POST /token (code + PKCE) ────>| |
|<─ { access_token } ─────────────| |
| | |
|── POST /mcp Authorization: Bearer <token> ──────────────>|
  1. The agent discovers OAuth metadata at /.well-known/oauth-authorization-server.
  2. The agent registers as a client via POST /register.
  3. The user is redirected to /authorize where they enter their Logz.io API token.
  4. The server issues an authorization code and redirects back to the agent.
  5. The agent exchanges the code for a JWT access token via POST /token.
  6. The agent attaches Authorization: Bearer <token> to every MCP request.
  7. The server decrypts the token and injects the Logz.io API token transparently.

The Logz.io API token is never sent to the agent — it is encrypted inside the JWT and only the MCP server can read it.


For additional help, contact Logz.io's Support.


Any use of Logz.io's MCP is subject to our Terms of Use.