Cover image
Try Now
2025-04-03

MCP Sentry服务器

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

MCP Sentry Server (Node.js)

This is a Node.js + TypeScript implementation of the Model Context Protocol (MCP) Sentry server. It provides integration with Sentry for retrieving error reports and stacktraces through MCP.

中文文档

Features

  • Integration with Sentry API for error tracking and monitoring
  • Support for both standard MCP over stdin/stdout and SSE (Server-Sent Events) transport
  • Configurable port for the SSE server (default: 3579)

Prerequisites

  • Node.js >= 20.0.0
  • pnpm >= 10.5.2

Installation

Clone the repository and install dependencies:

pnpm install

Configuration

Create a .env file in the root directory with your Sentry authentication token:

SENTRY_TOKEN=your_sentry_auth_token_here

You can obtain your Sentry authentication token from your Sentry account settings.

Usage

Build the Project

pnpm build

Run the Server

pnpm start

Alternatively, you can specify the Sentry authentication token and API base as command-line arguments:

pnpm start --auth-token your_sentry_auth_token_here --api-base your_sentry_api_base_here

Run with SSE Support

pnpm start:sse

This will start an Express server with SSE support on port 3579 (default). You can access the SSE endpoint at:

http://localhost:3579/sse

You can also customize the environment variables using a .env.local file.

Development Mode

pnpm dev

MCP Configuration

{
  "mcpServers": {
    "sentry-server": {
      "command": "npx",
      "args": ["-y","@weekit/mcp-sentry@1.0.9"],
      "env": {
        "SENTRY_TOKEN": "your_sentry_auth_token_here",
        "SENTRY_API_BASE": "https://your_sentry_api_base_here"
      }
    }
  }
}

Using local build:

{
  "mcpServers": {
    "my-sentry": {
      "command": "node",
      "args": ["path/to/dist/index.js"],
      "env": {
        "SENTRY_TOKEN": "your_sentry_auth_token_here",
        "SENTRY_API_BASE": "https://your_sentry_api_base_here"
      }
    }
  }
}

Communication Protocols

The MCP Sentry server supports two communication protocols:

  1. Standard MCP Protocol: Communication over standard input/output streams
  2. SSE Transport: Server-Sent Events for web-based communication via HTTP (port 3579)

MCP Features

The MCP Sentry server provides the following features through the MCP protocol:

Prompts

  • sentry-issue: Retrieve a Sentry issue by ID or URL
  • most-triggered-issue: Find the issue affecting the most users from a Sentry issues list URL

Tools

  • get_sentry_issue: Retrieve and analyze a Sentry issue by ID or URL
  • get_sentry_issues_list: Retrieve and analyze a list of Sentry issues from a URL

API

The server communicates using the Model Context Protocol over standard input/output streams and provides the following functionalities:

  1. Listing available prompts and tools
  2. Retrieving Sentry issue information including:
    • Issue title and ID
    • Status and severity level
    • First and last seen timestamps
    • Event count
    • Detailed stacktrace

MCP Workflow

Below is the workflow diagram of the MCP Sentry server:

flowchart TD
    A[Client/LLM] -->|1. Send MCP Request| B[MCP Sentry Server]
    B -->|2. Parse Request Type| C{Determine Request Type}

    C -->|Prompt Request| D[Handle Prompt\nsentry-issue]
    C -->|Tool Request| E[Handle Tool\nget_sentry_issue]

    D -->|3. Extract Issue ID| F[Call Sentry API]
    E -->|3. Extract Issue ID| F

    F -->|4. Get Issue Data| G[Sentry API]
    G -->|5. Return Issue Data| F
    F -->|6. Get Event Data| G
    G -->|7. Return Event Data| F

    F -->|8. Parse Data| H[Create SentryIssueData Object]
    H -->|9. Format Data| I{Response Type}

    I -->|Prompt Response| J[Convert to PromptResult Format]
    I -->|Tool Response| K[Convert to ToolResult Format]

    J -->|10. Return Response| B
    K -->|10. Return Response| B

    B -->|11. Send MCP Response| A

Testing

Run all tests:

pnpm test

Run unit tests:

pnpm test test/unit.test.ts

Run integration tests:

pnpm test test/integration.test.ts

View test coverage:

pnpm test -- --coverage

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • HiveNexus
  • 一个适用于中小型团队的AI聊天机器人,支持DeepSeek,Open AI,Claude和Gemini等车型。 专为中小团队设计的ai聊天应用,支持deepSeek,打开ai,claude,双子座等模型。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

    Reviews

    1 (1)
    Avatar
    user_grB23nmo
    2025-04-16

    As a dedicated user of the mcp-sentry application developed by weekitmo, I have found it incredibly efficient and reliable. The seamless integration and comprehensive features make monitoring and managing my servers a breeze. The user-friendly interface and detailed documentation available at https://github.com/weekitmo/mcp-sentry have been invaluable. Highly recommend this tool for anyone looking to keep their systems in check!