Sentry MCP

Sentry MCP

一个远程模型上下文协议(Model Context Protocol)服务器,作为连接 Sentry API 的中间件,允许像 Claude 这样的人工智能助手通过自然语言界面访问 Sentry 数据和功能。

Category
访问服务器

Tools

list_organizations

List all organizations that the user has access to in Sentry. Use this tool when you need to: - View all organizations in Sentry

list_teams

List all teams in an organization in Sentry. Use this tool when you need to: - View all teams in a Sentry organization

list_projects

Retrieve a list of projects in Sentry. Use this tool when you need to: - View all projects in a Sentry organization

get_error_details

Retrieve error details from Sentry for a specific Issue ID, including the stacktrace and error message. Either issueId or issueUrl MUST be provided. Use this tool when you need to: - Investigate a specific production error - Access detailed error information and stacktraces from Sentry

search_errors_in_file

Search for errors recently occurring in a specific file. This is a suffix based search, so only using the filename or the direct parent folder of the file. The parent folder is preferred when the filename is in a subfolder or a common filename. Use this tool when you need to: - Search for production errors in a specific file - Analyze error patterns and frequencies - Find recent or frequently occurring errors.

create_team

Create a new team in Sentry. Use this tool when you need to: - Create a new team in a Sentry organization

create_project

Create a new project in Sentry, giving you access to a new SENTRY_DSN. Use this tool when you need to: - Create a new project in a Sentry organization

README

sentry-mcp

这是一个远程 MCP 服务器的原型,充当上游 Sentry API 提供者的中间件。

它基于 Cloudflare 在远程 MCP 方面的工作

入门

https://sentry.cool

Stdio vs Remote

虽然此存储库主要服务于远程 MCP 用例,但我们也支持 stdio 传输。

注意:这目前是一个草案,无法通过分发获得。

您需要确保您的令牌已配置必要的范围。 截至撰写本文时,这些范围是:

org:read project:read project:write team:read team:write event:read

您可以在源代码中找到所需范围的规范参考。

启动 stdio 传输只需要您绑定 SENTRY_AUTH_TOKEN 并运行提供的脚本:

SENTRY_AUTH_TOKEN= npm run start:stdio

自托管 Sentry

您可以覆盖 SENTRY_URL 环境变量来设置您的基本 Sentry url:

SENTRY_URL=https://sentry.mycompany.com

MCP 检查器

MCP 包含一个 检查器,可以轻松测试服务:

pnpm inspector

输入 https://[domain].workers.dev/sse (TODO) 并点击连接。 完成身份验证流程后,您将看到工具正在工作:

<img width="640" alt="image" src="https://github.com/user-attachments/assets/7973f392-0a9d-4712-b679-6dd23f824287" />

从 Claude Desktop 访问远程 MCP 服务器

打开 Claude Desktop 并导航到设置,按 ⌘ + , (逗号) -> 开发者 -> 编辑配置。 这将打开控制 Claude 可以访问哪些 MCP 服务器的配置文件。

将内容替换为以下配置。 重启 Claude Desktop 后,将打开一个浏览器窗口,显示您的 OAuth 登录页面。 完成身份验证流程以授予 Claude 访问您的 MCP 服务器的权限。 授予访问权限后,这些工具将可供您使用。

{
  "mcpServers": {
    "math": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp-github-oauth.<your-subdomain>.workers.dev/sse"
      ]
    }
  }
}

一旦工具(在 🔨 下)出现在界面中,您就可以要求 Claude 使用它们。 例如:“你能用数学工具加 23 和 19 吗?”。 Claude 应该调用该工具并显示 MCP 服务器生成的结果。

本地开发

如果您想迭代和测试您的 MCP 服务器,您可以在本地开发中进行。 这将需要您在 Sentry 中创建另一个 OAuth 应用程序(设置 => API => 应用程序):

  • 对于主页 URL,指定 http://localhost:8788
  • 对于授权重定向 URI,指定 http://localhost:8788/callback
  • 记下您的客户端 ID 并生成一个客户端密钥。
  • 在您的项目根目录中创建一个 .dev.vars 文件,其中包含:
SENTRY_CLIENT_ID=your_development_sentry_client_id
SENTRY_CLIENT_SECRET=your_development_sentry_client_secret

验证

在本地运行服务器,使其在 http://localhost:8788 上可用

pnpm dev

要测试本地服务器,请在检查器中输入 http://localhost:8788/sse 并点击连接。 按照提示操作后,您将能够“列出工具”。

测试

包含两个测试套件:基本单元测试和一些评估。

可以使用以下命令运行单元测试:

pnpm test

Evals 将需要一个包含一些配置的 .env 文件:

OAUTH_API_TOKEN=
SENTRY_AUTH_TOKEN=

完成后,您可以使用以下命令运行它们:

pnpm eval

笔记

使用 Claude 和其他 MCP 客户端

当使用 Claude 连接到您的远程 MCP 服务器时,您可能会看到一些错误消息。 这是因为 Claude Desktop 尚不支持远程 MCP 服务器,因此有时会感到困惑。 要验证 MCP 服务器是否已连接,请将鼠标悬停在 Claude 界面右下角的 🔨 图标上。 您应该在那里看到您的工具可用。

使用 Cursor 和其他 MCP 客户端

要将 Cursor 与您的 MCP 服务器连接,请选择“类型”:“命令”,并在“命令”字段中,将命令和 args 字段合并为一个(例如 npx mcp-remote https://<your-worker-name>.<your-subdomain>.workers.dev/sse)。

请注意,虽然 Cursor 支持 HTTP+SSE 服务器,但它不支持身份验证,因此您仍然需要使用 mcp-remote(并使用 STDIO 服务器,而不是 HTTP 服务器)。

您可以通过打开客户端的配置文件,添加与 Claude 设置中使用的相同的 JSON,然后重新启动 MCP 客户端,将您的 MCP 服务器连接到其他 MCP 客户端(如 Windsurf)。

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选