Skip to main content
Glama

Sentry MCP

Official
by getsentry

哨兵-mcp

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

它基于Cloudflare 针对远程 MCP 的工作

入门

通过访问生产中部署的服务,您将找到需要了解的一切:

https://mcp.sentry.dev

如果您希望做出贡献、了解其工作原理或为自托管 Sentry 运行它,请继续阅读以下内容。

Stdio 与 Remote

虽然此仓库专注于充当 MCP 服务,但我们也支持stdio传输。此功能仍在开发中,但它是在自托管 Sentry 安装中运行 MCP 的最简单方法。

要使用stdoio传输,您需要在 Sentry 中创建一个具有必要作用域的个人 API 令牌 (PAT)。截至撰写本文时,情况如下:

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

启动运输:

npx @sentry/mcp-server@latest --access-token=sentry-pat --host=sentry.example.com

注意:您还可以使用环境变量:

SENTRY_AUTH_TOKEN= SENTRY_HOST=

MCP 检查器

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

pnpm inspector

输入 MCP 服务器 URL( http://localhost:5173 )并点击“连接”。这将触发身份验证流程。

注意:如果您在访问127.0.0.1上的检查器时遇到 OAuth 流程问题,请尝试使用localhost ,即访问http://localhost:6274

本地开发

如果您想迭代和测试您的 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

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

测试

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

可以使用以下方式运行单元测试:

pnpm test

Evals 需要一个带有一些配置的.env文件:

OPENAI_API_KEY=

完成后,您可以使用以下方式运行它们:

pnpm test

笔记

使用 Claude 和其他 MCP 客户端

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

使用 Cursor 和其他 MCP 客户端

要将 Cursor 连接到您的 MCP 服务器,请选择Type :“命令”,然后在Command字段中将命令和参数字段合并为一个(例如npx mcp-remote@latest https://<your-worker-name>.<your-subdomain>.workers.dev/sse )。

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

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

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

远程模型上下文协议服务器充当 Sentry API 的中间件,允许像 Claude 这样的 AI 助手通过自然语言界面访问 Sentry 数据和功能。

  1. 入门
    1. Stdio 与 Remote
    2. MCP 检查器
  2. 本地开发
    1. 核实
    2. 测试
  3. 笔记
    1. 使用 Claude 和其他 MCP 客户端
    2. 使用 Cursor 和其他 MCP 客户端

Related MCP Servers

  • -
    security
    F
    license
    -
    quality
    A Model Context Protocol server that retrieves and analyzes Sentry.io issues, allowing users to inspect error reports, stacktraces, and debugging information from their Sentry account.
    Last updated -
    16
    Python
    • Apple
  • A
    security
    F
    license
    A
    quality
    A Model Context Protocol server that enables AI assistants to interact with Sentry for error tracking and monitoring, allowing retrieval and analysis of error data, project management, and performance monitoring through the Sentry API.
    Last updated -
    10
    3
    TypeScript
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.
    Last updated -
    15
    Python
    MIT License
    • Apple
    • Linux
  • -
    security
    -
    license
    -
    quality
    A TypeScript implementation of a Model Context Protocol server that connects to Sentry error tracking service, allowing AI models to query and analyze error reports and events.
    Last updated -
    TypeScript

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/getsentry/sentry-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server