MCP.so
登录

Sentry MCP Server (Official)

@getsentry

基本信息

分类

开发工具

许可证

NOASSERTION

传输方式

stdio

作者

getsentry

关于 Sentry MCP Server

一个通过 LLM 与 Sentry 交互的 MCP 服务器。

#tag-production#mcp-server

Sentry MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "sentry-mcp": {
      "command": "npx",
      "args": [
        "@sentry/mcp-server@latest",
        "--access-token=sentry-user-token"
      ]
    }
  }
}

Sentry MCP Server 工具

9

Find organizations that the user has access to in Sentry. Use this tool when you need to: - View organizations in Sentry - Find an organization's slug to aid other tool requests - Search for specific organizations by name or slug Returns up to 25 results. If you hit this limit, use the query parameter to narrow down results.

Find projects in Sentry. Use this tool when you need to: - View projects in a Sentry organization - Find a project's slug to aid other tool requests - Search for specific projects by name or slug Returns up to 25 results. If you hit this limit, use the query parameter to narrow down results.

Update a Sentry issue's status or assignment. Use this to resolve, reopen, assign, or ignore an issue. <examples> ``` update_issue(organizationSlug='my-org', issueId='PROJECT-123', status='resolved') update_issue(organizationSlug='my-org', issueId='PROJECT-123', assignedTo='user:123456') update_issue(organizationSlug='my-org', issueId='PROJECT-123', status='ignored') update_issue(organizationSlug='my-org', issueId='PROJECT-123', status='ignored', ignoreMode='forever') update_issue(organizationSlug='my-org', issueId='PROJECT-123', status='ignored', ignoreMode='untilOccurrenceCount', ignoreCount=100, ignoreWindowMinutes=60) update_issue(organizationSlug='my-org', issueId='PROJECT-123', status='ignored', reason='Ignoring because this is expected noise from the staging deploy') ``` </examples> <hints> - Provide `issueUrl` or `organizationSlug` + `issueId`. - At least one of `status` or `assignedTo` is required. - `assignedTo` format: `user:ID` or `team:ID_OR_SLUG`. - Use `execute_sentry_tool(name='whoami', arguments={})` to find your user ID for self-assignment. - Status values: `resolved`, `resolvedInNextRelease`, `unresolved`, `ignored`. - `status='ignored'` defaults to `ignoreMode='untilEscalating'`. - Ignore modes: `untilEscalating`, `forever`, `forDuration`, `untilOccurrenceCount`, `untilUserCount`. - Matching ignore inputs are `ignoreDurationMinutes`, `ignoreCount` + optional `ignoreWindowMinutes`, or `ignoreUserCount` + optional `ignoreUserWindowMinutes`. - To switch an already ignored issue between `untilEscalating`, `forever`, and condition-based ignore modes, first set `status='unresolved'`, then ignore it again with the new rule. - `reason` is optional. When provided, it will be posted as a comment on the issue's activity feed explaining why the action was taken. </hints>

Search Sentry events and replays. Use for event counts/statistics. `query` can be natural language or Sentry search syntax. With an agent configured, it fixes dataset, query, fields, and sort before running. Supports TWO query types: 1. AGGREGATIONS (counts, sums, averages): 'how many errors', 'total tokens' 2. Individual events with timestamps: 'error logs from last hour' Datasets: - errors: Exception/crash events with stack traces, usually grouped into issues - logs: Application log entries, including error-severity log messages - spans: Raw trace/span events for performance, AI/LLM calls, requests, and operations - metrics: Metric rows and aggregates: counters, gauges, distributions, values - profiles: Transaction/continuous profile results, profile IDs, profiled transactions - replays: Session replay results: rage clicks, dead clicks, visited pages, replay users If the user says logs, log messages, error logs, or warning logs, choose logs instead of errors. Replay searches return replay lists only; replay count()/avg()/sum() are not supported. NOT for grouped issue lists (use search_issues) or app screenshots/images (use get_latest_base_snapshot). <examples> search_events(organizationSlug='my-org', query='how many errors today') search_events(organizationSlug='my-org', dataset='errors', query='level:error') search_events(organizationSlug='my-org', dataset='errors', fields=['issue', 'count()'], sort='-count()') search_events(organizationSlug='my-org', dataset='spans', query='span.op:db', sort='-span.duration') search_events(organizationSlug='my-org', dataset='replays', query='count_errors:>0', sort='-count_errors') </examples> <hints> - If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlug>. - Parse org/project notation directly without calling find_organizations or find_projects. - Use fields with aggregate functions like count(), avg(), sum() for statistics - Sort by -count() for most common, -timestamp for newest </hints>

Use Seer to analyze production errors and get detailed root cause analysis with specific code fixes. Use this tool when: - The user explicitly asks for root cause analysis, Seer analysis, or help fixing/debugging an issue - You are unable to accurately determine the root cause from the issue details alone Do NOT call this tool as an automatic follow-up to get_sentry_resource. What this tool provides: - Root cause analysis with code-level explanations - Specific file locations and line numbers where errors occur - Concrete code fixes you can apply - Step-by-step implementation guidance This tool automatically: 1. Checks if analysis already exists (instant results) 2. Starts new AI analysis if needed (~2-5 minutes) 3. Returns complete fix recommendations <examples> ### User: "Run Seer on this issue" ``` analyze_issue_with_seer(issueUrl='https://my-org.sentry.io/issues/PROJECT-1Z43') ``` ### User: "Analyze this issue and suggest a fix" ``` analyze_issue_with_seer(organizationSlug='my-organization', issueId='ERROR-456') ``` </examples> <hints> - Only use when the user explicitly requests analysis or you cannot determine the root cause from issue details alone - Seer Autofix does not support metric alert issues (issueCategory: metric); use get_issue_details and search_events instead - If the user provides an issueUrl, extract it and use that parameter alone - The analysis includes actual code snippets and fixes, not just error descriptions - Results are cached - subsequent calls return instantly </hints>

Search for grouped issues/problems in Sentry - returns a LIST of issues, NOT counts or aggregations. Provide `query` as natural language or Sentry issue search syntax. When an embedded agent is configured, it fixes query and sort before running while preserving explicit Sentry search syntax. Returns grouped issues with metadata like title, status, and user count. Common Query Syntax: - is:unresolved / is:resolved / is:ignored / is:for_review / is:new / is:regressed / is:escalating - level:error / level:warning - firstSeen:-24h / lastSeen:-7d - assigned:me / assigned_or_suggested:me - release:latest - issue.category:feedback - issue.priority:high - environment:production - userCount:>100 DO NOT USE FOR COUNTS/AGGREGATIONS → use search_events DO NOT USE FOR individual events with timestamps → use search_events DO NOT USE FOR details about a specific issue → use get_sentry_resource <examples> search_issues(organizationSlug='my-org', query='critical bugs from last week') search_issues(organizationSlug='my-org', query='is:unresolved is:unassigned', sort='freq') search_issues(organizationSlug='my-org', query='level:error firstSeen:-24h', projectSlugOrId='my-project') </examples> <hints> - If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlugOrId>. - Parse org/project notation directly without calling find_organizations or find_projects. - The projectSlugOrId parameter accepts both project slugs (e.g., 'my-project') and numeric IDs (e.g., '123456'). </hints>

Fetch a Sentry resource by URL, or by resourceType plus resourceId. Pass a Sentry URL directly when possible; the resource type is auto-detected. Supports issues, events, traces, spans, AI conversations, breadcrumbs, replays, monitors, preprod snapshots, and snapshot images. Trace lookups return a condensed overview by default. AI Conversations: A conversation is a set of spans sharing the same gen_ai.conversation.id. Use resourceType='ai_conversation' with a conversation ID, or pass a Sentry conversation URL, to fetch the transcript/details. To discover or list conversations, use search_ai_conversations. Conversations are NOT issues — do not use search_issues for conversation queries. For preprod snapshot URLs (matching 'sentry.io/preprod/snapshots/'): - Without ?selectedSnapshot=: returns the snapshot diff summary (changed, added, removed images) - With ?selectedSnapshot=<image_file_name>: returns the image preview and metadata. Use the Sentry tool `get_snapshot_image` for full-resolution image bytes. Resource IDs: - span: <traceId>:<spanId> - monitor: <monitorSlug> - snapshot: <snapshotId> - snapshotImage: <snapshotId>:<image_file_name> <examples> get_sentry_resource(url='https://sentry.io/issues/PROJECT-123/') get_sentry_resource(resourceType='issue', organizationSlug='my-org', resourceId='PROJECT-123') get_sentry_resource(resourceType='span', organizationSlug='my-org', resourceId='<traceId>:<spanId>') get_sentry_resource(resourceType='ai_conversation', organizationSlug='my-org', resourceId='conversation-123') get_sentry_resource(url='https://sentry.sentry.io/preprod/snapshots/123/') get_sentry_resource(url='https://sentry.sentry.io/preprod/snapshots/123/?selectedSnapshot=login_screen.png') </examples>

Search the available Sentry MCP tool catalog by name and description. Many Sentry operations are intentionally not exposed as top-level tools. Use this for any Sentry-related task when you do not see an obvious direct tool, including long-tail inspection, project management, documentation lookup, preprod snapshots, attachments, DSNs, releases, teams, and issue-specific pivots. Use this tool when you need to: - Find the right Sentry operation for a task - Discover catalog tools and their schemas for a task - Inspect the executable JSON input schema for an available tool <examples> search_sentry_tools(query='list projects') search_sentry_tools(query='issue details') search_sentry_tools(query='find dsn', limit=5) search_sentry_tools(query='snapshot image') </examples> <hints> - Results only include tools available in the current session. - If a Sentry operation is not listed as a direct tool, search here before deciding it is unavailable. - Returned schemas already account for active organization, project, and region constraints. - Use the returned name and schema when executing a catalog result. - This tool returns structured JSON. Do not parse markdown from its text content. </hints>

Execute an available Sentry MCP tool discovered through search_sentry_tools. Use this tool when you need to: - Call a Sentry operation returned by search_sentry_tools - Execute a tool by name using arguments that match its returned schema <examples> execute_sentry_tool(name='find_projects', arguments={ organizationSlug: 'my-org' }) execute_sentry_tool(name='whoami', arguments={}) </examples> <hints> - Use search_sentry_tools first if you are not sure which name or arguments to pass. - Arguments are validated against the target tool's schema before execution. - Active organization, project, and region constraints are injected automatically. </hints>

概览

什么是 Sentry MCP Server (Official)?

Sentry MCP Server (Official) 是 Sentry 官方推出的 Sentry MCP 服务器,通过 Model Context Protocol 把 Claude Code、Cursor、VS Code 等 AI 编程助手连接到你在 Sentry 中的错误、issue、trace 和性能数据。

它由 Sentry 在 getsentry/sentry-mcp 仓库中维护,主要以托管的远程服务形式运行在 https://mcp.sentry.dev/mcp,使用 OAuth 登录。Sentry 表示,其工具选择侧重于有人参与的调试工作流,而不是暴露 Sentry 的全部 API。它还提供 stdio 传输方式,以 @sentry/mcp-server 发布在 npm 上,这也是对接自托管 Sentry 最简单的方式。

如何使用 Sentry MCP Server (Official)?

你需要一个 Sentry 账号。托管服务器无需安装任何东西:首次连接时会在浏览器中打开 OAuth 流程,关联你的 Sentry 账号。

基础端点是 https://mcp.sentry.dev/mcp。你可以将其限定到某个组织(https://mcp.sentry.dev/mcp/{organizationSlug})或某个项目(https://mcp.sentry.dev/mcp/{organizationSlug}/{projectSlug})。限定范围后,工具会默认使用该组织或项目,并隐藏不需要的发现类工具;Sentry 建议尽可能限定到项目。在 URL 后加 ?experimental=1 可启用实验性工具变体。

Claude Code

通过 HTTP 添加远程服务器:

claude mcp add --transport http sentry https://mcp.sentry.dev/mcp/{organizationSlug}/{projectSlug}

或者安装 Claude Code 插件。它会添加一个 sentry-mcp 子代理,当你询问 Sentry 错误、issue、trace 或性能问题时,Claude 会自动委派给它:

claude plugin marketplace add getsentry/sentry-mcp
claude plugin install sentry-mcp@sentry-mcp

Cursor

使用 mcp.sentry.dev 上的 "Install MCP Server" 按钮,或在 MCP 设置中添加:

{
  "mcpServers": {
    "sentry": {
      "url": "https://mcp.sentry.dev/mcp/{organizationSlug}/{projectSlug}"
    }
  }
}

VS Code

打开命令面板,运行 "MCP: Add Server",选择 HTTP,然后输入 https://mcp.sentry.dev/mcp/{organizationSlug}/{projectSlug}。

Claude Desktop 及其他 stdio 客户端

对于启动本地服务器的客户端(或自托管 Sentry),先创建一个带有以下权限范围的 Sentry User Auth Token:org:read、project:read、project:write、team:read、team:write 和 event:write,然后使用 stdio 包:

{
  "mcpServers": {
    "sentry": {
      "command": "npx",
      "args": ["@sentry/mcp-server"],
      "env": {
        "SENTRY_ACCESS_TOKEN": "your-token",
        "EMBEDDED_AGENT_PROVIDER": "openai",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

LLM 提供商相关变量只在使用 AI 驱动的搜索工具时才需要。你也可以直接运行:

npx @sentry/mcp-server@latest --access-token=sentry-user-token

自托管 Sentry 请加上 --host=sentry.example.com(只填主机名);如果部署只提供纯 HTTP,再加上 --insecure-http。

使用显式令牌连接远程服务器

支持自定义请求头的客户端可以跳过 OAuth,直接传入 Sentry API 令牌:

{
  "mcpServers": {
    "sentry": {
      "url": "https://mcp.sentry.dev/mcp",
      "headers": {
        "Authorization": "Sentry-Bearer ${SENTRY_ACCESS_TOKEN}"
      }
    }
  }
}

Sentry MCP Server (Official) 的主要功能

  • 由 Sentry(getsentry)官方构建和维护。
  • 托管的远程端点,使用 OAuth,无需安装或手动更新。
  • 支持限定到组织或项目的 URL,自动填入 slug 并隐藏不需要的发现类工具。
  • 用自然语言搜索 issue 和事件(errors、logs、spans、metrics、profiles、replays)。
  • 集成 Seer,提供根因分析和代码修复建议。
  • issue 分诊操作:解决、重新打开、忽略或分配 issue。
  • 工具目录(search_sentry_tools / execute_sentry_tool),用于 release、团队、DSN、文档查询等长尾操作。
  • 面向自托管 Sentry 的 stdio 传输,可启用或禁用 skills(例如 --skills=inspect,seer 或 --disable-skills=project-management)。

Sentry MCP Server (Official) 工具

mcp.so 页面列出了九个顶层工具:

  • 发现:find_organizations 和 find_projects 用于查找其他工具需要的组织和项目 slug。URL 已限定范围时它们会被隐藏。
  • 搜索:search_issues 返回聚合后的 issue 列表(例如 is:unresolved level:error),而 search_events 负责计数、聚合以及在 errors、logs、spans、metrics、profiles 和 replays 中查询单个事件。两者都支持自然语言或 Sentry 搜索语法。
  • 查看:get_sentry_resource 可通过 Sentry URL 或 ID 获取 issue、事件、trace、span、replay、monitor 或 AI 对话。
  • 修复与分诊:analyze_issue_with_seer 运行 Seer 根因分析(新分析大约需要 2–5 分钟,结果会被缓存),update_issue 用于修改状态或分配人。
  • 目录:search_sentry_tools 查找未作为顶层工具暴露的操作,execute_sentry_tool 负责执行它们,例如 whoami。

Sentry MCP Server (Official) 的使用场景

  • 在编辑器里修复线上 bug:“查看 https://my-org.sentry.io/issues/PROJECT-123/,并在这个仓库里修复根本原因。”
  • 分诊新错误:“列出 my-project 中过去 24 小时首次出现的未解决错误。”
  • 查询统计数据:“今天一共有多少个错误?按 issue 分组。”
  • 获取 AI 修复方案:“对这个 issue 运行 Seer 并给出修复建议。”
  • 清理 issue 队列:“把 PROJECT-123 标记为已解决,并把 PROJECT-456 分配给我。”
  • 排查性能问题:“找出过去一小时内最慢的数据库 span。”

Sentry MCP Server (Official) 与替代方案对比

  • 托管远程 vs stdio:mcp.sentry.dev 上的远程服务器使用 OAuth,搜索无需 LLM 密钥。stdio 包需要用户认证令牌,AI 驱动的搜索工具还需要 LLM 提供商密钥,但它可以连接自托管 Sentry。
  • Claude Code 插件 vs 普通 MCP:插件把同一个服务器封装成专用子代理;claude mcp add 则直接把工具暴露给主代理。
  • 社区版 Sentry 服务器:一些目录还收录了规模较小的社区 Sentry MCP 项目。官方的 getsentry 服务器是由 Sentry 维护并提供文档的版本。

Sentry MCP Server (Official) 常见问题排查

  • AI 搜索工具缺失(stdio):自然语言搜索需要 LLM 提供商(OpenAI、Azure OpenAI、Anthropic 或 OpenRouter)。设置对应的 API 密钥,并显式设置 EMBEDDED_AGENT_PROVIDER;其他工具不依赖它也能正常工作。
  • 自托管环境缺少 Seer 工具:Seer 不属于自托管 Sentry,因此当 --host 指向非 sentry.io 主机时,seer skill 会被移除。如果你的部署确实运行了 Seer,请加上 --skills=inspect,seer。
  • 纯 HTTP 的自托管实例无法连接:加上 --insecure-http,并且 --host 只传主机名。
  • 使用令牌时出现权限错误:确认用户认证令牌包含上文列出的权限范围。
  • 在 127.0.0.1 上使用 MCP Inspector 时 OAuth 出错:改用 localhost。

常见问题

1

Sentry MCP 服务器是官方的吗?

是的。它由 Sentry 在 getsentry/sentry-mcp 仓库中构建和维护,Sentry 的文档也指向 mcp.sentry.dev 上的托管服务。

2

Sentry MCP 服务器的 URL 是什么?

远程端点是 `https://mcp.sentry.dev/mcp`。你可以在后面追加 `/{organizationSlug}` 或 `/{organizationSlug}/{projectSlug}` 来限定范围。

3

需要 API 密钥吗?

托管服务器不需要,它在首次连接时使用 OAuth。stdio 包需要 Sentry User Auth Token;如果要使用 AI 驱动的搜索工具,还需要 LLM 提供商密钥。

4

它支持 Claude Code、Cursor 和 VS Code 吗?

支持。Sentry 提供了 Claude Code(`claude mcp add --transport http` 或插件)、Cursor 和 VS Code 的配置说明。任何支持 HTTP 传输的客户端都可以连接。

5

可以用于自托管 Sentry 吗?

可以,通过 stdio 传输:运行 `npx @sentry/mcp-server@latest` 并带上 `--access-token` 和 `--host`。官方称 stdio 传输仍在完善中。

6

Sentry MCP 服务器免费吗?

mcp.so 页面和 Sentry 文档都没有为 MCP 服务器单独标价。它使用你现有的 Sentry 账号,能访问哪些内容取决于该账号。

7

Sentry MCP 服务器能修改数据吗?

能。`update_issue` 可以解决、忽略或分配 issue,stdio 令牌的权限范围也包含写权限。你可以用 skills 缩小暴露的工具范围,例如使用直接令牌认证时在远程 URL 上加 `?disable-skills=seer`,或在 stdio 上使用 `--disable-skills`。

评论

开发工具 分类下的更多 MCP 服务器