关于 Sentry
mcp-sentry-custom 是用于 Sentry.io 或自托管 Sentry 实例的 MCP 服务,面向需要在对话中检查错误与调试信息的开发者。它可查询单个或项目内的问题,并返回堆栈跟踪及事件概况。
主要功能
- 01按 ID 或 URL 获取问题详情
- 02按项目和组织列出问题
- 03查看堆栈跟踪与事件信息
- 04提供格式化问题提示词
适用场景
- 01检查特定 Sentry 问题的错误详情
- 02梳理项目中的问题及其状态
- 03将堆栈跟踪纳入调试对话
MCP 相关
该 MCP 服务向客户端暴露 Sentry 问题查询工具和一个格式化问题提示词,可连接 Sentry.io 或自托管实例。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
2收录的工具列表 · 更新于 3 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| issue_id_or_url | string | 是 | 要分析的 Sentry issue ID 或 URL |
详细介绍
English 中文
以下是经过修订和润色的 mcp-sentry-custom 项目 README.md,格式清晰、准确且专业,并遵循标准 Markdown 规范,将内容组织为逻辑清晰的各个部分。
mcp-sentry-custom:Sentry MCP 服务
概述
mcp-sentry-custom 是一种模型上下文协议(MCP)服务,旨在从 Sentry.io 或可自托管的 Sentry 实例中检索和分析问题。此服务提供了一些工具,可直接从你的 Sentry 账户检查错误报告、堆栈跟踪和其他调试信息。
功能
工具
-
get_sentry_issue- 说明:通过 ID 或 URL 检索并分析特定的 Sentry 问题。
- 输入:
issue_id_or_url(字符串):要分析的 Sentry 问题 ID 或完整 URL。
- 返回:问题详细信息,包括:
- 标题
- 问题 ID
- 状态
- 级别
- 首次出现时间戳
- 最后出现时间戳
- 事件数
- 完整堆栈跟踪
-
get_list_issues- 说明:检索并分析特定项目的 Sentry 问题列表。
- 输入:
project_slug(字符串):Sentry 项目 slug。organization_slug(字符串):Sentry 组织 slug。
- 返回:问题列表及其详细信息,包括:
- 标题
- 问题 ID
- 状态
- 级别
- 首次出现时间戳
- 最后出现时间戳
- 事件数
- 基本问题信息
提示词
sentry-issue- 说明:从 Sentry 检索格式化的问题详情,以便在对话上下文中使用。
- 输入:
issue_id_or_url(字符串):Sentry 问题 ID 或 URL。
- 返回:格式化的问题详情。
安装
通过 Smithery 安装
通过 Smithery 为 Claude Desktop 自动安装 mcp-sentry-custom:
npx -y @smithery/cli install @javaDer/mcp-sentry-custom --client claude
使用 uv(推荐)
使用 uv 时无需进行特定安装。你可以通过 uvx 直接运行 mcp-sentry-custom:
uvx mcp-sentry-custom --auth-token YOUR_SENTRY_TOKEN --project-slug YOUR_PROJECT_SLUG --organization-slug YOUR_ORGANIZATION_SLUG --sentry-url YOUR_SENTRY_URL
使用 pip
或者,通过 pip 安装 mcp-sentry-custom:
pip install mcp-sentry-custom
或者,使用 uv:
uv pip install -e .
安装后,将其作为脚本运行:
python -m mcp_sentry
配置
与 Claude Desktop 配合使用
将以下内容添加到你的 claude_desktop_config.json:
使用 uvx
{
"mcpServers": {
"sentry": {
"command": "uvx",
"args": [
"mcp-sentry-custom",
"--auth-token", "YOUR_SENTRY_TOKEN",
"--project-slug", "YOUR_PROJECT_SLUG",
"--organization-slug", "YOUR_ORGANIZATION_SLUG",
"--sentry-url", "YOUR_SENTRY_URL"
]
}
}
}
使用 Docker
{
"mcpServers": {
"sentry": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"mcp/sentry",
"--auth-token", "YOUR_SENTRY_TOKEN",
"--project-slug", "YOUR_PROJECT_SLUG",
"--organization-slug", "YOUR_ORGANIZATION_SLUG",
"--sentry-url", "YOUR_SENTRY_URL"
]
}
}
}
使用 pip 安装
{
"mcpServers": {
"sentry": {
"command": "python",
"args": [
"-m", "mcp_sentry",
"--auth-token", "YOUR_SENTRY_TOKEN",
"--project-slug", "YOUR_PROJECT_SLUG",
"--organization-slug", "YOUR_ORGANIZATION_SLUG",
"--sentry-url", "YOUR_SENTRY_URL"
]
}
}
}
与 Zed 配合使用
将以下内容添加到 Zed 中的 settings.json:
使用 uvx
{
"context_servers": {
"mcp-sentry-custom": {
"command": {
"path": "uvx",
"args": [
"mcp-sentry-custom",
"--auth-token", "YOUR_SENTRY_TOKEN",
"--project-slug", "YOUR_PROJECT_SLUG",
"--organization-slug", "YOUR_ORGANIZATION_SLUG",
"--sentry-url", "YOUR_SENTRY_URL"
]
}
}
}
}
使用 pip 安装
{
"context_servers": {
"mcp-sentry-custom": {
"command": "python",
"args": [
"-m", "mcp_sentry",
"--auth-token", "YOUR_SENTRY_TOKEN",
"--project-slug", "YOUR_PROJECT_SLUG",
"--organization-slug", "YOUR_ORGANIZATION_SLUG",
"--sentry-url", "YOUR_SENTRY_URL"
]
}
}
}
使用 pip 安装并指定自定义路径
{
"context_servers": {
"mcp-sentry-custom": {
"command": "python",
"args": [
"-m", "mcp_sentry",
"--auth-token", "YOUR_SENTRY_TOKEN",
"--project-slug", "YOUR_PROJECT_SLUG",
"--organization-slug", "YOUR_ORGANIZATION_SLUG",
"--sentry-url", "YOUR_SENTRY_URL"
],
"env": {
"PYTHONPATH": "path/to/mcp-sentry-custom/src"
}
}
}
}
调试
使用 MCP 检查器调试服务。
通过 uvx 安装
npx @modelcontextprotocol/inspector uvx mcp-sentry-custom --auth-token YOUR_SENTRY_TOKEN --project-slug YOUR_PROJECT_SLUG --organization-slug YOUR_ORGANIZATION_SLUG --sentry-url YOUR_SENTRY_URL
本地开发
如果你已将软件包安装到特定目录,或正在开发该软件包:
cd path/to/mcp-sentry-custom/src
npx @modelcontextprotocol/inspector uv run mcp-sentry-custom --auth-token YOUR_SENTRY_TOKEN --project-slug YOUR_PROJECT_SLUG --organization-slug YOUR_ORGANIZATION_SLUG --sentry-url YOUR_SENTRY_URL
或者,使用自定义目录:
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-sentry-custom/src run mcp_sentry --auth-token YOUR_SENTRY_TOKEN --project-slug YOUR_PROJECT_SLUG --organization-slug YOUR_ORGANIZATION_SLUG --sentry-url YOUR_SENTRY_URL
派生自
此项目派生自:
https://github.com/modelcontextprotocol/servers/tree/main/src/sentry
许可证
此 MCP 服务采用 MIT License 授权。你可以自由使用、修改和分发此软件,但须遵守 MIT License 的条款和条件。更多详情请参阅项目仓库中的 LICENSE 文件。
变更说明
- 格式:使用规范的 Markdown 标题、列表和代码块,提升可读性。
- 一致性:统一术语(例如,
mcp_sentry与mcp-sentry-custom),并移除冗余的<TEXT>和<JSON>标签。 - 清晰度:重写“概览”和“功能”等部分,使其更加简洁、准确。
- 完整性:修复不完整的句子,并确保所有配置示例结构正确。
- 专业语气:调整措辞,使其更加正式、精炼。
如果你希望进一步润色,请告诉我!
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。