Better Stack MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Better Stack MCP or direct API to query monitors, list incidents, search logs, and create incidents through natural language.

Better Stack MCP logoBetter Stack MCP
Dcr Oauth

Better Stack is an observability platform for monitoring, incident management, and log aggregation. Use it to detect, investigate, and resolve incidents quickly with real-time alerts.

111 Tools

Try Better Stack MCP now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Better Stack MCP
Try asking
TOOLS

Supported Tools

Every Better Stack MCP action and event your agent gets out of the box.

Acknowledge incident

Acknowledge an ongoing incident

Add chart to dashboard

Add a new chart to a dashboard.

Add dashboard section

Add a section divider to a dashboard.

Application

Get comprehensive details of a specific application including its configuration, retention settings, ingestion details, custom bucket settings (if configured)

Applications

List all available applications in a paginated table format.

Available incident escalation policies

Get available escalation policies for an incident

Change team member role

Change a team member's role.

Chart

Get detailed information about a specific chart including its SQL queries, configuration, and settings.

Chart alert

Get detailed information about a specific chart alert including its configuration, SQL queries, status, and current incident info.

Chart alert help

Get instructions for creating and configuring chart alerts, including alert types, operators, configuration fields, supported chart types, and common mistakes.

Chart alerts

List chart alerts with optional filtering by team, chart, or dashboard.

Chart building help

Get comprehensive instructions for building charts and dashboards, including chart types, units, axis settings, column mapping, legend placement, layout tips, and common mistakes.

Clusters

List all available storage clusters for a specific team.

Create application

Create a new application in Better Stack.

Create chart alert

Create a new chart alert on an existing chart.

Create cloud connection

Create a secure cloud connection for direct ClickHouse query access to logs, spans, and metrics data.

Create dashboard

Create a new dashboard.

Create heartbeat

Create a new heartbeat that expects a periodic request from a cron job, worker, or other background task, and alerts when that request stops arriving.

Create incident

Create a new incident providing a summary of the issue, requester email, and other optional details

Create incident comment

Create a comment on an incident

Create metric expression

Create a new metric expression (extract-metrics-from-logs rule) on a source.

Create monitor

Create a new monitor that tracks the availability of a website, host, or service.

Create source

Create a new log source in Better Stack.

Create status page report

Create a new status page report

Create status page report update

Create a new status update for an existing status page report

Create status page resource

Add a resource (monitor, heartbeat, or group) to a status page.

Create status page section

Create a section (resource group) on a status page to group resources under a heading

Dashboard

Get detailed information about a specific dashboard including its charts, sections, layout, template variables, and configuration.

Dashboard query help

Get instructions for writing a ClickHouse query to use inside a Better Stack **Dashboard** chart (or chart alert).

Dashboards

List all available dashboards in a paginated table format.

Dashboard templates

List all available dashboard templates in a paginated table format.

Data regions

List all available data regions and clusters for application and source creation.

Delete chart alert

Delete a chart alert permanently.

Delete metric expression

Delete a metric expression from a source.

Documentation

Search for relevant documentation articles and return their contents

Edit application

Edit an existing application in Better Stack - rename it, pause or resume ingesting, or set its VRL transformations, including the exception grouping program.

Edit chart

Edit an existing chart name, query, type, or settings.

Edit chart alert

Edit an existing chart alert configuration.

Edit dashboard

Edit an existing dashboard's name or source eligibility.

Edit dashboard section

Edit an existing dashboard section.

Error

Get comprehensive details of a specific error including its type, message, call site information, first occurrence, current state (unhandled, unresolved, ignored, resolved, or reoccurred), and linked Linear/Jira issues

Errors

List error patterns for an application with occurrence counts, affected users, current state, and links.

Errors query help

Get comprehensive instructions for building SQL ClickHouse queries for error tracking, including both error patterns (metrics) and individual exceptions.

Escalate incident

Escalate an ongoing incident to a user, team, schedule, or policy

Escalation policies

List all escalation policies with their steps and configuration

Escalation policy

Get detailed information about a specific escalation policy

Exploration

Get detailed information about a specific exploration (saved Explore query) including its sources, chart type, template variables, saved time range, and query.

Explorations

List saved explorations (saved Explore queries) in a paginated table.

Explore logs query help

Get instructions for writing a ClickHouse query to use inside the Better Stack **Explore logs** page (and live-tail charts) for log and span data.

Export dashboard

Export a dashboard configuration as JSON.

Heartbeat

Get details of a specific heartbeat

Heartbeat availability

Get availability summary for a specific heartbeat

Heartbeats

List all heartbeats with filtering and pagination options

Import dashboard

Import a dashboard from JSON configuration.

Incident

Get detailed information about a specific incident

Incident comments

Get comments for an incident

Incidents

List incidents with filtering and pagination options

Incident timeline

Get the timeline of events for an incident

Invite team member

Invite someone to a Better Stack team by e-mail address.

Metric

Get comprehensive details about a specific metric.

Metric expressions

List the metric expressions (extract-metrics-from-logs rules) on a source.

Metrics query help

Get instructions for building SQL ClickHouse queries for metrics (available metrics, aggregations, examples) to run directly via the query tools (`query` / `render_chart`), using concrete `remote(.

Metrics schema

Get metrics and cardinality for a source.

Monitor

Get details of a specific monitor

Monitor availability

Get availability (SLA) summary for a specific monitor

Monitor response times

Get response time metrics for a specific monitor

Monitors

List monitors with optional filtering and pagination

Move charts

Move one or more charts to new positions on a dashboard.

On call

Get detailed information about a specific on-call calendar or the default calendar

On call event

Get detailed information about a specific on-call event

On call events

List all on-call schedule events for a specific calendar

On call rotation

Get on-call rotation configuration for a specific calendar

On calls

List all on-call calendars for the team

Query

Execute a ClickHouse SQL query to retrieve logs, traces/spans, errors, and metrics from telemetry data.

Query help

Get instructions for building SQL ClickHouse queries for logs and spans (fields, aggregations, examples) to run directly via the query tools (query / render_chart) against the ClickHouse proxy.

Releases

List all releases for a specific application in a paginated table format.

Remove chart

Remove a chart from its dashboard permanently.

Remove dashboard

Remove a dashboard permanently.

Remove dashboard section

Remove a section divider from a dashboard permanently.

Remove dashboard variable

Remove a dashboard template variable by name.

Remove exploration variable

Remove a variable from an exploration (saved Explore query) by name.

Remove status page resource

Remove a resource from a status page

Remove status page section

Remove a section from a status page.

Remove team member

Remove a member from a Better Stack team, or cancel a pending invitation.

Render chart

Execute a ClickHouse SQL query and visualize the result as a chart.

Reopen incident

Reopen a resolved incident (must be within 24 hours of resolution)

Replays query help

Get comprehensive instructions for building SQL ClickHouse queries for session replays.

Resolve incident

Resolve an ongoing incident

Set dashboard variable

Create or update a dashboard template variable — a user-facing filter in the dashboard toolbar, referenced in chart SQL as `{{name}}` (required — the chart errors until it resolves to a value) or `[[ AND col = {{name}} ]]` (optional — the whole `[[ .

Set exploration variable

Create or update a variable on an exploration (saved Explore query), referenced in its query as `{{name}}`.

Severities

List all severities (urgency levels) with their notification settings

Severity

Get detailed information about a specific severity (urgency level)

Source

Get comprehensive details of a specific source including its configuration, retention settings, ingestion details, custom bucket settings (if configured)

Source fields

Get complete field catalog for a logs or spans source.

Sources

List all available sources in a paginated table format.

Status page

Get details of a specific status page

Status page reports

List status reports (incidents/maintenance) for a specific status page

Status page report update

Get details of a specific status page report update

Status page report updates

List status updates for a specific status report

Status page resources

Get resources (monitors/heartbeats) for a specific status page

Status pages

List all status pages with filtering and pagination options

Status page sections

List the sections (resource groups) of a status page

Team members

List the members of a Better Stack team, including pending invitations.

Team roles

List the roles defined in a Better Stack organization, including their role_id and system-role identifier (admin, billing_admin, team_lead, responder, member, or "custom").

Teams

List all available teams in Better Stack Logs.

Toggle chart alert pause

Pause or unpause a chart alert.

Update error state

Update the state of a specific error (mark as resolved, ignored, or unresolved)

Update metric expression

Update an existing metric expression.

Update status page

Update the settings of a status page (company name, contact URL, theme, layout, and more)

Update status page resource

Update a resource on a status page.

Update status page section

Rename a status page section or move it by setting its position

SETUP GUIDE

Connect Better Stack MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK for Python or TypeScript
2

Initialize Client and Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });
const session = await composio.create('your-user-id');
console.log(`Tool Router session created: ${session.mcp.url}`);
Import and initialize the Composio client, then create a Tool Router session for Better Stack MCP
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: session.mcp.url,
    headers: {
      'x-api-key': 'your-composio-api-key',
    },
  },
});

const tools = await client.tools();
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{
    role: 'user',
    content: 'YOUR_SPECIFIC_PROMPT_HERE'
  }],
  maxSteps: 5,
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent (Anthropic Claude or Mastra)
SETUP GUIDE

Connect Better Stack MCP API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Better Stack MCP Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'YOUR_SPECIFIC_PROMPT_HERE'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Better Stack MCP actions with your Agent

Why Use Composio?

AI Native Better Stack MCP Integration

  • Supports both Better Stack MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Better Stack MCP data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Better Stack MCP access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Better Stack MCP
  • Scoped, least privilege access to Better Stack MCP resources
  • Full audit trail of agent actions to support review and compliance
FRAMEWORKS

Use Better Stack MCP with any AI Agent Framework

Choose a Framework you want to connect Better Stack MCP with

FAQ

Frequently asked questions

Yes, Better Stack MCP requires you to configure your own Dcr Oauth credentials. Once set up, Composio handles secure credential storage and management for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with Better Stack MCP.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Better Stack MCP tool your agent needs.Free to start.

Start building