Sentry MCP server

Integrates with Sentry's error tracking platform to enable detailed issue analysis, project management, and user session replay for enhanced debugging and monitoring in software development environments.
Back to servers
Setup instructions
Provider
Cody De Arkland
Release date
Mar 05, 2025
Language
TypeScript
Stats
19 stars

The Sentry MCP Server provides a Model Context Protocol server for interacting with Sentry, allowing AI assistants to retrieve and analyze error data, manage projects, and monitor application performance through the Sentry API.

Installation Requirements

Before you begin, ensure you have:

  • Node.js (v14 or higher)
  • npm or yarn package manager
  • Sentry account with API access
  • Sentry authentication token with appropriate permissions

Installation

Install the required dependencies:

npm install

Configuration

Setting Up with Claude

To configure the MCP server with Claude, add the following to your Claude settings:

{
    "mcpServers": {
        "sentry": {
            "command": "npx",
            "args": ["ts-node", "/Users/<your-user-directory>/mcp-sentry-ts/index.ts"],
            "env": {
                "SENTRY_AUTH": "<YOUR_AUTH_TOKEN>"
            }
        }
    }
}

Important configuration notes:

  • Update the path in the args field to match your actual directory
  • Replace <YOUR_AUTH_TOKEN> with your Sentry authentication token

Running the Server

Start the MCP server with:

npx ts-node index.ts

Available Tools

Project Management

list_projects

Lists all accessible Sentry projects for a given organization.

Parameters:

  • organization_slug (string, required): Organization slug
  • view (string, optional): "summary" or "detailed" (default: "detailed")
  • format (string, optional): "plain" or "markdown" (default: "markdown")

create_project

Creates a new project in Sentry and retrieves its client keys.

Parameters:

  • organization_slug (string, required): Organization slug
  • team_slug (string, required): Team slug to assign the project to
  • name (string, required): Project name
  • platform (string, optional): Platform type
  • view (string, optional): "summary" or "detailed" (default: "detailed")
  • format (string, optional): "plain" or "markdown" (default: "markdown")

Issue Management

resolve_short_id

Retrieves details about an issue using its short ID.

Parameters:

  • organization_slug (string, required): Organization slug
  • short_id (string, required): Issue short ID (e.g., PROJECT-123)
  • format (string, optional): "plain" or "markdown" (default: "markdown")

get_sentry_issue

Retrieves and analyzes a Sentry issue.

Parameters:

  • issue_id_or_url (string, required): Full Sentry issue URL or numeric issue ID
  • view (string, optional): "summary" or "detailed" (default: "detailed")
  • format (string, optional): "plain" or "markdown" (default: "markdown")

list_project_issues

Lists issues from a specific Sentry project.

Parameters:

  • organization_slug (string, required): Organization slug
  • project_slug (string, required): Project slug
  • view (string, optional): "summary" or "detailed" (default: "detailed")
  • format (string, optional): "plain" or "markdown" (default: "markdown")

Event Management

get_sentry_event

Retrieves and analyzes a specific Sentry event from an issue.

Parameters:

  • issue_id_or_url (string, required): Full Sentry issue URL or numeric issue ID
  • event_id (string, required): Specific event ID to retrieve
  • view (string, optional): "summary" or "detailed" (default: "detailed")
  • format (string, optional): "plain" or "markdown" (default: "markdown")

list_error_events_in_project

Lists error events from a specific Sentry project.

Parameters:

  • organization_slug (string, required): Organization slug
  • project_slug (string, required): Project slug
  • view (string, optional): "summary" or "detailed" (default: "detailed")
  • format (string, optional): "plain" or "markdown" (default: "markdown")

list_issue_events

Lists events for a specific Sentry issue.

Parameters:

  • organization_slug (string, required): Organization slug
  • issue_id (string, required): Issue ID
  • view (string, optional): "summary" or "detailed" (default: "detailed")
  • format (string, optional): "plain" or "markdown" (default: "markdown")

Session Replay

list_organization_replays

Lists replays from a specific Sentry organization.

Parameters:

  • organization_slug (string, required): Organization slug
  • project_ids (string[], optional): List of project IDs for filtering
  • environment (string, optional): Environment filter
  • stats_period (string, optional): Time period (e.g., "24h", "7d")
  • start (string, optional): Start date for filtering
  • end (string, optional): End date for filtering
  • sort (string, optional): Field to sort by
  • query (string, optional): Search query
  • per_page (number, optional): Number of replays per page
  • cursor (string, optional): Pagination cursor
  • view (string, optional): "summary" or "detailed" (default: "detailed")
  • format (string, optional): "plain" or "markdown" (default: "markdown")

IDE Compatibility

This MCP has been verified to work with Codeium Windsurf. Note that Cursor currently has issues with its MCP implementation, and this tool may not be fully functional with it.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "sentry" '{"command":"npx","args":["ts-node","index.ts"],"env":{"SENTRY_AUTH":"${SENTRY_AUTH_TOKEN}"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "sentry": {
            "command": "npx",
            "args": [
                "ts-node",
                "index.ts"
            ],
            "env": {
                "SENTRY_AUTH": "${SENTRY_AUTH_TOKEN}"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "sentry": {
            "command": "npx",
            "args": [
                "ts-node",
                "index.ts"
            ],
            "env": {
                "SENTRY_AUTH": "${SENTRY_AUTH_TOKEN}"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later