MCP Server
The tools, queries, hosts, tokens and protocol version of Berserk's MCP server
Berserk runs a Model Context Protocol server at https://<your-cluster-endpoint>/mcp. Point your agent at it and sign in; there is nothing to install locally. Setting up Claude Code or Codex: Connect Your AI Agent.
Guides
The server's instructions are short: they list the tools in the order to use them, the rules that prevent wrong answers, and which guide to read for which task. The guides themselves come from get_docs: query-craft (read before a first query), otel-data, logs, traces, metrics, kql, alerts and dashboards. get_docs with no name lists every guide and every KQL operator and function; a name returns that guide or reference page. The same guides ship in the CLI as bzrk help <topic>.
Beyond queries, the tools read and manage alerts, workflows and their runs, dashboards and notification connections. The agent reads the alerts or dashboards guide before changing any of them, and every tool says whether it only reads, changes Berserk state, or reaches outside Berserk, so a host can ask before a write.
Query
Discover schema first (list_databases, list_tables, discover_fields): field names are not guessable. Then run KQL with query_run, which keeps a query running between tool calls:
| Action | What it does |
|---|---|
start | Starts the query (query, database, optional since / until / timezone) and returns a run_id at once |
wait | Waits up to wait_ms (default 10 s, at most 30 s) for a newer result or completion; returning does not stop the query |
status | The run's current state |
read | A page of rows (table_index, offset, limit up to 500) from one result generation |
stop | Cancels the query once a partial answer is enough |
acknowledge | Discards a result version after you have saved and verified its download |
With no since and no time filter in the query, the last hour is searched; a window and in-query time filters intersect. Only status: "complete" means the whole window was scanned without dropped data; data_incomplete, running and cancelled results are partial, so a count from them is a lower bound. By default a query runs for at most 5 minutes, and a finished result is kept for 10 minutes.
Once a result generation is published (possibly a partial one while the query runs), responses link it as MCP resources: JSONL for all tables and a CSV per table. Download the JSONL to a file for analysis and check its SHA-256 and byte count against the bzrk/download metadata before acknowledge. Hosts that cannot read resources page with read instead: pass the returned generation for any offset above 0, and start again at offset 0 if the generation changed.
Details
Other MCP hosts
Any host that speaks MCP 2026-07-28 over HTTP works. Configure it with the URL:
{
"mcpServers": {
"berserk": {
"type": "http",
"url": "https://<your-cluster-endpoint>/mcp"
}
}
}Hosts that implement MCP HTTP auth sign in on their own: the first request gets 401 with WWW-Authenticate pointing at Protected Resource Metadata; the host discovers the cluster's authorization server, opens a browser for login and consent (authorization code with PKCE), stores the Bearer token and calls tools.
Service account token (no browser)
Hosts that cannot run the OAuth dance can send a service account token you create in Settings → Service Accounts:
{
"mcpServers": {
"berserk": {
"type": "http",
"url": "https://<your-cluster-endpoint>/mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}A bzrk login access token works the same way, but it expires in an hour unless the host refreshes it. Service account tokens last until you revoke them (or until an expiry you set). Browser session cookies are rejected.
For Codex, put the token in an environment variable and add bearer_token_env_var = "BERSERK_TOKEN" under [mcp_servers.berserk] instead of signing in.
Older MCP hosts
Berserk speaks MCP 2026-07-28 only: no initialize, no session, no GET stream. A host that still sends initialize gets JSON-RPC -32022 with data.supported: ["2026-07-28"]. Until your host supports the 2026 protocol, have the agent use the bzrk CLI. There is no stdio server: bzrk mcp no longer exists.