1. The AI assistant #
A tool-using assistant, with your permissions.
What it does #
The ✨ button opens an assistant that queries your sources, summarizes alerts, creates dashboards and rules in natural language. It acts with the user's permissions (and multi-tenant scope) and every action is audited. From a panel, the ⋮ menu offers Analyse with AI.
| Tool | Use |
|---|---|
| list_datasources · search_metrics | find the right source and metrics |
| query_datasource | run a query and read the result |
| list_dashboards · create_dashboard | find or create a dashboard |
| list_alert_rules · list_active_alerts · create_alert_rule | analyse and write alerts |
| list_otel_services | discover OpenTelemetry services |
Configuration #
AI_ENABLED=true
AI_PROVIDER=anthropic # anthropic | openai | azure_openai | openai_compatible
AI_API_KEY=<key>
AI_MODEL=claude-opus-5-5
AI_MAX_STEPS=12
AI_ALLOWED_ROLE=Editor
# Local model (Ollama, vLLM…): OpenAI-compatible API
# AI_PROVIDER=openai_compatible
# AI_BASE_URL=http://ollama:11434/v1
# AI_MODEL=llama3.1Best practice : For sensitive data, a local model behind an OpenAI-compatible API keeps everything inside your IT. Restrict the assistant to a role (AI_ALLOWED_ROLE) and cap the number of steps (AI_MAX_STEPS) to control cost and duration.
2. The MCP server #
Connecting Claude and other agents.
The principle #
Observa ships a Model Context Protocol server on POST /api/mcp (Streamable HTTP transport, JSON-RPC 2.0). An agent (Claude Code, Claude Desktop, or any MCP client) connects with an obs_… service account token and inherits exactly its rights.
Connecting an agent #
claude mcp add --transport http observa https://observa.example.com/api/mcp \
--header "Authorization: Bearer obs_xxxxxxxx"{
"mcpServers": {
"observa": {
"type": "http",
"url": "https://observa.example.com/api/mcp",
"headers": { "Authorization": "Bearer obs_xxxxxxxx" }
}
}
}Then, in natural language: “Which critical alerts are firing on checkout, and who is on call?”, “Show the checkout error rate over the last hour”.
Testing by hand #
OBS=https://observa.example.com; TOKEN=obs_xxxxxxxx
H=(-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream')
curl -s "${H[@]}" $OBS/api/mcp -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}'
curl -s "${H[@]}" $OBS/api/mcp -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
curl -s "${H[@]}" $OBS/api/mcp -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"list_datasources","arguments":{}}}'Good to know : If theinitializeresponse contains anMcp-Session-Idheader, send it back on the following requests; responses may come as JSON or as an event stream (text/event-stream).
Security #
- One service account per agent, named, with the minimal role.
- A multi-tenant scope on that account if the agent must see only one customer.
- Regular review of the audit log (
mcp.tool) and revocation of unused tokens. - Never a token in a Git repository or a shared configuration file.
Watch out : An agent with an Editor token can silence alerts: a misunderstood prompt (or an injection in content read by the agent) would be enough to hide an outage. Keep that right for supervised uses.
