@tokamohsen/sentry-mcp 0.29.7 → 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.
Files changed (77) hide show
  1. package/README.md +189 -0
  2. package/dist/index.cjs +33696 -34
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +33706 -45
  5. package/dist/index.js.map +1 -1
  6. package/dist/{token-GX19_oyM.cjs → token-B5HKFZKz.cjs} +2 -2
  7. package/dist/{token-GX19_oyM.cjs.map → token-B5HKFZKz.cjs.map} +1 -1
  8. package/dist/{token-CO5Bq1Ct.js → token-JvPeoopD.js} +2 -2
  9. package/dist/{token-CO5Bq1Ct.js.map → token-JvPeoopD.js.map} +1 -1
  10. package/dist/{token-util-Cw83HNFN.cjs → token-util-BNYjqouU.cjs} +1 -1
  11. package/dist/{token-util-Cw83HNFN.cjs.map → token-util-BNYjqouU.cjs.map} +1 -1
  12. package/dist/{token-util-1O_mwf8r.js → token-util-CqB8j8br.js} +2 -2
  13. package/dist/{token-util-1O_mwf8r.js.map → token-util-CqB8j8br.js.map} +1 -1
  14. package/dist/transports/{stdio-DeWUp4RP.d.cts → stdio-BoqvAN3P.d.cts} +1 -1
  15. package/dist/transports/{stdio-DeWUp4RP.d.cts.map → stdio-BoqvAN3P.d.cts.map} +1 -1
  16. package/dist/transports/{stdio-DKQR8J7l.d.ts → stdio-BvNog4wx.d.ts} +1 -1
  17. package/dist/transports/{stdio-DKQR8J7l.d.ts.map → stdio-BvNog4wx.d.ts.map} +1 -1
  18. package/dist/transports/stdio.cjs +1 -1
  19. package/dist/transports/stdio.js +1 -1
  20. package/dist/{version-BD4r13ze.cjs → version-BN5g2FHt.cjs} +1 -1
  21. package/dist/{version-BD4r13ze.cjs.map → version-BN5g2FHt.cjs.map} +1 -1
  22. package/dist/{version-4iOZzjiD.js → version-CV6JJx_P.js} +1 -1
  23. package/dist/{version-4iOZzjiD.js.map → version-CV6JJx_P.js.map} +1 -1
  24. package/package.json +19 -18
  25. package/LICENSE.md +0 -105
  26. package/dist/cli/parse-CX7Bcldr.d.ts +0 -11
  27. package/dist/cli/parse-CX7Bcldr.d.ts.map +0 -1
  28. package/dist/cli/parse-EvLqDjN2.d.cts +0 -11
  29. package/dist/cli/parse-EvLqDjN2.d.cts.map +0 -1
  30. package/dist/cli/parse.cjs +0 -107
  31. package/dist/cli/parse.cjs.map +0 -1
  32. package/dist/cli/parse.js +0 -103
  33. package/dist/cli/parse.js.map +0 -1
  34. package/dist/cli/resolve-BVtyZcQM.d.ts +0 -10
  35. package/dist/cli/resolve-BVtyZcQM.d.ts.map +0 -1
  36. package/dist/cli/resolve-C3hwH129.d.cts +0 -10
  37. package/dist/cli/resolve-C3hwH129.d.cts.map +0 -1
  38. package/dist/cli/resolve.cjs +0 -56
  39. package/dist/cli/resolve.cjs.map +0 -1
  40. package/dist/cli/resolve.js +0 -54
  41. package/dist/cli/resolve.js.map +0 -1
  42. package/dist/cli/types-CnTkIHzd.d.ts +0 -73
  43. package/dist/cli/types-CnTkIHzd.d.ts.map +0 -1
  44. package/dist/cli/types-VWgo1wm6.d.cts +0 -73
  45. package/dist/cli/types-VWgo1wm6.d.cts.map +0 -1
  46. package/dist/cli/types.cjs +0 -0
  47. package/dist/cli/types.js +0 -1
  48. package/dist/cli/usage-B0gAPy4S.d.cts +0 -9
  49. package/dist/cli/usage-B0gAPy4S.d.cts.map +0 -1
  50. package/dist/cli/usage-BhCVaC5j.d.ts +0 -9
  51. package/dist/cli/usage-BhCVaC5j.d.ts.map +0 -1
  52. package/dist/cli/usage.cjs +0 -47
  53. package/dist/cli/usage.cjs.map +0 -1
  54. package/dist/cli/usage.js +0 -45
  55. package/dist/cli/usage.js.map +0 -1
  56. package/dist/config-CzqCJmB9.js +0 -613
  57. package/dist/config-CzqCJmB9.js.map +0 -1
  58. package/dist/config-DMt6phB6.cjs +0 -630
  59. package/dist/config-DMt6phB6.cjs.map +0 -1
  60. package/dist/constants-BrEVt86y.js +0 -194
  61. package/dist/constants-BrEVt86y.js.map +0 -1
  62. package/dist/constants-C14tQf_s.cjs +0 -217
  63. package/dist/constants-C14tQf_s.cjs.map +0 -1
  64. package/dist/server-DduxvXpe.js +0 -32499
  65. package/dist/server-DduxvXpe.js.map +0 -1
  66. package/dist/server-lur5iSHk.cjs +0 -32530
  67. package/dist/server-lur5iSHk.cjs.map +0 -1
  68. package/dist/skills-DOgs9MAy.cjs +0 -96
  69. package/dist/skills-DOgs9MAy.cjs.map +0 -1
  70. package/dist/skills-DfqlqYXj.js +0 -72
  71. package/dist/skills-DfqlqYXj.js.map +0 -1
  72. package/dist/url-utils-BHhxlntO.js +0 -119
  73. package/dist/url-utils-BHhxlntO.js.map +0 -1
  74. package/dist/url-utils-N2ExJl9F.cjs +0 -161
  75. package/dist/url-utils-N2ExJl9F.cjs.map +0 -1
  76. /package/dist/{index-16fTC-hT.d.cts → index-Cxeq9ZuA.d.ts} +0 -0
  77. /package/dist/{index-UKPmYT-S.d.ts → index-XTv1ki6h.d.cts} +0 -0
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