RousselTMLEARNING

Observability

Observa's AI assistant and MCP server

Configure Observa's AI assistant (Claude, OpenAI, Azure OpenAI or local model), use it to analyse a panel or create a dashboard, and connect AI agents such as Claude Code through the MCP server, safely.

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.

ToolUse
list_datasources · search_metricsfind the right source and metrics
query_datasourcerun a query and read the result
list_dashboards · create_dashboardfind or create a dashboard
list_alert_rules · list_active_alerts · create_alert_ruleanalyse and write alerts
list_otel_servicesdiscover 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.1
Best 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 #

AI agent, MCP server and audit
Read, Editor-only write, and logging of every call. · Illustration: Observa documentation

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.

MCP tools
A Viewer token is enough for analysis; keep Editor for agents that must act.

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 the initialize response contains an Mcp-Session-Id header, 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.

Sources #

Related articles

Discovering Observa: the self-hosted observability console

What Observa is, what it adds to Grafana OSS, its five-service architecture, its parity with Grafana Cloud an…

Installing Observa: Docker Compose, Kubernetes and configuration

Deploy Observa in two minutes with Docker Compose, in production on Kubernetes with Helm, then configure it: …

Securing Observa: authentication, roles and multi-tenancy

Configure access to Observa: local accounts, LDAP and Active Directory, OIDC, SAML, auth proxy, roles and per…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!