哨兵-mcp
这是一个远程 MCP 服务器的原型,充当上游 Sentry API 提供商的中间件。
入门
通过访问生产中部署的服务,您将找到需要了解的一切:
如果您希望做出贡献、了解其工作原理或为自托管 Sentry 运行它,请继续阅读以下内容。
Stdio 与 Remote
虽然此仓库专注于充当 MCP 服务,但我们也支持stdio
传输。此功能仍在开发中,但它是在自托管 Sentry 安装中运行 MCP 的最简单方法。
要使用stdoio
传输,您需要在 Sentry 中创建一个具有必要作用域的个人 API 令牌 (PAT)。截至撰写本文时,情况如下:
启动运输:
注意:您还可以使用环境变量:
MCP 检查器
MCP 包含一个检查器,可以轻松测试服务:
输入 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
文件:
核实
在本地运行服务器,使其在http://localhost:8788
上可用
要测试本地服务器,请在 Inspector 中输入http://localhost:8788/sse
并点击“连接”。按照提示操作后,您将能够“列出工具”。
测试
其中包括两个测试套件:基本单元测试和一些评估。
可以使用以下方式运行单元测试:
Evals 需要一个带有一些配置的.env
文件:
完成后,您可以使用以下方式运行它们:
笔记
使用 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.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
远程模型上下文协议服务器充当 Sentry API 的中间件,允许像 Claude 这样的 AI 助手通过自然语言界面访问 Sentry 数据和功能。
Related MCP Servers
- -securityFlicense-qualityA 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 -16Python
- AsecurityFlicenseAqualityA 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 -103TypeScript
- -securityAlicense-qualityA 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 -15PythonMIT License
- -security-license-qualityA 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