MCP Server Sentry

MCP 服务器哨兵 - TypeScript 实现

这是一个用 TypeScript 实现的模型上下文协议 (MCP) 服务器,用于连接 Sentry 错误跟踪服务。该服务器允许 AI 模型查询和分析 Sentry 上的错误报告和事件。

特征

  1. get_sentry_issue工具
    • 通过 ID 或 URL 检索并分析 Sentry 问题
    • 输入:
      • issue_id_or_url (字符串): 要分析的 Sentry 问题 ID 或 URL
    • 返回:发行详情包括:
      • 标题
      • 问题 ID
      • 地位
      • 等级
      • 首次出现时间戳
      • 上次上线时间戳
      • 事件计数
      • 完整的堆栈跟踪
  2. sentry-issue提示模板
    • 从 Sentry 检索问题详细信息
    • 输入:
      • issue_id_or_url (字符串): Sentry 问题 ID 或 URL
    • 返回:格式化的问题详细信息作为对话上下文

安装

# Install dependencies npm install # Build the project npm run build

配置

服务器使用环境变量进行配置。在项目根目录中创建一个.env文件:

# Required: Sentry authentication token SENTRY_AUTH_TOKEN=your_sentry_auth_token # Optional: Sentry organization name SENTRY_ORGANIZATION_SLUG=your_organization_slug # Optional: Sentry project name SENTRY_PROJECT_SLUG=your_project_slug # Optional: Sentry base url SENTRY_BASE_URL=https://sentry.com/api/0

或者,您可以在运行时设置这些环境变量。

跑步

通过标准 IO 运行服务器:

node dist/index.js

使用 MCP Inspector 进行调试:

npx @modelcontextprotocol/inspector node dist/index.js

环境变量说明

  • SENTRY_AUTH_TOKEN (必需):您的 Sentry API 访问令牌
  • SENTRY_PROJECT_SLUG (可选):Sentry 项目的 slug
  • SENTRY_ORGANIZATION_SLUG (可选):您的 Sentry 组织的 slug

如果 URL 中提供了项目和组织信息,则可以省略后两个变量。

执照

该项目已获得 MIT 许可。

-
security - not tested
-
license - not tested
-
quality - not tested

连接到 Sentry 错误跟踪服务的模型上下文协议服务器的 TypeScript 实现,允许 AI 模型查询和分析错误报告和事件。

  1. Features
    1. Installation
      1. Configuration
        1. Running
          1. Environment Variables Description
            1. License
              ID: crxk6jhf1u