Skip to content

API and MCP

Your agents already know your context: tickets, code, chat. With a key they read Korai Observability directly (logs, traces, metrics, SQL, Kubernetes events and alerts) and get the raw JSON back, so you work with it in your own tools. Keys only read, and Korai never needs access to your other tools.

API and MCP: keys, the MCP URL and the client configuration

Account › API and MCP › Create key (tenant admins; also in tenants that only use Observability, with no cloud account). Give the key a name (the agent or script that uses it) and how many days it lasts: 90 by default, a year at most. Korai shows the key once: copy it into your secret store.

  • A key belongs to the tenant, not to a person, and only reads (scope observability:read).
  • It opens the MCP server and nothing else: it can’t change settings, members or alerts, and it can’t read another tenant.
  • The table shows when each key was last used and how many calls it made. Revoke stops it at once. Creating and revoking keys appears in the audit log.

One URL for every tenant, https://app.korai.tech/api/mcp: the key says which tenant it is. It speaks MCP over HTTP (JSON-RPC), so any MCP client connects to it.

Claude Code:

Terminal window
export KORAI_API_KEY=korai_...
claude mcp add --transport http korai https://app.korai.tech/api/mcp --header "Authorization: Bearer $KORAI_API_KEY"

Cursor, VS Code and other clients take the same URL and header in their configuration:

{"mcpServers": {"korai": {"type": "http", "url": "https://app.korai.tech/api/mcp",
"headers": {"Authorization": "Bearer ${KORAI_API_KEY}"}}}}

From a script, call a tool with curl and read the JSON:

Terminal window
curl -s https://app.korai.tech/api/mcp -H "Authorization: Bearer $KORAI_API_KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"korai_obs_logs",
"arguments":{"q":"level:error","start":"2026-11-16T13:00:00Z","end":"2026-11-16T14:00:00Z","limit":500}}}'
Tool Reads
korai_obs_services services in a window with health, requests, errors, p95 latency and dependencies
korai_obs_service one service: overview, endpoints, dependencies, deployments, jobs, runtime, infrastructure
korai_obs_endpoint one operation: its slowest requests and its queries
korai_obs_issues error issues (exceptions grouped)
korai_obs_streams your trace and log streams
korai_obs_logs log lines, newest first, with the same search as Logs; next pages back
korai_obs_sql one read-only SQL query over traces or logs
korai_obs_metrics / korai_obs_metric_query the metric catalogue, and one metric read with SQL or PromQL
korai_obs_k8s_events Kubernetes events: scaling, scheduling, restarts, OOM kills, evictions
korai_obs_alerts Observability alerts firing and resolved, with when they started and cleared
korai_obs_trace one trace by id

Every answer is the whole JSON (as structuredContent and as text). Times are ISO 8601 or epoch seconds.

  • Raw logs and traces: 6 hours per call (ask again for the next window, or follow next in logs). Metrics: 7 days.
  • Up to 1,000 rows per call and 5 MB per answer. SQL must aggregate or carry a LIMIT.
  • Per key: 60 calls a minute and 2 at once. Over that, the call answers an error that says when to retry.
  • The same protections as every screen of Korai keep your queries from overloading the observability platform: a window too big for one read answers its newest part and says so.

Log lines, span attributes and SQL are written by your applications and their users: tell your agent to treat them as data, never as instructions.