How mcp-100/mcp-sentry works
Project Type and Purpose
• This is an open‑source Model Context Protocol (MCP) adapter/server written in Python.
• It exposes two main “tools” (get_sentry_issue, get_list_issues) that query the Sentry REST API and return structured issue data for LLM clients (e.g., Claude Desktop, Zed).
• It can be run via uvx, pip, or Docker and communicates over stdio using the MCP JSON‑RPC protocol.
File Structure Analysis
• Top‐level files:
• Dockerfile – containerized entrypoint
• smithery.yaml – packaging for Smithery registry
• pyproject.toml – Python build/config
• README.md – architecture & usage doc
• images/ – screenshot of MCP inspector
• .github/ – CI workflows & issue templates
• src/mcp_sentry/
• __main__.py – CLI entrypoint (invoked by python -m mcp_sentry)
• server.py – core MCP server implementation & command dispatch
• .cursor/ – Zed editor MCP integration example
Key Components and Interactions
a. MCP Client Layer
• Claude Desktop or Zed (or direct CLI) invokes the mcp-sentry command.
• Uses uvx, python -m, or docker run to launch the server process.
b. MCP Server Process
• __main__.py parses CLI args (auth token, project slug, org slug).
• server.py initializes the MCP protocol handler and registers two commands.
• Maintains a JSON‑RPC channel over stdio (MCP protocol).
c. External Service
• Sentry.io REST API – accessed via HTTP(S) calls (e.g., using requests library).
• Authenticated by the provided token, scoped to project_slug & organization_slug.
d. Optional Tooling
• MCP inspector (Model Context Protocol Inspector) – attached to the running MCP server for live debugging.
Architectural Patterns & Design Principles
• Adapter Pattern: the server adapts Sentry HTTP API to the MCP JSON‑RPC protocol.
• Command Pattern: each “tool” (get_sentry_issue, get_list_issues) is registered as a discrete command handler.
• Separation of Concerns:
• CLI parsing in __main__.py
• Protocol handling & dispatch in server.py
• HTTP interactions isolated within command implementations