Connect Your AI Agent
Connect Claude Code, Codex or another AI agent to Berserk
Berserk pairs with AI agents to give you natural-language access to your logs, traces and metrics. Ask your agent to investigate errors, explore your data or follow a request across services, and it runs the KQL for you.
There are two ways in. Both teach the agent how to query Berserk well, so you don't need to install anything else:
- MCP (recommended): the agent talks to your cluster directly. Nothing to install locally; the agent reads Berserk's guides and KQL reference through the
get_docstool. - The
bzrkCLI: the agent runsbzrk searchin your terminal. Useful for scripting, administration and large exports; the CLI explains itself to agents withbzrk help agents.
Connect over MCP
Berserk's MCP server lives at https://<your-cluster-endpoint>/mcp.
Claude Code
Claude Code 2.1.232 or later:
claude mcp add --transport http berserk https://<your-cluster-endpoint>/mcpThen run /mcp in Claude Code and sign in through the browser.
Codex
Berserk speaks MCP 2026-07-28. Codex supports that protocol behind an experimental feature, mcp_2026_07_28, which is off by default and must be turned on. Add both the feature and the server to ~/.codex/config.toml:
[features]
mcp_2026_07_28 = true
[mcp_servers.berserk]
url = "https://<your-cluster-endpoint>/mcp"Then sign in through the browser:
codex mcp login berserkWithout the feature Codex speaks an older protocol, which Berserk rejects (-32022 Unsupported protocol version), and Codex shows no Berserk tools. To turn it on for a single session instead, start Codex with codex --enable mcp_2026_07_28.
Other hosts, tokens and tools
Any MCP host can connect, including ones that sign in with a service account token instead of a browser. The MCP Server reference covers them, the tools and how query_run works.
Use the bzrk CLI
Install the Berserk CLI:
curl -fsSL https://go.bzrk.dev | bashAdd a profile for your cluster, make it active and sign in. bzrk login runs a browser-based device-code flow:
bzrk profile add --endpoint https://<your-cluster-endpoint> my-cluster
bzrk profile use my-cluster
bzrk loginIf your data lives in a non-default database, add --database my-database to bzrk profile add. Check that it works:
bzrk auth status
bzrk search '.show tables'Endpoint vs. ingest URL
The profile --endpoint is your cluster's query/gateway URL (https://<your-cluster-endpoint>). Sending data into Berserk uses a separate OTLP ingest endpoint; see Ingestion.
Agents need no further setup: the CLI switches to agent mode on its own and explains itself to agents. See Use with an AI agent.
First things to ask
- "Which service logged the most errors in the last hour, and what are the most common messages?"
- "Which operation has the highest p95 latency over the last 30 minutes? Show one trace as a waterfall."
- "Which requests passed through the frontend and failed in another service?"
- "Which pod has the highest network receive rate right now?"
- "What tables do I have, and what kind of data is in each?"
The agent discovers your tables and fields, reads the guide that fits the question, runs the queries and tells you which window and data its answer covers.