Skip to main content
Glama
elad12390

Sentry MCP Server

by elad12390

Sentry MCP Server

Forked from elad12390/loki-mcp — retargeted from Grafana Loki to Sentry. Same "few sharp tools, no config" ergonomics, new backend. This repo keeps the original's git history.

An MCP server to easily search and analyze Sentry issues, events, and traces — without writing Sentry queries or clicking through the UI.

This is a focused, fast alternative to the official Sentry MCP: a small, predictable tool set modeled on a battle-tested log-search MCP, talking directly to the Sentry REST API.

Quick Start

You can run this server directly using npx:

export SENTRY_AUTH_TOKEN="sntryu_..."      # Sentry auth token (see Configuration)
export SENTRY_URL="https://us.sentry.io"   # your region/host (default: https://sentry.io)
export SENTRY_ORG="my-org"                  # optional; auto-detected if omitted

npx @elad12390/sentry-mcp

Related MCP server: Glitchtip MCP Server

Features

This MCP server provides 4 tools, 3 resources, and 3 prompts. AI assistants automatically understand when to use each based on natural language.

Tools

🔍 sentry_search_issues — Your primary search tool

  • Just say: "check sentry", "what's breaking", "show me errors", "unresolved issues", "top errors", "how many errors"

  • Searches grouped issues across ALL projects automatically (or filter by project)

  • Uses Sentry search syntax in query (is:unresolved level:error, release:latest, free text)

  • Set count=true for event counts + an ASCII trend chart instead of the issue list

🔗 sentry_trace_lookup — Distributed tracing

  • Just say: "follow this trace", "what happened in this request", "trace this id across services"

  • Returns every span and error in a trace, grouped by service, as a timeline

🔎 sentry_get_issue_details — Root cause analysis

  • Just say: "show the stack trace", "what happened before this error", "why did this fail"

  • Returns the exception + stack trace, the breadcrumbs (what happened right before), request context, tags, and the trace ID

🧩 sentry_pattern_analysis — Group & rank error patterns

  • Just say: "group similar errors", "what error types", "do we have one problem or many"

  • Ranks issue groups by event volume and merges near-duplicate titles into higher-level patterns

Resources (Read-only Data)

sentry://projects — List all projects in the org

  • Read this first to know what you can filter by

sentry://tags — List all tag keys (searchable metadata)

  • Shows what you can filter by (environment, release, browser, etc.)

sentry://tags/{key}/values — Get values for a specific tag

  • Example: sentry://tags/environment/values

Prompts (Guided Workflows)

debug-error — Search the issue, pull stack trace + breadcrumbs, gauge blast radius

  • Arguments: error_text (required), project, time_window

trace-request — Follow a trace ID across services

  • Arguments: trace_id (required), time_window

health-check — List projects, count errors + trend, find dominant patterns

  • Arguments: project, time_window

Usage Tips for AI Assistants

When the user says "check sentry" or "what's broken", you should:

  1. Read sentry://projects if you don't know what projects exist

  2. Use sentry_search_issues as your primary tool — it works across all projects

  3. Follow up with sentry_get_issue_details on an interesting issue for the stack trace + breadcrumbs

  4. Use sentry_search_issues with count=true when they ask "how many" / "is it getting worse"

  5. Use sentry_pattern_analysis during incidents to see if it's one problem or many

For complex debugging, use the prompts: debug-error, trace-request, health-check.

Example Conversations

User: "Check sentry for errors in the python-fastapi project" AI: Uses sentry_search_issues with project="python-fastapi", query="is:unresolved"

User: "How many errors happened today?" AI: Uses sentry_search_issues with count=true, time_window="24h"

User: "Why is PYTHON-FASTAPI-TK failing?" AI: Uses sentry_get_issue_details with the issue id

User: "Follow trace ce8f0d3961214198a040517b3dfda0d4" AI: Uses sentry_trace_lookup

Configuration

Set the following environment variables:

  • SENTRY_AUTH_TOKEN (required): A Sentry auth token. Create one at Settings → Auth Tokens (organization token) or User Settings → Personal Tokens. Required scopes: org:read, project:read, event:read.

  • SENTRY_URL: Base URL of your Sentry instance. Default https://sentry.io. SaaS users on a specific region should use https://us.sentry.io, https://de.sentry.io, etc. Self-hosted: your own host.

  • SENTRY_ORG: Organization slug. Optional — if omitted, the first org the token can access is auto-detected.

  • SENTRY_PROJECT: Default project slug used for tag-value lookups. Optional — defaults to the first project in the org.

Development

bun install
bun run build
bun test

See AGENTS.md for code style and contribution notes.

Available Tools

4 tools
sentry_get_issue_detailsA

🔎 ROOT CAUSE TOOL - Use when the user asks: 'what happened before this error', 'show the stack trace', 'get context', 'why did this fail', 'details of this issue', 'what led to this', or as a follow-up after finding an interesting issue with sentry_search_issues. Fetches the full picture of one issue: summary (level, counts, first/last seen), the exception + stack trace, the BREADCRUMBS (the chronological events leading UP TO the error - the equivalent of 'logs before'), request context, tags, and the trace ID for cross-service investigation.

ParametersJSON Schema
NameRequiredDescriptionDefault
eventNoWhich event to inspect: 'latest' (default), 'oldest', 'recommended', or a specific event ID.
issue_idYesThe numeric Sentry issue ID (the 'id' field from sentry_search_issues results, e.g. '7244297102').
reasoningYesExplanation of why you are inspecting this issue.
max_framesNoHow many stack frames to show per exception (innermost first). Default: 15.
max_breadcrumbsNoHow many of the most recent breadcrumbs (events before the error) to show. Default: 20.

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It details what information is returned (summary, stack trace, breadcrumbs, etc.) and explains breadcrumbs as 'chronological events leading UP TO the error'. It does not mention potential limitations like rate limits or output size, but covers core behavioral traits well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is moderately long but well-structured with an opening emoji marker, clear sections, and a list of triggers. Every sentence contributes to understanding. Could be slightly more concise, but still efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema is provided, but the description lists the return components (summary, stack trace, breadcrumbs, etc.). With 5 parameters fully described in schema, the description provides enough context for an agent to know what the tool does and what to expect. Lacks details on output structure but sufficient given no schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds value by explaining the purpose of breadcrumbs and frames (e.g., 'how many stack frames to show per exception (innermost first)') and emphasizing that 'reasoning' is for explanation. This extra context helps the agent understand parameter usage beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'ROOT CAUSE TOOL' and lists specific user queries that trigger it. It explicitly describes what is fetched (summary, stack trace, breadcrumbs, etc.) and distinguishes from sibling tools like sentry_search_issues and sentry_trace_lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit triggers for usage (e.g., 'what happened before this error', 'show the stack trace') and suggests it as a follow-up after sentry_search_issues. It implicitly contrasts with sibling tools but does not explicitly state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sentry_pattern_analysisA

🧩 Use when the user asks: 'group similar errors', 'what error patterns', 'types of errors', 'categorize errors', 'what's the breakdown', 'do we have one problem or many', or during an incident. Sentry already groups events into issues; this tool ranks those issue groups by event volume and merges near-duplicate issue titles (stripping IDs/UUIDs/numbers) into higher-level patterns. ESSENTIAL for incident triage - instantly see whether you have 1 dominant problem or 50 different ones, and which patterns drive the most events.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax issue groups to scan. Default: 100 (max 100).
queryNoSentry search query to scope the analysis. Default: 'is:unresolved'.
projectNoOptional project slug to scope to one project. Omit for all projects.
reasoningYesExplanation of why you are analyzing patterns.
environmentNoOptional environment filter (e.g. 'production').
time_windowNoHow far back to analyze (statsPeriod). Default: '14d'.
min_occurrencesNoOnly show patterns whose combined event count is at least this. Default: 1.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses the merging of near-duplicates by stripping IDs, ranking by event volume, and that it's for incident triage. Does not explicitly state side effects, but as a read/analysis tool, it's sufficiently transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with use cases front-loaded and explanation following. Slightly verbose but every sentence adds value; could be trimmed slightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately describes the high-level output (patterns and event volumes). For a tool with 7 parameters, it covers the what, why, and how-to-use effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers all 7 parameters with descriptions (100% coverage). The tool description adds no extra semantic value beyond the schema; baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it ranks issue groups by event volume and merges near-duplicates into patterns. It distinguishes from siblings by explicitly carving out use cases for pattern analysis vs. individual issue details or search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit trigger phrases ('group similar errors', etc.) and states it's essential for incident triage. Lacks explicit 'when not to use', but the use cases are well-defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sentry_search_issuesA

🔍 THE PRIMARY SENTRY SEARCH TOOL - Use this when the user asks to: 'check sentry', 'look at errors', 'search sentry', 'what's breaking', 'show me errors', 'find this exception', 'any new crashes', 'unresolved issues', 'top errors', 'how many errors', 'error rate', or 'error trend'. Searches grouped issues across the whole org automatically (no project needed) or filtered by a specific project. Uses Sentry search syntax in query (e.g. 'is:unresolved level:error', 'is:unresolved release:latest', free text like a message or exception type). Set count=true to get error event COUNTS and a TREND chart over time instead of the issue list.

ParametersJSON Schema
NameRequiredDescriptionDefault
sortNoSort order: 'date' (last seen), 'freq' (most frequent), 'new' (first seen), 'user' (most users affected). Default: 'date'.
countNoWhen true, returns the COUNT and TREND of matching error events over time (total, peak, ASCII chart) instead of an issue list. Perfect for 'how many errors?' / 'is it getting worse?'.
limitNoMax number of issues to return. Default: 25 (max 100).
queryNoSentry search query. Default: 'is:unresolved'. Examples: 'is:unresolved level:error', 'is:unresolved is:for_review', 'release:latest', 'environment:production', or free text like 'TypeError' or 'connection timeout'. In count=true mode this is an EVENT filter (is:* tokens are ignored), e.g. 'level:error'.
projectNoOptional project slug to filter to a single project (e.g. 'python-fastapi'). Omit to search ALL projects in the org. Read sentry://projects to list them.
intervalNoBucket size for count mode. Examples: '5m', '1h', '1d'. Default: '1h'.
reasoningYesExplanation of why you are using this tool and what you hope to find.
environmentNoOptional environment filter (e.g. 'production', 'staging').
time_windowNoHow far back to search FROM NOW (Sentry statsPeriod). Examples: '1h', '24h', '7d', '14d', '90d'. Default: '14d'.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully carries the burden of behavioral transparency. It discloses key behaviors: automatically searches across all projects unless a project slug is provided, uses Sentry search syntax, default queries and limits, and that count mode returns counts/trends with an ASCII chart. It also notes that in count mode 'is:*' tokens are ignored. Missing details about pagination or rate limits, but overall transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured, starting with a bold purpose statement followed by details. It is somewhat lengthy but every sentence adds value, covering usage, syntax, and special modes. It could be slightly more concise, but the current length is justified by the richness of information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 9 parameters, no output schema, and moderate complexity, the description provides a strong understanding of how to use the tool. It explains default behaviors, query syntax, count mode, and filters. While it doesn't detail the output format of issue lists or error handling, it covers the essential aspects for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, yet the description adds substantial value beyond the schema. It provides concrete examples for 'query', explains the return type for 'count', directs users to 'sentry://projects' for project slugs, and explains the statsPeriod format for 'time_window'. The 'reasoning' parameter is explained as a justification for tool usage. This greatly enhances parameter understandability.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states it is 'THE PRIMARY SENTRY SEARCH TOOL' and lists numerous user intents (e.g., 'check sentry', 'look at errors', 'search sentry'). It clearly explains that it searches grouped issues across the whole org or filtered by project, uses Sentry search syntax, and has a count mode. This effectively differentiates it from sibling tools like sentry_get_issue_details or sentry_pattern_analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance on when to use this tool by listing example user requests ('check sentry', 'look at errors', etc.). It also explains the count mode for getting counts/trends. However, it does not explicitly state when not to use it or name alternative tools, though the context implies it is for issue searches.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sentry_trace_lookupA

🔗 TRACE ID LOOKUP TOOL - Use when the user mentions a Sentry trace ID (a 32-char hex string like 'ce8f0d3961214198a040517b3dfda0d4') or asks: 'find this trace', 'what happened in this request', 'follow this trace across services', 'what services touched this request', 'show the trace timeline', or 'distributed trace'. CRITICAL: when a user pastes a trace ID and asks to find/follow it, use THIS tool - not search_issues. It returns every span and error across all projects/services that participated in the trace, grouped by service with a timeline.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax trace items to include in the timeline. Default: 100.
trace_idYesThe 32-character hexadecimal Sentry trace ID to look up.
reasoningYesExplanation of why you are using this tool and what you hope to find.
time_windowNoHow far back to search (Sentry statsPeriod). Examples: '24h', '7d', '14d'. Default: '14d'.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Describes return structure (spans, errors, grouped by service with timeline). No annotations exist, so this adds useful behavioral context, though more details on limitations or edge cases could enhance transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is somewhat verbose with emoji and all-caps emphasis. While front-loaded, it could be more concise and structured without sacrificing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite lacking output schema and annotations, description covers key aspects: purpose, usage, expected output. Missing details on performance implications or error handling, but adequate for a well-scoped tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, baseline 3. Description does not add significant meaning beyond the schema's own parameter descriptions; it only reiterates context already present in schema fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool is for Sentry trace ID lookup, provides example user queries, and explicitly distinguishes from the sibling 'search_issues' tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use scenarios (mention of trace ID, specific user phrases) and a critical exclusion ('not search_issues'), guiding correct agent selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedsentry_get_issue_details
    • First observedsentry_pattern_analysis
    • First observedsentry_search_issues
    • First observedsentry_trace_lookup

TDQS

A4.1/5.0

Scored across 4 tools

Disambiguation5/5

Each tool serves a distinct purpose: searching issues, getting full details, analyzing patterns, and looking up traces. There is no overlap or confusion between tool functionalities.

Naming Consistency4/5

All tools consistently use 'sentry_' prefix and snake_case. However, 'pattern_analysis' lacks a verb (unlike 'get', 'search', 'trace'), making it slightly inconsistent. Overall pattern is clear.

Tool Count4/5

With 4 tools, the set covers the primary investigation and analysis actions for Sentry. It is well-scoped, though it might feel slightly minimal for a platform with many features.

Completeness3/5

The tools cover search, detail retrieval, pattern analysis, and trace lookup, which are core for investigation. Missing are issue management operations like update or resolve, which limits completeness for full lifecycle.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    Enables AI-powered analytics for OpenReplay user sessions through natural language queries. Supports session search, user journey analysis, error tracking, performance metrics, and funnel analysis to understand user behavior patterns.
    11
    2
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables interaction with Glitchtip error tracking platform through natural language. Provides access to issues, events, projects, teams, and organization management for comprehensive error monitoring and debugging.
    7
    33 npm
    3
    AGPL 3.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables interaction with Sentry's error tracking and monitoring tools through a unified API, allowing natural language access to Sentry services.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to retrieve and analyze Sentry issues, including error reports, stacktraces, and debugging information from Sentry.io.
    6 npm
    1
    MIT