@rui.branco/sentry-mcp 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -8
- package/index.js +47 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sentry MCP Server
|
|
2
2
|
|
|
3
|
-
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that brings Sentry error tracking context directly into Claude Code. Fetch issues, inspect stack traces, manage issue status, and search errors without leaving your development environment.
|
|
3
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that brings Sentry error tracking context directly into any MCP-compatible AI client — Claude Code, Codex CLI, Google's Antigravity (Gemini), Cursor, Windsurf, Zed, and others. Fetch issues, inspect stack traces, manage issue status, and search errors without leaving your development environment.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ When debugging production errors, context switching between Sentry and your code
|
|
|
8
8
|
|
|
9
9
|
- **Fetching full issue details** - Get error metadata, event counts, assignment, and status instantly
|
|
10
10
|
- **Inspecting stack traces** - View full stack traces with in-app frame markers, breadcrumbs, and HTTP request context
|
|
11
|
-
- **Managing issues** - Resolve, reopen, ignore, and assign issues directly from
|
|
11
|
+
- **Managing issues** - Resolve, reopen, ignore, and assign issues directly from your AI client
|
|
12
12
|
- **Searching errors** - Use Sentry's search syntax to find issues across your project
|
|
13
13
|
|
|
14
14
|
## Features
|
|
@@ -28,15 +28,39 @@ When debugging production errors, context switching between Sentry and your code
|
|
|
28
28
|
### Prerequisites
|
|
29
29
|
|
|
30
30
|
- Node.js 18+
|
|
31
|
-
- [
|
|
31
|
+
- An MCP-compatible AI client (see [Step 1](#step-1-register-with-your-mcp-client) below)
|
|
32
32
|
- Sentry account with API access
|
|
33
33
|
|
|
34
|
-
### Step 1:
|
|
34
|
+
### Step 1: Register with your MCP client
|
|
35
|
+
|
|
36
|
+
Pick the snippet for your client. All of them launch the server over stdio.
|
|
37
|
+
|
|
38
|
+
**Claude Code:**
|
|
35
39
|
|
|
36
40
|
```bash
|
|
37
41
|
claude mcp add --transport stdio sentry -- npx -y @rui.branco/sentry-mcp
|
|
38
42
|
```
|
|
39
43
|
|
|
44
|
+
**Codex CLI:** add to `~/.codex/config.toml`:
|
|
45
|
+
|
|
46
|
+
```toml
|
|
47
|
+
[mcp_servers.sentry]
|
|
48
|
+
command = "npx"
|
|
49
|
+
args = ["-y", "@rui.branco/sentry-mcp"]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Google Antigravity / Gemini CLI:** add to `~/.gemini/settings.json`:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"sentry": { "command": "npx", "args": ["-y", "@rui.branco/sentry-mcp"] }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Cursor, Windsurf, Zed, Cline, Continue, etc.:** add the same `command`/`args` pair to whatever JSON config that client uses for MCP servers (the exact path varies, but the shape is standard across clients).
|
|
63
|
+
|
|
40
64
|
### Step 2: Get Your Sentry API Token
|
|
41
65
|
|
|
42
66
|
1. Go to [Sentry Auth Tokens](https://sentry.io/settings/account/api/auth-tokens/) (or your self-hosted Sentry equivalent)
|
|
@@ -68,7 +92,7 @@ npx @rui.branco/sentry-mcp setup
|
|
|
68
92
|
|
|
69
93
|
### Step 4: Verify
|
|
70
94
|
|
|
71
|
-
Restart
|
|
95
|
+
Restart your AI client and check its MCP status (e.g. `/mcp` in Claude Code, `mcp` in Codex CLI, or the equivalent panel in your client) to verify the server is connected.
|
|
72
96
|
|
|
73
97
|
### Alternative: Manual Installation
|
|
74
98
|
|
|
@@ -80,7 +104,7 @@ cd ~/.config/sentry-mcp && npm install
|
|
|
80
104
|
node setup.js
|
|
81
105
|
```
|
|
82
106
|
|
|
83
|
-
Then
|
|
107
|
+
Then register the local entry point with your MCP client (replace the `npx -y @rui.branco/sentry-mcp` command from Step 1 with `node $HOME/.config/sentry-mcp/index.js`). Example for Claude Code:
|
|
84
108
|
|
|
85
109
|
```bash
|
|
86
110
|
claude mcp add --transport stdio sentry -- node $HOME/.config/sentry-mcp/index.js
|
|
@@ -214,6 +238,6 @@ MIT
|
|
|
214
238
|
|
|
215
239
|
## Related
|
|
216
240
|
|
|
217
|
-
- [jira-mcp](https://github.com/rui-branco/jira-mcp) - Jira MCP server
|
|
218
|
-
- [figma-mcp](https://github.com/rui-branco/figma-mcp) - Figma MCP server
|
|
241
|
+
- [jira-mcp](https://github.com/rui-branco/jira-mcp) - Jira MCP server (works with any MCP-compatible AI client)
|
|
242
|
+
- [figma-mcp](https://github.com/rui-branco/figma-mcp) - Figma MCP server (works with any MCP-compatible AI client)
|
|
219
243
|
- [Model Context Protocol](https://modelcontextprotocol.io/) - MCP specification
|
package/index.js
CHANGED
|
@@ -167,7 +167,7 @@ function cleanIssueData(issue) {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
function cleanEventData(event) {
|
|
170
|
-
const skip = new Set(["_meta", "groupID", "
|
|
170
|
+
const skip = new Set(["_meta", "groupID", "dist", "fingerprints"]);
|
|
171
171
|
const cleaned = {};
|
|
172
172
|
for (const [k, v] of Object.entries(event)) {
|
|
173
173
|
if (!skip.has(k) && v != null && v !== "") cleaned[k] = v;
|
|
@@ -609,6 +609,26 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
609
609
|
required: ["version"],
|
|
610
610
|
},
|
|
611
611
|
},
|
|
612
|
+
{
|
|
613
|
+
name: "sentry_list_events",
|
|
614
|
+
description:
|
|
615
|
+
"List events for a Sentry issue. Returns event IDs, timestamps, user info, and message/title for each occurrence.",
|
|
616
|
+
inputSchema: {
|
|
617
|
+
type: "object",
|
|
618
|
+
properties: {
|
|
619
|
+
issueId: {
|
|
620
|
+
type: "string",
|
|
621
|
+
description: "Sentry issue ID (numeric).",
|
|
622
|
+
},
|
|
623
|
+
instance: {
|
|
624
|
+
type: "string",
|
|
625
|
+
description:
|
|
626
|
+
"Instance name (for multi-instance setups). Uses default instance if omitted.",
|
|
627
|
+
},
|
|
628
|
+
},
|
|
629
|
+
required: ["issueId"],
|
|
630
|
+
},
|
|
631
|
+
},
|
|
612
632
|
{
|
|
613
633
|
name: "sentry_list_instances",
|
|
614
634
|
description:
|
|
@@ -1013,6 +1033,32 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1013
1033
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
1014
1034
|
};
|
|
1015
1035
|
|
|
1036
|
+
} else if (name === "sentry_list_events") {
|
|
1037
|
+
const inst = getInstanceByName(args.instance);
|
|
1038
|
+
if (!inst) throw new Error("No Sentry instance configured. Run: sentry-mcp setup");
|
|
1039
|
+
const data = await fetchSentry(
|
|
1040
|
+
`/api/0/organizations/${encodeURIComponent(inst.orgSlug)}/issues/${encodeURIComponent(args.issueId)}/events/`,
|
|
1041
|
+
inst,
|
|
1042
|
+
);
|
|
1043
|
+
if (!data || !data.length) {
|
|
1044
|
+
return {
|
|
1045
|
+
content: [{ type: "text", text: `No events found for issue ${args.issueId}.` }],
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
const lines = data.map((e) => {
|
|
1049
|
+
const user = e.user ? `${e.user.username || e.user.email || e.user.id || "unknown"}` : "N/A";
|
|
1050
|
+
const title = e.title || e.message || "";
|
|
1051
|
+
return `- **${e.eventID || e.id}** | ${e.dateCreated || "N/A"} | User: ${user} | ${title}`;
|
|
1052
|
+
});
|
|
1053
|
+
return {
|
|
1054
|
+
content: [
|
|
1055
|
+
{
|
|
1056
|
+
type: "text",
|
|
1057
|
+
text: `Found ${data.length} event(s) for issue ${args.issueId}:\n\n${lines.join("\n")}`,
|
|
1058
|
+
},
|
|
1059
|
+
],
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1016
1062
|
} else if (name === "sentry_list_instances") {
|
|
1017
1063
|
if (!instances.length) {
|
|
1018
1064
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rui.branco/sentry-mcp",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Sentry MCP server for Claude Code - fetch issues, search errors, resolve/ignore issues, get stack traces and breadcrumbs",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Sentry MCP server for any MCP-compatible AI client (Claude Code, Codex, Antigravity, Cursor, etc.) - fetch issues, search errors, resolve/ignore issues, get stack traces and breadcrumbs",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"sentry-mcp": "./index.js"
|