@tokamohsen/sentry-mcp 0.29.8 → 0.29.10
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 +189 -0
- package/dist/index.cjs +0 -0
- package/package.json +19 -18
- package/LICENSE.md +0 -105
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# sentry-mcp
|
|
2
|
+
|
|
3
|
+
> **Note:** This is a fork of the original repository. It includes additional Breadcrumbs data as output from tool `get-issue-details`.
|
|
4
|
+
|
|
5
|
+
Sentry's MCP service is primarily designed for human-in-the-loop coding agents. Our tool selection and priorities are focused on developer workflows and debugging use cases, rather than providing a general-purpose MCP server for all Sentry functionality.
|
|
6
|
+
|
|
7
|
+
This remote MCP server acts as middleware to the upstream Sentry API, optimized for coding assistants like Cursor, Claude Code, and similar development tools. It's based on [Cloudflare's work towards remote MCPs](https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/).
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
You'll find everything you need to know by visiting the deployed service in production:
|
|
12
|
+
|
|
13
|
+
<https://mcp.sentry.dev>
|
|
14
|
+
|
|
15
|
+
If you're looking to contribute, learn how it works, or to run this for self-hosted Sentry, continue below.
|
|
16
|
+
|
|
17
|
+
### Stdio vs Remote
|
|
18
|
+
|
|
19
|
+
While this repository is focused on acting as an MCP service, we also support a `stdio` transport. This is still a work in progress, but is the easiest way to adapt run the MCP against a self-hosted Sentry install.
|
|
20
|
+
|
|
21
|
+
**Note:** The AI-powered search tools (`search_events`, `search_issues`, etc.) require an LLM provider (OpenAI or Anthropic). These tools use natural language processing to translate queries into Sentry's query syntax. Without a configured provider, these specific tools will be unavailable, but all other tools will function normally.
|
|
22
|
+
|
|
23
|
+
To utilize the `stdio` transport, you'll need to create an User Auth Token in Sentry with the necessary scopes. As of writing this is:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
org:read
|
|
27
|
+
project:read
|
|
28
|
+
project:write
|
|
29
|
+
team:read
|
|
30
|
+
team:write
|
|
31
|
+
event:write
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Launch the transport:
|
|
35
|
+
|
|
36
|
+
```shell
|
|
37
|
+
npx @tokamohsen/sentry-mcp@latest --access-token=sentry-user-token
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Need to connect to a self-hosted deployment? Add <code>--host</code> (hostname
|
|
41
|
+
only, e.g. <code>--host=sentry.example.com</code>) when you run the command.
|
|
42
|
+
|
|
43
|
+
#### Environment Variables
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
SENTRY_ACCESS_TOKEN= # Required: Your Sentry auth token
|
|
47
|
+
|
|
48
|
+
# LLM Provider Configuration (required for AI-powered search tools)
|
|
49
|
+
EMBEDDED_AGENT_PROVIDER= # Required: 'openai' or 'anthropic'
|
|
50
|
+
OPENAI_API_KEY= # Required if using OpenAI
|
|
51
|
+
ANTHROPIC_API_KEY= # Required if using Anthropic
|
|
52
|
+
|
|
53
|
+
# Optional overrides
|
|
54
|
+
SENTRY_HOST= # For self-hosted deployments
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Important:** Always set `EMBEDDED_AGENT_PROVIDER` to explicitly specify your LLM provider. Auto-detection based on API keys alone is deprecated and will be removed in a future release. See [docs/embedded-agents.md](docs/embedded-agents.md) for detailed configuration options.
|
|
58
|
+
|
|
59
|
+
#### Example MCP Configuration
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"sentry": {
|
|
65
|
+
"command": "npx",
|
|
66
|
+
"args": ["@tokamohsen/sentry-mcp"],
|
|
67
|
+
"env": {
|
|
68
|
+
"SENTRY_ACCESS_TOKEN": "your-token",
|
|
69
|
+
"EMBEDDED_AGENT_PROVIDER": "openai",
|
|
70
|
+
"OPENAI_API_KEY": "sk-..."
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
If you leave the host variable unset, the CLI automatically targets the Sentry
|
|
78
|
+
SaaS service. Only set the override when you operate self-hosted Sentry.
|
|
79
|
+
|
|
80
|
+
### MCP Inspector
|
|
81
|
+
|
|
82
|
+
MCP includes an [Inspector](https://modelcontextprotocol.io/docs/tools/inspector), to easily test the service:
|
|
83
|
+
|
|
84
|
+
```shell
|
|
85
|
+
pnpm inspector
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Enter the MCP server URL (<http://localhost:5173>) and hit connect. This should trigger the authentication flow for you.
|
|
89
|
+
|
|
90
|
+
Note: If you have issues with your OAuth flow when accessing the inspector on `127.0.0.1`, try using `localhost` instead by visiting `http://localhost:6274`.
|
|
91
|
+
|
|
92
|
+
## Local Development
|
|
93
|
+
|
|
94
|
+
To contribute changes, you'll need to set up your local environment:
|
|
95
|
+
|
|
96
|
+
1. **Set up environment files:**
|
|
97
|
+
|
|
98
|
+
```shell
|
|
99
|
+
make setup-env # Creates both .env files from examples
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
2. **Create an OAuth App in Sentry** (Settings => API => [Applications](https://sentry.io/settings/account/api/applications/)):
|
|
103
|
+
- Homepage URL: `http://localhost:5173`
|
|
104
|
+
- Authorized Redirect URIs: `http://localhost:5173/oauth/callback`
|
|
105
|
+
- Note your Client ID and generate a Client secret
|
|
106
|
+
|
|
107
|
+
3. **Configure your credentials:**
|
|
108
|
+
- Edit `.env` in the root directory and add your `OPENAI_API_KEY`
|
|
109
|
+
- Edit `packages/mcp-cloudflare/.env` and add:
|
|
110
|
+
- `SENTRY_CLIENT_ID=your_development_sentry_client_id`
|
|
111
|
+
- `SENTRY_CLIENT_SECRET=your_development_sentry_client_secret`
|
|
112
|
+
- `COOKIE_SECRET=my-super-secret-cookie`
|
|
113
|
+
|
|
114
|
+
4. **Start the development server:**
|
|
115
|
+
|
|
116
|
+
```shell
|
|
117
|
+
pnpm dev
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Verify
|
|
121
|
+
|
|
122
|
+
Run the server locally to make it available at `http://localhost:5173`
|
|
123
|
+
|
|
124
|
+
```shell
|
|
125
|
+
pnpm dev
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
To test the local server, enter `http://localhost:5173/mcp` into Inspector and hit connect. Once you follow the prompts, you'll be able to "List Tools".
|
|
129
|
+
|
|
130
|
+
### Tests
|
|
131
|
+
|
|
132
|
+
There are three test suites included: unit tests, evaluations, and manual testing.
|
|
133
|
+
|
|
134
|
+
**Unit tests** can be run using:
|
|
135
|
+
|
|
136
|
+
```shell
|
|
137
|
+
pnpm test
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Evaluations** require a `.env` file in the project root with some config:
|
|
141
|
+
|
|
142
|
+
```shell
|
|
143
|
+
# .env (in project root)
|
|
144
|
+
OPENAI_API_KEY= # Also required for AI-powered search tools in production
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Note: The root `.env` file provides defaults for all packages. Individual packages can have their own `.env` files to override these defaults during development.
|
|
148
|
+
|
|
149
|
+
Once that's done you can run them using:
|
|
150
|
+
|
|
151
|
+
```shell
|
|
152
|
+
pnpm eval
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Manual testing** (preferred for testing MCP changes):
|
|
156
|
+
|
|
157
|
+
```shell
|
|
158
|
+
# Test with local dev server (default: http://localhost:5173)
|
|
159
|
+
pnpm -w run cli "who am I?"
|
|
160
|
+
|
|
161
|
+
# Test agent mode (use_sentry tool only)
|
|
162
|
+
pnpm -w run cli --agent "who am I?"
|
|
163
|
+
|
|
164
|
+
# Test against production
|
|
165
|
+
pnpm -w run cli --mcp-host=https://mcp.sentry.dev "query"
|
|
166
|
+
|
|
167
|
+
# Test with local stdio mode (requires SENTRY_ACCESS_TOKEN)
|
|
168
|
+
pnpm -w run cli --access-token=TOKEN "query"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Note: The CLI defaults to `http://localhost:5173`. Override with `--mcp-host` or set `MCP_URL` environment variable.
|
|
172
|
+
|
|
173
|
+
**Comprehensive testing playbooks:**
|
|
174
|
+
|
|
175
|
+
- **Stdio testing:** See `docs/testing-stdio.md` for complete guide on building, running, and testing the stdio implementation (IDEs, MCP Inspector)
|
|
176
|
+
- **Remote testing:** See `docs/testing-remote.md` for complete guide on testing the remote server (OAuth, web UI, CLI client)
|
|
177
|
+
|
|
178
|
+
## Development Notes
|
|
179
|
+
|
|
180
|
+
### Automated Code Review
|
|
181
|
+
|
|
182
|
+
This repository uses automated code review tools (like Cursor BugBot) to help identify potential issues in pull requests. These tools provide helpful feedback and suggestions, but **we do not recommend making these checks required** as the accuracy is still evolving and can produce false positives.
|
|
183
|
+
|
|
184
|
+
The automated reviews should be treated as:
|
|
185
|
+
|
|
186
|
+
- ✅ **Helpful suggestions** to consider during code review
|
|
187
|
+
- ✅ **Starting points** for discussion and improvement
|
|
188
|
+
- ❌ **Not blocking requirements** for merging PRs
|
|
189
|
+
- ❌ **Not replacements** for human code review
|
package/dist/index.cjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokamohsen/sentry-mcp",
|
|
3
3
|
"mcpName": "io.github.getsentry/sentry-mcp",
|
|
4
|
-
"version": "0.29.
|
|
4
|
+
"version": "0.29.10",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.8.1",
|
|
6
7
|
"engines": {
|
|
7
8
|
"node": ">=20"
|
|
8
9
|
},
|
|
@@ -40,6 +41,14 @@
|
|
|
40
41
|
"default": "./dist/transports/stdio.js"
|
|
41
42
|
}
|
|
42
43
|
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsdown",
|
|
46
|
+
"dev": "tsdown --watch",
|
|
47
|
+
"start": "tsx src/index.ts",
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"test:watch": "vitest",
|
|
50
|
+
"tsc": "tsc --noEmit"
|
|
51
|
+
},
|
|
43
52
|
"dependencies": {
|
|
44
53
|
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
45
54
|
"@sentry/node": "10.35.0",
|
|
@@ -48,21 +57,13 @@
|
|
|
48
57
|
"zod": "^3.25.67"
|
|
49
58
|
},
|
|
50
59
|
"devDependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
},
|
|
60
|
-
"scripts": {
|
|
61
|
-
"build": "tsdown",
|
|
62
|
-
"dev": "tsdown --watch",
|
|
63
|
-
"start": "tsx src/index.ts",
|
|
64
|
-
"test": "vitest run",
|
|
65
|
-
"test:watch": "vitest",
|
|
66
|
-
"tsc": "tsc --noEmit"
|
|
60
|
+
"@sentry/mcp-core": "workspace:*",
|
|
61
|
+
"@sentry/mcp-server-mocks": "workspace:*",
|
|
62
|
+
"@sentry/mcp-server-tsconfig": "workspace:*",
|
|
63
|
+
"@types/node": "catalog:",
|
|
64
|
+
"tsdown": "catalog:",
|
|
65
|
+
"tsx": "catalog:",
|
|
66
|
+
"typescript": "catalog:",
|
|
67
|
+
"vitest": "catalog:"
|
|
67
68
|
}
|
|
68
|
-
}
|
|
69
|
+
}
|
package/LICENSE.md
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# Functional Source License, Version 1.1, Apache 2.0 Future License
|
|
2
|
-
|
|
3
|
-
## Abbreviation
|
|
4
|
-
|
|
5
|
-
FSL-1.1-Apache-2.0
|
|
6
|
-
|
|
7
|
-
## Notice
|
|
8
|
-
|
|
9
|
-
Copyright 2008-2024 Functional Software, Inc. dba Sentry
|
|
10
|
-
|
|
11
|
-
## Terms and Conditions
|
|
12
|
-
|
|
13
|
-
### Licensor ("We")
|
|
14
|
-
|
|
15
|
-
The party offering the Software under these Terms and Conditions.
|
|
16
|
-
|
|
17
|
-
### The Software
|
|
18
|
-
|
|
19
|
-
The "Software" is each version of the software that we make available under
|
|
20
|
-
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
-
Conditions with the Software.
|
|
22
|
-
|
|
23
|
-
### License Grant
|
|
24
|
-
|
|
25
|
-
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
-
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
-
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
-
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
-
|
|
30
|
-
### Permitted Purpose
|
|
31
|
-
|
|
32
|
-
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
-
means making the Software available to others in a commercial product or
|
|
34
|
-
service that:
|
|
35
|
-
|
|
36
|
-
1. substitutes for the Software;
|
|
37
|
-
|
|
38
|
-
2. substitutes for any other product or service we offer using the Software
|
|
39
|
-
that exists as of the date we make the Software available; or
|
|
40
|
-
|
|
41
|
-
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
-
|
|
43
|
-
Permitted Purposes specifically include using the Software:
|
|
44
|
-
|
|
45
|
-
1. for your internal use and access;
|
|
46
|
-
|
|
47
|
-
2. for non-commercial education;
|
|
48
|
-
|
|
49
|
-
3. for non-commercial research; and
|
|
50
|
-
|
|
51
|
-
4. in connection with professional services that you provide to a licensee
|
|
52
|
-
using the Software in accordance with these Terms and Conditions.
|
|
53
|
-
|
|
54
|
-
### Patents
|
|
55
|
-
|
|
56
|
-
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
-
patents, the license grant above includes a license under our patents. If you
|
|
58
|
-
make a claim against any party that the Software infringes or contributes to
|
|
59
|
-
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
-
immediately.
|
|
61
|
-
|
|
62
|
-
### Redistribution
|
|
63
|
-
|
|
64
|
-
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
-
the Software.
|
|
66
|
-
|
|
67
|
-
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
-
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
-
remove any copyright notices provided in or with the Software.
|
|
70
|
-
|
|
71
|
-
### Disclaimer
|
|
72
|
-
|
|
73
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
-
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
-
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
-
|
|
77
|
-
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
-
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
-
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
-
|
|
81
|
-
### Trademarks
|
|
82
|
-
|
|
83
|
-
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
-
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
-
trademarks, trade names, service marks or product names.
|
|
86
|
-
|
|
87
|
-
## Grant of Future License
|
|
88
|
-
|
|
89
|
-
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
-
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
-
the date we make the Software available. On or after that date, you may use the
|
|
92
|
-
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
-
will apply:
|
|
94
|
-
|
|
95
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
-
this file except in compliance with the License.
|
|
97
|
-
|
|
98
|
-
You may obtain a copy of the License at
|
|
99
|
-
|
|
100
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
-
|
|
102
|
-
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
-
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
-
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
-
specific language governing permissions and limitations under the License.
|