Skip to main content

Secure Model Context Protocol server for Rootly APIs with AI SRE capabilities, comprehensive error handling, and input validation

Project description

Rootly MCP Server

PyPI version PyPI - Downloads Python Version

An MCP server for the Rootly API for Cursor, Windsurf, Claude, and other MCP clients.

Demo GIF

Quick Start

Use the hosted MCP server. No local installation required.

Hosted Transport Options

  • Streamable HTTP (recommended): https://mcp.rootly.com/mcp
  • SSE (stable alternative): https://mcp.rootly.com/sse
  • Code Mode: https://mcp.rootly.com/mcp-codemode

General Remote Setup

Default remote config (HTTP streamable):

{
  "mcpServers": {
    "rootly": {
      "url": "https://mcp.rootly.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ROOTLY_API_TOKEN"
      }
    }
  }
}

SSE (alternative):

{
  "mcpServers": {
    "rootly": {
      "url": "https://mcp.rootly.com/sse",
      "headers": {
        "Authorization": "Bearer YOUR_ROOTLY_API_TOKEN"
      }
    }
  }
}

Code Mode:

{
  "mcpServers": {
    "rootly": {
      "url": "https://mcp.rootly.com/mcp-codemode",
      "headers": {
        "Authorization": "Bearer YOUR_ROOTLY_API_TOKEN"
      }
    }
  }
}

Agent Setup

Claude Code

Streamable HTTP

claude mcp add --transport http rootly https://mcp.rootly.com/mcp \
  --header "Authorization: Bearer YOUR_ROOTLY_API_TOKEN"

Code Mode:

claude mcp add rootly-codemode --transport http https://mcp.rootly.com/mcp-codemode \
  --header "Authorization: Bearer YOUR_ROOTLY_API_TOKEN"

SSE (alternative):

claude mcp add --transport sse rootly-sse https://mcp.rootly.com/sse \
  --header "Authorization: Bearer YOUR_ROOTLY_API_TOKEN"

Manual Configuration

Create .mcp.json in your project root:

{
  "mcpServers": {
    "rootly": {
      "type": "http",
      "url": "https://mcp.rootly.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ROOTLY_API_TOKEN"
      }
    }
  }
}

Restart Claude Code after updating the config.

Gemini CLI

Install the extension:

gemini extensions install https://github.com/Rootly-AI-Labs/Rootly-MCP-server

Or configure manually in ~/.gemini/settings.json:

{
  "mcpServers": {
    "rootly": {
      "command": "uvx",
      "args": ["--from", "rootly-mcp-server", "rootly-mcp-server"],
      "env": {
        "ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
      }
    }
  }
}
Cursor

Add to .cursor/mcp.json or ~/.cursor/mcp.json:

{
  "mcpServers": {
    "rootly": {
      "url": "https://mcp.rootly.com/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_ROOTLY_API_TOKEN>"
      }
    }
  }
}
Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "rootly": {
      "serverUrl": "https://mcp.rootly.com/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_ROOTLY_API_TOKEN>"
      }
    }
  }
}
Codex

Add to ~/.codex/config.toml:

[mcp_servers.rootly]
url = "https://mcp.rootly.com/mcp"
bearer_token_env_var = "ROOTLY_API_TOKEN"
Claude Desktop

Add to claude_desktop_config.json:

Note: The --transport http flag ensures HTTP streamable transport is used instead of auto-falling back to SSE.

{
  "mcpServers": {
    "rootly": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.rootly.com/mcp",
        "--transport",
        "http",
        "--header",
        "Authorization: Bearer <YOUR_ROOTLY_API_TOKEN>"
      ]
    }
  }
}

ChatGPT App Starter

The server now includes a built-in ChatGPT app surface for incident exploration.

  • Model-visible app tool: open_rootly_incident_workbench
  • App-only detail tool: get_rootly_incident_detail
  • UI resource: ui://rootly/incident-workbench.html

This gives ChatGPT a visual Rootly incident workbench without needing a separate backend.

What it does

  • Applies structured incident filters such as team, time range, severity, and status
  • Collects a bounded set of incident summaries for the widget
  • Lets the widget open a detailed incident pane without exposing the detail tool to the model

Try it in ChatGPT Developer Mode

Once the MCP server is connected in ChatGPT Developer Mode, try prompts like:

  • Open the Rootly incident workbench for Infrastructure incidents from the last 7 days
  • Show me resolved critical incidents for Infrastructure from April 1 through April 13
  • Open the Rootly incident workbench for database timeout incidents

Production auth note

For internal testing and developer-mode setups, the existing bearer-token flow is enough.

For a public ChatGPT app that exposes customer-specific data or write actions, plan to add OAuth 2.1 support on the MCP side before submission. The current Rootly MCP server forwards bearer tokens, but public Apps SDK submissions expect OAuth 2.1-compatible MCP authorization metadata and token verification.

Rootly CLI

Standalone CLI for incidents, alerts, services, and on-call operations.

Install via Homebrew:

brew install rootlyhq/tap/rootly-cli

Or via Go:

go install github.com/rootlyhq/rootly-cli/cmd/rootly@latest

For more details, see the Rootly CLI repository.

Alternative Installation (Local)

Run the MCP server locally if you do not want to use the hosted service.

Prerequisites

  • Python 3.12 or higher
  • uv package manager
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  • Rootly API token

API Token Types

Choose the token type based on the access you need:

  • Global API Key: Full access across the Rootly instance. Best for organization-wide visibility.
  • Team API Key: Access limited to entities owned by that team.
  • Personal API Key: Access matches the user who created it.

A Global API Key is recommended for organization-wide queries and for actions that modify data, especially when workflows may span multiple teams, schedules, or incidents.

With uv

{
  "mcpServers": {
    "rootly": {
      "command": "uv",
      "args": [
        "tool",
        "run",
        "--from",
        "rootly-mcp-server",
        "rootly-mcp-server"
      ],
      "env": {
        "ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
      }
    }
  }
}

Self-Hosted Transport Options

Choose one transport per server process:

  • Streamable HTTP endpoint path: /mcp
  • SSE endpoint path: /sse
  • Code Mode (experimental) endpoint path: /mcp-codemode in hosted dual-transport mode

Example Docker run (Streamable HTTP):

docker run -p 8000:8000 \
  -e ROOTLY_TRANSPORT=streamable-http \
  -e ROOTLY_API_TOKEN=<YOUR_ROOTLY_API_TOKEN> \
  rootly-mcp-server

Example Docker run (SSE):

docker run -p 8000:8000 \
  -e ROOTLY_TRANSPORT=sse \
  -e ROOTLY_API_TOKEN=<YOUR_ROOTLY_API_TOKEN> \
  rootly-mcp-server

Example Docker run (Dual transport + Code Mode):

docker run -p 8000:8000 \
  -e ROOTLY_TRANSPORT=both \
  -e ROOTLY_API_TOKEN=<YOUR_ROOTLY_API_TOKEN> \
  rootly-mcp-server

With uvx

{
  "mcpServers": {
    "rootly": {
      "command": "uvx",
      "args": [
        "--from",
        "rootly-mcp-server",
        "rootly-mcp-server"
      ],
      "env": {
        "ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
      }
    }
  }
}

Features

  • Dynamic Tool Generation: Automatically creates MCP resources from Rootly's OpenAPI (Swagger) specification
  • Smart Pagination: Uses bounded pagination and compact incident responses to prevent context window overflow
  • API Filtering: Limits exposed API endpoints for security and performance
  • Intelligent Incident Analysis: Smart tools that analyze historical incident data
    • find_related_incidents: Uses TF-IDF similarity analysis to find historically similar incidents
    • suggest_solutions: Mines past incident resolutions to recommend actionable solutions
  • MCP Resources: Exposes incident and team data as structured resources for easy AI reference
  • Intelligent Pattern Recognition: Automatically identifies services, error types, and resolution patterns
  • On-Call Health Integration: Detects workload health risk in scheduled responders

Supported Tools

The default server configuration exposes 110 tools.

Custom Agentic Tools

  • check_oncall_health_risk
  • check_responder_availability
  • collect_incidents
  • create_override_recommendation
  • find_related_incidents
  • getIncident - retrieve a single incident for direct verification, including PIR-related fields
  • get_alert_by_short_id
  • get_oncall_handoff_summary
  • get_oncall_schedule_summary
  • get_oncall_shift_metrics
  • get_server_version
  • get_shift_incidents
  • list_endpoints
  • list_incidents
  • list_shifts
  • open_rootly_incident_workbench
  • search_incidents
  • suggest_solutions
  • updateIncident - scoped incident update tool for summary and retrospective_progress_status

OpenAPI-Generated Tools

attachAlert
createAlert
createEnvironment
createEscalationLevel
createEscalationLevelPaths
createEscalationPath
createEscalationPolicy
createFunctionality
createIncidentActionItem
createIncidentFormFieldSelection
createIncidentType
createOnCallRole
createOnCallShadow
createOverrideShift
createSchedule
createScheduleRotation
createScheduleRotationActiveDay
createScheduleRotationUser
createService
createSeverity
createTeam
createWorkflow
createWorkflowTask
deleteEscalationLevel
deleteEscalationPath
deleteEscalationPolicy
deleteSchedule
deleteScheduleRotation
getAlert
getCurrentUser
getEnvironment
getEscalationLevel
getEscalationPath
getEscalationPolicy
getFunctionality
getIncidentFormFieldSelection
getIncidentType
getOnCallRole
getOnCallShadow
getOverrideShift
getSchedule
getScheduleRotation
getScheduleShifts
getService
getSeverity
getTeam
getUser
getWorkflow
getWorkflowTask
listAlerts
listEnvironments
listEscalationLevels
listEscalationLevelsPaths
listEscalationPaths
listEscalationPolicies
listFunctionalities
listIncidentActionItems
listIncidentAlerts
listIncidentFormFieldSelections
listIncident_Types
listOnCallRoles
listOnCallShadows
listOverrideShifts
listScheduleRotationActiveDays
listScheduleRotationUsers
listScheduleRotations
listSchedules
listServices
listSeverities
listShifts
listTeams
listUsers
listWorkflows
listWorkflowTasks
updateAlert
updateEnvironment
updateEscalationLevel
updateEscalationPath
updateEscalationPolicy
updateFunctionality
updateIncidentFormFieldSelection
updateIncidentType
updateOnCallRole
updateOnCallShadow
updateOverrideShift
updateSchedule
updateScheduleRotation
updateService
updateSeverity
updateTeam
updateUser
updateWorkflow
updateWorkflowTask

Delete operations are intentionally scoped to screenshot coverage paths: deleteSchedule, deleteScheduleRotation, deleteEscalationPolicy, deleteEscalationPath, deleteEscalationLevel.

On-Call Health Integration

Integrates with On-Call Health to detect workload health risk in scheduled responders.

Setup

Set the ONCALLHEALTH_API_KEY environment variable:

{
  "mcpServers": {
    "rootly": {
      "command": "uvx",
      "args": ["--from", "rootly-mcp-server", "rootly-mcp-server"],
      "env": {
        "ROOTLY_API_TOKEN": "your_rootly_token",
        "ONCALLHEALTH_API_KEY": "och_live_your_key"
      }
    }
  }
}

Usage

check_oncall_health_risk(
    start_date="2026-02-09",
    end_date="2026-02-15"
)

Returns at-risk users who are scheduled, recommended safe replacements, and action summaries.

Example Skills

Pre-built Claude Code skills:

🚨 Rootly Incident Responder

This skill:

  • Analyzes production incidents with full context
  • Finds similar historical incidents using ML-based similarity matching
  • Suggests solutions based on past successful resolutions
  • Coordinates with on-call teams across timezones
  • Correlates incidents with recent code changes and deployments
  • Creates action items and remediation plans
  • Provides confidence scores and time estimates

Quick Start:

# Copy the skill to your project
mkdir -p .claude/skills
cp examples/skills/rootly-incident-responder.md .claude/skills/

# Then in Claude Code, invoke it:
# @rootly-incident-responder analyze incident #12345

It demonstrates a full incident response workflow using Rootly tools and GitHub context.

On-Call Shift Metrics

Get on-call shift metrics for any time period, grouped by user, team, or schedule. Includes primary/secondary role tracking, shift counts, hours, and days on-call.

get_oncall_shift_metrics(
    start_date="2025-10-01",
    end_date="2025-10-31",
    group_by="user"
)

On-Call Handoff Summary

Complete handoff: current/next on-call + incidents during shifts.

# All on-call (any timezone)
get_oncall_handoff_summary(
    team_ids="team-1,team-2",
    timezone="America/Los_Angeles"
)

# Regional filter - only show APAC on-call during APAC business hours
get_oncall_handoff_summary(
    timezone="Asia/Tokyo",
    filter_by_region=True
)

Regional filtering shows only people on-call during business hours (9am-5pm) in the specified timezone.

Returns: schedules with current_oncall, next_oncall, and shift_incidents

Shift Incidents

Incidents during a time period, with filtering by severity/status/tags.

get_shift_incidents(
    start_time="2025-10-20T09:00:00Z",
    end_time="2025-10-20T17:00:00Z",
    severity="critical",  # optional
    status="resolved",    # optional
    tags="database,api"   # optional
)

Returns: incidents list + summary (counts, avg resolution time, grouping)

Contributing

See CONTRIBUTING.md for developer setup and guidelines.

Play with it on Postman

Run In Postman

About Rootly AI Labs

This project was developed by Rootly AI Labs, where we're building the future of system reliability and operational excellence. As an open-source incubator, we share ideas, experiment, and rapidly prototype solutions that benefit the entire community. Rootly AI logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rootly_mcp_server-2.2.18.tar.gz (6.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rootly_mcp_server-2.2.18-py3-none-any.whl (102.3 kB view details)

Uploaded Python 3

File details

Details for the file rootly_mcp_server-2.2.18.tar.gz.

File metadata

  • Download URL: rootly_mcp_server-2.2.18.tar.gz
  • Upload date:
  • Size: 6.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for rootly_mcp_server-2.2.18.tar.gz
Algorithm Hash digest
SHA256 99f5cd2794f440569b2613a7b1506d79c50ba14951e6f38fc63353d58ee4e755
MD5 fde4c6bb8e5f521a01f84357652785af
BLAKE2b-256 17a478acfb7b75353f516a62e858c16c574d589dcf15663b10fe5ad04890e65d

See more details on using hashes here.

File details

Details for the file rootly_mcp_server-2.2.18-py3-none-any.whl.

File metadata

File hashes

Hashes for rootly_mcp_server-2.2.18-py3-none-any.whl
Algorithm Hash digest
SHA256 adad90a4afce8ae2aeb97f30376d17dcbe92449f26d4ee5a0d95da493fa043ca
MD5 e4dd0506bb03b61466978f08647ca8fe
BLAKE2b-256 2b0225abd0622aac4c00da9b2c446ffbdf92f9e5032025c240418c75918b8ba5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page