M

MCP Sentry 错误分析器

@javaDer/mcp-sentry-custom
0 Stars 64 次浏览 javaDer 更新于 2026-08-23

一个连接到Sentry.io或自托管Sentry实例的MCP服务器,用于检索和分析错误报告、堆栈跟踪和调试信息。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "sentry": {
      "args": [
        "-m",
        "mcp_sentry",
        "--auth-token",
        "YOUR_SENTRY_TOKEN",
        "--project-slug",
        "YOUR_PROJECT_SLUG",
        "--organization-slug",
        "YOUR_ORGANIZATION_SLUG",
        "--sentry-url",
        "YOUR_SENTRY_URL"
      ],
      "command": "python"
    }
  }
}

该服务需要配置环境变量:auth_token、organization_slug、project_slug、sentry_url

服务介绍

下面是 mcp-sentry-custom 项目的 README.md 的修订和润色版本,格式清晰、正确且专业。它遵循标准的 Markdown 约定,并将内容组织成逻辑部分。


mcp-sentry-custom: 一个 Sentry MCP 服务器

概述

mcp-sentry-custom 是一个模型上下文协议(MCP)服务器,旨在从 Sentry.io 或自托管的 Sentry 实例中检索和分析问题。该服务器提供了工具来直接从您的 Sentry 账户中检查错误报告、堆栈跟踪和其他调试信息。

功能

工具

  1. get_sentry_issue

    • 描述:通过 ID 或 URL 检索并分析特定的 Sentry 问题。
    • 输入
      • issue_id_or_url (字符串):要分析的 Sentry 问题 ID 或完整 URL。
    • 返回:详细的 issue 信息,包括:
      • 标题
      • 问题 ID
      • 状态
      • 级别
      • 首次出现时间戳
      • 最后出现时间戳
      • 事件计数
      • 完整堆栈跟踪
  2. get_list_issues

    • 描述:为特定项目检索并分析 Sentry 问题列表。
    • 输入
      • project_slug (字符串):Sentry 项目 slug。
      • organization_slug (字符串):Sentry 组织 slug。
    • 返回:包含详细信息的问题列表,包括:
      • 标题
      • 问题 ID
      • 状态
      • 级别
      • 首次出现时间戳
      • 最后出现时间戳
      • 事件计数
      • 基本问题信息

提示

  1. 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

分支自

这个项目是从以下仓库 fork 的:
https://github.com/modelcontextprotocol/servers/tree/main/src/sentry

许可证

此 MCP 服务器采用 MIT 许可证。您可以在 MIT 许可证的条款和条件下自由使用、修改和分发该软件。更多详情,请参阅项目仓库中的 LICENSE 文件。


关于更改的说明

  1. 格式:使用了适当的 Markdown 标题、列表和代码块以提高可读性。
  2. 一致性:统一了术语(例如,mcp_sentrymcp-sentry-custom),并移除了多余的 <TEXT><JSON> 标签。
  3. 清晰度:重写了“概述”和“特性”等部分,使其更加简洁和精确。
  4. 完整性:修正了不完整的句子,并确保所有配置示例都结构正确。
  5. 专业语气:调整了措辞,使其听起来更加正式和精炼。

如果您需要进一步的改进,请告诉我!