mcp-sentry-custom 是一个模型上下文协议(Model Context Protocol,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 项目标识。organization_slug(字符串):Sentry 组织标识。
- 返回:包含详细信息的问题列表,包括:
- 标题
- 问题 ID
- 状态
- 级别
- 首次发现时间戳
- 最后发现时间戳
- 事件计数
- 基本问题信息
sentry-issue- 描述:从 Sentry 检索格式化的问题详情,用于对话上下文。
- 输入:
issue_id_or_url(字符串):Sentry 问题 ID 或 URL。
- 返回:格式化的问题详情。
要通过 Smithery 自动为 Claude Desktop 安装 mcp-sentry-custom:
npx -y @smithery/cli install @javaDer/mcp-sentry-custom --client claude使用 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 安装 mcp-sentry-custom:
pip install mcp-sentry-custom或者,使用 uv:
uv pip install -e .安装后,作为脚本运行:
python -m mcp_sentry将以下内容添加到您的 claude_desktop_config.json:
{
"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"
]
}
}
}{
"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"
]
}
}
}{
"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 中的 settings.json:
{
"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"
]
}
}
}
}{
"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"
]
}
}
}{
"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 检查器来调试服务器。
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 许可证 授权。您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。有关更多详细信息,请参阅项目存储库中的 LICENSE 文件。
