@sentry/mcp-server 0.42.0 → 0.48.0

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 (162) hide show
  1. package/README.md +54 -0
  2. package/dist/sentry-mcp.cjs +3436 -0
  3. package/package.json +22 -40
  4. package/LICENSE.md +0 -105
  5. package/dist/auth/constants.cjs +0 -9
  6. package/dist/auth/constants.d.cts +0 -31
  7. package/dist/auth/constants.d.cts.map +0 -1
  8. package/dist/auth/constants.d.ts +0 -31
  9. package/dist/auth/constants.d.ts.map +0 -1
  10. package/dist/auth/constants.js +0 -3
  11. package/dist/auth/device-code-flow.cjs +0 -10
  12. package/dist/auth/device-code-flow.d.cts +0 -34
  13. package/dist/auth/device-code-flow.d.cts.map +0 -1
  14. package/dist/auth/device-code-flow.d.ts +0 -34
  15. package/dist/auth/device-code-flow.d.ts.map +0 -1
  16. package/dist/auth/device-code-flow.js +0 -6
  17. package/dist/auth/resolve-token.cjs +0 -8
  18. package/dist/auth/resolve-token.d.cts +0 -17
  19. package/dist/auth/resolve-token.d.cts.map +0 -1
  20. package/dist/auth/resolve-token.d.ts +0 -17
  21. package/dist/auth/resolve-token.d.ts.map +0 -1
  22. package/dist/auth/resolve-token.js +0 -8
  23. package/dist/auth/token-cache.cjs +0 -5
  24. package/dist/auth/token-cache.d.cts +0 -11
  25. package/dist/auth/token-cache.d.cts.map +0 -1
  26. package/dist/auth/token-cache.d.ts +0 -11
  27. package/dist/auth/token-cache.d.ts.map +0 -1
  28. package/dist/auth/token-cache.js +0 -3
  29. package/dist/auth/types.cjs +0 -7
  30. package/dist/auth/types.d.cts +0 -2
  31. package/dist/auth/types.d.ts +0 -2
  32. package/dist/auth/types.js +0 -3
  33. package/dist/auth-B__Aec1m.cjs +0 -90
  34. package/dist/auth-B__Aec1m.cjs.map +0 -1
  35. package/dist/auth-BtRpItji.js +0 -79
  36. package/dist/auth-BtRpItji.js.map +0 -1
  37. package/dist/blob-utils-B0ae0K-m-BF8kTomr.cjs +0 -4724
  38. package/dist/blob-utils-B0ae0K-m-BF8kTomr.cjs.map +0 -1
  39. package/dist/blob-utils-B0ae0K-m-BhC2W04C.js +0 -4701
  40. package/dist/blob-utils-B0ae0K-m-BhC2W04C.js.map +0 -1
  41. package/dist/blob-utils-BM8EcgEO.js +0 -3
  42. package/dist/blob-utils-DBvCs9nw.cjs +0 -3
  43. package/dist/chunk-CunrlGP7.js +0 -37
  44. package/dist/chunk-Cv9WC9bY.cjs +0 -58
  45. package/dist/cli/commands/auth.cjs +0 -11
  46. package/dist/cli/commands/auth.d.cts +0 -8
  47. package/dist/cli/commands/auth.d.cts.map +0 -1
  48. package/dist/cli/commands/auth.d.ts +0 -8
  49. package/dist/cli/commands/auth.d.ts.map +0 -1
  50. package/dist/cli/commands/auth.js +0 -10
  51. package/dist/cli/output.cjs +0 -3
  52. package/dist/cli/output.d.cts +0 -7
  53. package/dist/cli/output.d.cts.map +0 -1
  54. package/dist/cli/output.d.ts +0 -7
  55. package/dist/cli/output.d.ts.map +0 -1
  56. package/dist/cli/output.js +0 -3
  57. package/dist/cli/parse.cjs +0 -5
  58. package/dist/cli/parse.d.cts +0 -11
  59. package/dist/cli/parse.d.cts.map +0 -1
  60. package/dist/cli/parse.d.ts +0 -11
  61. package/dist/cli/parse.d.ts.map +0 -1
  62. package/dist/cli/parse.js +0 -3
  63. package/dist/cli/resolve.cjs +0 -6
  64. package/dist/cli/resolve.d.cts +0 -16
  65. package/dist/cli/resolve.d.cts.map +0 -1
  66. package/dist/cli/resolve.d.ts +0 -16
  67. package/dist/cli/resolve.d.ts.map +0 -1
  68. package/dist/cli/resolve.js +0 -4
  69. package/dist/cli/types.cjs +0 -0
  70. package/dist/cli/types.d.cts +0 -2
  71. package/dist/cli/types.d.ts +0 -2
  72. package/dist/cli/types.js +0 -0
  73. package/dist/cli/usage.cjs +0 -3
  74. package/dist/cli/usage.d.cts +0 -9
  75. package/dist/cli/usage.d.cts.map +0 -1
  76. package/dist/cli/usage.d.ts +0 -9
  77. package/dist/cli/usage.d.ts.map +0 -1
  78. package/dist/cli/usage.js +0 -3
  79. package/dist/config-40SaJWzQ-Bxau3bPR.cjs +0 -928
  80. package/dist/config-40SaJWzQ-Bxau3bPR.cjs.map +0 -1
  81. package/dist/config-40SaJWzQ-Dz27jdMQ.js +0 -886
  82. package/dist/config-40SaJWzQ-Dz27jdMQ.js.map +0 -1
  83. package/dist/config-DeGbV11k.cjs +0 -7
  84. package/dist/config-NGx6OsOU.js +0 -3
  85. package/dist/constants-CGu8w21D.js +0 -452
  86. package/dist/constants-CGu8w21D.js.map +0 -1
  87. package/dist/constants-Cw_BclsW.cjs +0 -644
  88. package/dist/constants-Cw_BclsW.cjs.map +0 -1
  89. package/dist/device-code-flow-afx1qvK6.cjs +0 -154
  90. package/dist/device-code-flow-afx1qvK6.cjs.map +0 -1
  91. package/dist/device-code-flow-mwBASRbi.js +0 -124
  92. package/dist/device-code-flow-mwBASRbi.js.map +0 -1
  93. package/dist/index.cjs +0 -61536
  94. package/dist/index.cjs.map +0 -1
  95. package/dist/index.d.cts +0 -1
  96. package/dist/index.d.ts +0 -1
  97. package/dist/index.js +0 -61537
  98. package/dist/index.js.map +0 -1
  99. package/dist/output-A_-7o7gV.js +0 -8
  100. package/dist/output-A_-7o7gV.js.map +0 -1
  101. package/dist/output-DEoNyYz7.cjs +0 -14
  102. package/dist/output-DEoNyYz7.cjs.map +0 -1
  103. package/dist/parse-CPY7-_2_.cjs +0 -130
  104. package/dist/parse-CPY7-_2_.cjs.map +0 -1
  105. package/dist/parse-Dd3OOgIq.js +0 -112
  106. package/dist/parse-Dd3OOgIq.js.map +0 -1
  107. package/dist/resolve-BvvBO-dw.cjs +0 -179
  108. package/dist/resolve-BvvBO-dw.cjs.map +0 -1
  109. package/dist/resolve-DOyeMm4X.js +0 -144
  110. package/dist/resolve-DOyeMm4X.js.map +0 -1
  111. package/dist/resolve-token-BHBj9ll0.js +0 -47
  112. package/dist/resolve-token-BHBj9ll0.js.map +0 -1
  113. package/dist/resolve-token-dsXzYI7-.cjs +0 -52
  114. package/dist/resolve-token-dsXzYI7-.cjs.map +0 -1
  115. package/dist/stdio-0Gl343e-.js +0 -59
  116. package/dist/stdio-0Gl343e-.js.map +0 -1
  117. package/dist/stdio-CZiqpRKP.cjs +0 -65
  118. package/dist/stdio-CZiqpRKP.cjs.map +0 -1
  119. package/dist/token-3xpHVxQo.js +0 -51
  120. package/dist/token-3xpHVxQo.js.map +0 -1
  121. package/dist/token-C7MavkKX.cjs +0 -55
  122. package/dist/token-C7MavkKX.cjs.map +0 -1
  123. package/dist/token-cache-ATUcs1cg.cjs +0 -84
  124. package/dist/token-cache-ATUcs1cg.cjs.map +0 -1
  125. package/dist/token-cache-DbZp4rvg.js +0 -66
  126. package/dist/token-cache-DbZp4rvg.js.map +0 -1
  127. package/dist/token-error-CBmJNKLY.js +0 -43
  128. package/dist/token-error-CBmJNKLY.js.map +0 -1
  129. package/dist/token-error-x_miDBP3.cjs +0 -48
  130. package/dist/token-error-x_miDBP3.cjs.map +0 -1
  131. package/dist/token-util-4bIYDTMS.js +0 -4
  132. package/dist/token-util-BRoQwIG6.cjs +0 -363
  133. package/dist/token-util-BRoQwIG6.cjs.map +0 -1
  134. package/dist/token-util-DurDL44i.cjs +0 -9
  135. package/dist/token-util-batRsXGA.js +0 -358
  136. package/dist/token-util-batRsXGA.js.map +0 -1
  137. package/dist/transports/stdio.cjs +0 -4
  138. package/dist/transports/stdio.d.cts +0 -40
  139. package/dist/transports/stdio.d.cts.map +0 -1
  140. package/dist/transports/stdio.d.ts +0 -40
  141. package/dist/transports/stdio.d.ts.map +0 -1
  142. package/dist/transports/stdio.js +0 -4
  143. package/dist/types-BCSxlxZI.js +0 -57
  144. package/dist/types-BCSxlxZI.js.map +0 -1
  145. package/dist/types-BGyk9F4G.d.ts +0 -61
  146. package/dist/types-BGyk9F4G.d.ts.map +0 -1
  147. package/dist/types-C9HgNyIE.d.cts +0 -61
  148. package/dist/types-C9HgNyIE.d.cts.map +0 -1
  149. package/dist/types-D-BIcaY4.d.ts +0 -91
  150. package/dist/types-D-BIcaY4.d.ts.map +0 -1
  151. package/dist/types-Dyacb-A8.d.cts +0 -91
  152. package/dist/types-Dyacb-A8.d.cts.map +0 -1
  153. package/dist/types-dghCRFW4.cjs +0 -87
  154. package/dist/types-dghCRFW4.cjs.map +0 -1
  155. package/dist/usage-DZ4QDygT.cjs +0 -74
  156. package/dist/usage-DZ4QDygT.cjs.map +0 -1
  157. package/dist/usage-Hi-6-LDr.js +0 -68
  158. package/dist/usage-Hi-6-LDr.js.map +0 -1
  159. package/dist/version-NjstoynH.js +0 -7
  160. package/dist/version-NjstoynH.js.map +0 -1
  161. package/dist/version-_1CmW0BF.cjs +0 -19
  162. package/dist/version-_1CmW0BF.cjs.map +0 -1
@@ -1,144 +0,0 @@
1
- import { DEFAULT_SENTRY_CLIENT_ID, isSentryHost, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHostThrows } from "./constants-CGu8w21D.js";
2
-
3
- //#region ../mcp-core/dist/skills-yShcMm-3.js
4
- const SKILLS = {
5
- inspect: {
6
- id: "inspect",
7
- name: "Inspect Issues & Events",
8
- description: "Read-only access to core Sentry data: issues, events, traces, replays, releases, cron monitors, uptime monitors, metric monitors, profiles, documentation, and project metadata",
9
- defaultEnabled: true,
10
- order: 1
11
- },
12
- seer: {
13
- id: "seer",
14
- name: "Seer",
15
- description: "Sentry's AI debugger that helps you analyze, root cause, and fix issues",
16
- defaultEnabled: true,
17
- order: 2
18
- },
19
- docs: {
20
- id: "docs",
21
- name: "Documentation",
22
- description: "Deprecated legacy docs-only grant. Documentation tools are now available through Inspect Issues & Events.",
23
- defaultEnabled: false,
24
- deprecated: true,
25
- order: 3
26
- },
27
- triage: {
28
- id: "triage",
29
- name: "Triage Issues",
30
- description: "Resolve, assign, and update issues",
31
- defaultEnabled: false,
32
- order: 4
33
- },
34
- "project-management": {
35
- id: "project-management",
36
- name: "Manage Projects & Teams",
37
- description: "Create and modify projects, teams, DSNs, uptime monitors, metric monitors, and alert rules",
38
- defaultEnabled: false,
39
- order: 5
40
- }
41
- };
42
- const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
43
- const ALL_SKILLS = Object.keys(SKILLS);
44
- const ACTIVE_SKILLS = SKILLS_ARRAY.filter((s) => !s.deprecated).map((s) => s.id);
45
- const DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);
46
- function isValidSkill(skill) {
47
- return Object.hasOwn(SKILLS, skill);
48
- }
49
- function isEnabledBySkills(grantedSkills, toolSkills) {
50
- if (!grantedSkills || toolSkills.length === 0) return false;
51
- return toolSkills.some((skill) => grantedSkills.has(skill));
52
- }
53
- function parseSkills(input) {
54
- const valid = /* @__PURE__ */ new Set();
55
- const invalid = [];
56
- if (!input) return {
57
- valid,
58
- invalid
59
- };
60
- let skills = [];
61
- if (typeof input === "string") skills = input.split(",");
62
- else if (Array.isArray(input)) skills = input.map((v) => typeof v === "string" ? v : "");
63
- for (const skill of skills) {
64
- const trimmed = String(skill).trim();
65
- if (isValidSkill(trimmed)) valid.add(trimmed);
66
- else if (trimmed) invalid.push(trimmed);
67
- }
68
- return {
69
- valid,
70
- invalid
71
- };
72
- }
73
-
74
- //#endregion
75
- //#region src/cli/resolve.ts
76
- function formatInvalidSkills(invalid, source) {
77
- const prefix = source ? `${source} provided` : "Invalid skills provided";
78
- return `Error: ${prefix}: ${invalid.join(", ")}\nAvailable skills: ${ALL_SKILLS.join(", ")}`;
79
- }
80
- /**
81
- * Resolves the Sentry host from url/host inputs with validation.
82
- * Used by both the server flow (finalize) and auth commands (resolveAuthContext)
83
- * to ensure cache keys always match.
84
- */
85
- function resolveHost(url, host) {
86
- if (url) return validateAndParseSentryUrlThrows(url);
87
- if (host) {
88
- validateSentryHostThrows(host);
89
- return host;
90
- }
91
- return "sentry.io";
92
- }
93
- function finalize(input) {
94
- if (input.insecureHttp && input.url) throw new Error("Error: --insecure-http cannot be used with --url or SENTRY_URL. Use --host for insecure self-hosted instances.");
95
- const sentryHost = resolveHost(input.url, input.host);
96
- if (input.insecureHttp && isSentryHost(sentryHost)) throw new Error("Error: --insecure-http is only supported for self-hosted Sentry hosts.");
97
- const sentryProtocol = input.insecureHttp ? "http" : "https";
98
- let finalSkills;
99
- if (input.skills && input.allSkills) throw new Error("Error: --all-skills cannot be combined with --skills.");
100
- if (input.allSkills) finalSkills = new Set(ACTIVE_SKILLS);
101
- else if (input.skills) {
102
- const { valid, invalid } = parseSkills(input.skills);
103
- if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
104
- if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
105
- finalSkills = valid;
106
- } else {
107
- finalSkills = new Set(ACTIVE_SKILLS);
108
- if (!isSentryHost(sentryHost)) finalSkills.delete("seer");
109
- }
110
- if (input.disableSkills) {
111
- const { valid: skillsToDisable, invalid } = parseSkills(input.disableSkills);
112
- if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid, "--disable-skills"));
113
- for (const skill of skillsToDisable) finalSkills.delete(skill);
114
- if (finalSkills.size === 0) throw new Error("Error: All skills have been disabled. At least one skill must remain enabled.");
115
- }
116
- const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
117
- const resolvedAnthropicBaseUrl = input.anthropicBaseUrl ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl) : void 0;
118
- let agentProvider = void 0;
119
- if (input.agentProvider) {
120
- const provider = input.agentProvider.toLowerCase();
121
- if (provider !== "openai" && provider !== "azure-openai" && provider !== "anthropic" && provider !== "openrouter") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai", "azure-openai", "anthropic", or "openrouter".`);
122
- agentProvider = provider;
123
- }
124
- return {
125
- accessToken: input.accessToken,
126
- clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,
127
- sentryHost,
128
- sentryProtocol,
129
- mcpUrl: input.mcpUrl,
130
- sentryDsn: input.sentryDsn,
131
- openaiBaseUrl: resolvedOpenAiBaseUrl,
132
- openaiModel: input.openaiModel,
133
- anthropicBaseUrl: resolvedAnthropicBaseUrl,
134
- anthropicModel: input.anthropicModel,
135
- agentProvider,
136
- finalSkills,
137
- organizationSlug: input.organizationSlug,
138
- projectSlug: input.projectSlug
139
- };
140
- }
141
-
142
- //#endregion
143
- export { ALL_SKILLS, SKILLS, finalize, formatInvalidSkills, isEnabledBySkills, resolveHost };
144
- //# sourceMappingURL=resolve-DOyeMm4X.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-DOyeMm4X.js","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined"],"sources":["../../mcp-core/dist/skills-yShcMm-3.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Read-only access to core Sentry data: issues, events, traces, replays, releases, cron monitors, uptime monitors, metric monitors, profiles, documentation, and project metadata\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Deprecated legacy docs-only grant. Documentation tools are now available through Inspect Issues & Events.\",\n\t\tdefaultEnabled: false,\n\t\tdeprecated: true,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, DSNs, uptime monitors, metric monitors, and alert rules\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) continue;\n\t\tif (tool.includeInSkillDefinitions === false) continue;\n\t\tif (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\n\t}\n\treturn SKILLS_ARRAY.map((skill) => ({\n\t\t...skill,\n\t\ttoolCount: counts.get(skill.id) || 0\n\t}));\n}\nconst ALL_SKILLS = Object.keys(SKILLS);\nconst ACTIVE_SKILLS = SKILLS_ARRAY.filter((s) => !s.deprecated).map((s) => s.id);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn Object.hasOwn(SKILLS, skill);\n}\nfunction isEnabledBySkills(grantedSkills, toolSkills) {\n\tif (!grantedSkills || toolSkills.length === 0) return false;\n\treturn toolSkills.some((skill) => grantedSkills.has(skill));\n}\nfunction parseSkills(input) {\n\tconst valid = /* @__PURE__ */ new Set();\n\tconst invalid = [];\n\tif (!input) return {\n\t\tvalid,\n\t\tinvalid\n\t};\n\tlet skills = [];\n\tif (typeof input === \"string\") skills = input.split(\",\");\n\telse if (Array.isArray(input)) skills = input.map((v) => typeof v === \"string\" ? v : \"\");\n\tfor (const skill of skills) {\n\t\tconst trimmed = String(skill).trim();\n\t\tif (isValidSkill(trimmed)) valid.add(trimmed);\n\t\telse if (trimmed) invalid.push(trimmed);\n\t}\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\nasync function getScopesForSkills(grantedSkills) {\n\tconst { DEFAULT_SCOPES } = await import(\"./constants.js\");\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) continue;\n\t\tconst toolEnabled = tool.skills.some((skill) => grantedSkills.has(skill));\n\t\tif (toolEnabled) for (const scope of tool.requiredScopes) scopes.add(scope);\n\t}\n\treturn scopes;\n}\n\n//#endregion\nexport { ACTIVE_SKILLS, ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-yShcMm-3.js.map","import {\n ACTIVE_SKILLS,\n ALL_SKILLS,\n parseSkills,\n type Skill,\n} from \"@sentry/mcp-core/skills\";\nimport {\n isSentryHost,\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport { DEFAULT_SENTRY_CLIENT_ID } from \"../auth/constants\";\nimport type { MergedArgs, PartiallyResolvedConfig } from \"./types\";\n\nexport function formatInvalidSkills(\n invalid: string[],\n source?: string,\n): string {\n const prefix = source ? `${source} provided` : \"Invalid skills provided\";\n return `Error: ${prefix}: ${invalid.join(\", \")}\\nAvailable skills: ${ALL_SKILLS.join(\", \")}`;\n}\n\n/**\n * Resolves the Sentry host from url/host inputs with validation.\n * Used by both the server flow (finalize) and auth commands (resolveAuthContext)\n * to ensure cache keys always match.\n */\nexport function resolveHost(url?: string, host?: string): string {\n if (url) {\n return validateAndParseSentryUrlThrows(url);\n }\n if (host) {\n validateSentryHostThrows(host);\n return host;\n }\n return \"sentry.io\";\n}\n\nexport function finalize(input: MergedArgs): PartiallyResolvedConfig {\n if (input.insecureHttp && input.url) {\n throw new Error(\n \"Error: --insecure-http cannot be used with --url or SENTRY_URL. Use --host for insecure self-hosted instances.\",\n );\n }\n\n const sentryHost = resolveHost(input.url, input.host);\n\n if (input.insecureHttp && isSentryHost(sentryHost)) {\n throw new Error(\n \"Error: --insecure-http is only supported for self-hosted Sentry hosts.\",\n );\n }\n\n const sentryProtocol = input.insecureHttp ? \"http\" : \"https\";\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to all active skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to all non-deprecated skills\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills && input.allSkills) {\n throw new Error(\"Error: --all-skills cannot be combined with --skills.\");\n }\n\n if (input.allSkills) {\n finalSkills = new Set<Skill>(ACTIVE_SKILLS);\n } else if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant all active skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ACTIVE_SKILLS);\n\n // Seer is a sentry.io service. Self-hosted Sentry ships without it, and its\n // autofix endpoints answer 500 when the Seer backend is not configured, so\n // every `get_issue_details` call (which fetches autofix state) and every\n // `analyze_issue_with_seer` poll loop would just generate server errors.\n // Leave Seer out of the implicit default on self-hosted hosts; users who\n // do run Seer can still opt in with --skills=seer or --all-skills.\n if (!isSentryHost(sentryHost)) {\n finalSkills.delete(\"seer\");\n }\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (\n provider !== \"openai\" &&\n provider !== \"azure-openai\" &&\n provider !== \"anthropic\" &&\n provider !== \"openrouter\"\n ) {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\", \"azure-openai\", \"anthropic\", or \"openrouter\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n sentryProtocol,\n mcpUrl: input.mcpUrl,\n sentryDsn: input.sentryDsn,\n openaiBaseUrl: resolvedOpenAiBaseUrl,\n openaiModel: input.openaiModel,\n anthropicBaseUrl: resolvedAnthropicBaseUrl,\n anthropicModel: input.anthropicModel,\n agentProvider,\n finalSkills,\n organizationSlug: input.organizationSlug,\n projectSlug: input.projectSlug,\n };\n}\n"],"mappings":"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"}
@@ -1,47 +0,0 @@
1
- import { OAUTH_HOST, isSentryHost } from "./constants-CGu8w21D.js";
2
- import { toCachedToken } from "./types-BCSxlxZI.js";
3
- import { authenticate } from "./device-code-flow-mwBASRbi.js";
4
- import { readCachedToken, writeCachedToken } from "./token-cache-DbZp4rvg.js";
5
-
6
- //#region src/auth/resolve-token.ts
7
- function withToken(partial, accessToken) {
8
- return {
9
- ...partial,
10
- accessToken
11
- };
12
- }
13
- /**
14
- * Resolves the access token for the session.
15
- *
16
- * If an access token is already provided, returns immediately.
17
- * If the host is sentry.io, attempts to use a cached token or
18
- * initiates the device code flow (only when stderr is a TTY).
19
- * For non-sentry.io hosts, throws an error requiring --access-token.
20
- */
21
- async function resolveAccessToken(partial) {
22
- if (partial.accessToken) return withToken(partial, partial.accessToken);
23
- if (!isSentryHost(partial.sentryHost)) throw new Error("Error: No access token was provided. Device code authentication is only supported for sentry.io.\nPass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
24
- const { clientId, sentryHost } = partial;
25
- try {
26
- const cached = await readCachedToken(sentryHost, clientId);
27
- if (cached) {
28
- process.stderr.write(`Using cached authentication for ${cached.user_email}\n`);
29
- return withToken(partial, cached.access_token);
30
- }
31
- } catch {}
32
- if (!process.stderr.isTTY) throw new Error("Error: No access token was provided.\nRun `sentry-mcp auth login` interactively first, or pass `--access-token` / `SENTRY_ACCESS_TOKEN`.");
33
- const tokenResponse = await authenticate({
34
- clientId,
35
- host: OAUTH_HOST
36
- });
37
- try {
38
- await writeCachedToken(toCachedToken(tokenResponse, sentryHost, clientId));
39
- } catch {
40
- process.stderr.write("Warning: Could not cache authentication token.\n");
41
- }
42
- return withToken(partial, tokenResponse.access_token);
43
- }
44
-
45
- //#endregion
46
- export { resolveAccessToken };
47
- //# sourceMappingURL=resolve-token-BHBj9ll0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-token-BHBj9ll0.js","names":["partial: PartiallyResolvedConfig","accessToken: string"],"sources":["../src/auth/resolve-token.ts"],"sourcesContent":["import type { PartiallyResolvedConfig, ResolvedConfig } from \"../cli/types\";\nimport { isSentryIo, OAUTH_HOST } from \"./constants\";\nimport { authenticate } from \"./device-code-flow\";\nimport { readCachedToken, writeCachedToken } from \"./token-cache\";\nimport { toCachedToken } from \"./types\";\n\nfunction withToken(\n partial: PartiallyResolvedConfig,\n accessToken: string,\n): ResolvedConfig {\n return { ...partial, accessToken };\n}\n\n/**\n * Resolves the access token for the session.\n *\n * If an access token is already provided, returns immediately.\n * If the host is sentry.io, attempts to use a cached token or\n * initiates the device code flow (only when stderr is a TTY).\n * For non-sentry.io hosts, throws an error requiring --access-token.\n */\nexport async function resolveAccessToken(\n partial: PartiallyResolvedConfig,\n): Promise<ResolvedConfig> {\n if (partial.accessToken) {\n return withToken(partial, partial.accessToken);\n }\n\n if (!isSentryIo(partial.sentryHost)) {\n throw new Error(\n \"Error: No access token was provided. Device code authentication is only supported for sentry.io.\\n\" +\n \"Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n const { clientId, sentryHost } = partial;\n\n // Try cached token first (works in both interactive and non-interactive contexts)\n try {\n const cached = await readCachedToken(sentryHost, clientId);\n if (cached) {\n process.stderr.write(\n `Using cached authentication for ${cached.user_email}\\n`,\n );\n return withToken(partial, cached.access_token);\n }\n } catch {\n // Cache read failure is non-fatal\n }\n\n // Device code flow requires a human to visit a URL and authorize.\n // In non-interactive contexts (CI, piped stdio), fail immediately\n // instead of hanging on the polling loop until expiry.\n if (!process.stderr.isTTY) {\n throw new Error(\n \"Error: No access token was provided.\\n\" +\n \"Run `sentry-mcp auth login` interactively first, or pass `--access-token` / `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n const tokenResponse = await authenticate({ clientId, host: OAUTH_HOST });\n\n try {\n await writeCachedToken(toCachedToken(tokenResponse, sentryHost, clientId));\n } catch {\n process.stderr.write(\"Warning: Could not cache authentication token.\\n\");\n }\n\n return withToken(partial, tokenResponse.access_token);\n}\n"],"mappings":";;;;;;AAMA,SAAS,UACPA,SACAC,aACgB;AAChB,QAAO;EAAE,GAAG;EAAS;CAAa;AACnC;;;;;;;;;AAUD,eAAsB,mBACpBD,SACyB;AACzB,KAAI,QAAQ,YACV,QAAO,UAAU,SAAS,QAAQ,YAAY;AAGhD,MAAK,aAAW,QAAQ,WAAW,CACjC,OAAM,IAAI,MACR;CAKJ,MAAM,EAAE,UAAU,YAAY,GAAG;AAGjC,KAAI;EACF,MAAM,SAAS,MAAM,gBAAgB,YAAY,SAAS;AAC1D,MAAI,QAAQ;AACV,WAAQ,OAAO,OACZ,kCAAkC,OAAO,WAAW,IACtD;AACD,UAAO,UAAU,SAAS,OAAO,aAAa;EAC/C;CACF,QAAO,CAEP;AAKD,MAAK,QAAQ,OAAO,MAClB,OAAM,IAAI,MACR;CAKJ,MAAM,gBAAgB,MAAM,aAAa;EAAE;EAAU,MAAM;CAAY,EAAC;AAExE,KAAI;AACF,QAAM,iBAAiB,cAAc,eAAe,YAAY,SAAS,CAAC;CAC3E,QAAO;AACN,UAAQ,OAAO,MAAM,mDAAmD;CACzE;AAED,QAAO,UAAU,SAAS,cAAc,aAAa;AACtD"}
@@ -1,52 +0,0 @@
1
- const require_constants = require('./constants-Cw_BclsW.cjs');
2
- const require_types = require('./types-dghCRFW4.cjs');
3
- const require_device_code_flow = require('./device-code-flow-afx1qvK6.cjs');
4
- const require_token_cache = require('./token-cache-ATUcs1cg.cjs');
5
-
6
- //#region src/auth/resolve-token.ts
7
- function withToken(partial, accessToken) {
8
- return {
9
- ...partial,
10
- accessToken
11
- };
12
- }
13
- /**
14
- * Resolves the access token for the session.
15
- *
16
- * If an access token is already provided, returns immediately.
17
- * If the host is sentry.io, attempts to use a cached token or
18
- * initiates the device code flow (only when stderr is a TTY).
19
- * For non-sentry.io hosts, throws an error requiring --access-token.
20
- */
21
- async function resolveAccessToken(partial) {
22
- if (partial.accessToken) return withToken(partial, partial.accessToken);
23
- if (!require_constants.isSentryHost(partial.sentryHost)) throw new Error("Error: No access token was provided. Device code authentication is only supported for sentry.io.\nPass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
24
- const { clientId, sentryHost } = partial;
25
- try {
26
- const cached = await require_token_cache.readCachedToken(sentryHost, clientId);
27
- if (cached) {
28
- process.stderr.write(`Using cached authentication for ${cached.user_email}\n`);
29
- return withToken(partial, cached.access_token);
30
- }
31
- } catch {}
32
- if (!process.stderr.isTTY) throw new Error("Error: No access token was provided.\nRun `sentry-mcp auth login` interactively first, or pass `--access-token` / `SENTRY_ACCESS_TOKEN`.");
33
- const tokenResponse = await require_device_code_flow.authenticate({
34
- clientId,
35
- host: require_constants.OAUTH_HOST
36
- });
37
- try {
38
- await require_token_cache.writeCachedToken(require_types.toCachedToken(tokenResponse, sentryHost, clientId));
39
- } catch {
40
- process.stderr.write("Warning: Could not cache authentication token.\n");
41
- }
42
- return withToken(partial, tokenResponse.access_token);
43
- }
44
-
45
- //#endregion
46
- Object.defineProperty(exports, 'resolveAccessToken', {
47
- enumerable: true,
48
- get: function () {
49
- return resolveAccessToken;
50
- }
51
- });
52
- //# sourceMappingURL=resolve-token-dsXzYI7-.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-token-dsXzYI7-.cjs","names":["partial: PartiallyResolvedConfig","accessToken: string","OAUTH_HOST"],"sources":["../src/auth/resolve-token.ts"],"sourcesContent":["import type { PartiallyResolvedConfig, ResolvedConfig } from \"../cli/types\";\nimport { isSentryIo, OAUTH_HOST } from \"./constants\";\nimport { authenticate } from \"./device-code-flow\";\nimport { readCachedToken, writeCachedToken } from \"./token-cache\";\nimport { toCachedToken } from \"./types\";\n\nfunction withToken(\n partial: PartiallyResolvedConfig,\n accessToken: string,\n): ResolvedConfig {\n return { ...partial, accessToken };\n}\n\n/**\n * Resolves the access token for the session.\n *\n * If an access token is already provided, returns immediately.\n * If the host is sentry.io, attempts to use a cached token or\n * initiates the device code flow (only when stderr is a TTY).\n * For non-sentry.io hosts, throws an error requiring --access-token.\n */\nexport async function resolveAccessToken(\n partial: PartiallyResolvedConfig,\n): Promise<ResolvedConfig> {\n if (partial.accessToken) {\n return withToken(partial, partial.accessToken);\n }\n\n if (!isSentryIo(partial.sentryHost)) {\n throw new Error(\n \"Error: No access token was provided. Device code authentication is only supported for sentry.io.\\n\" +\n \"Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n const { clientId, sentryHost } = partial;\n\n // Try cached token first (works in both interactive and non-interactive contexts)\n try {\n const cached = await readCachedToken(sentryHost, clientId);\n if (cached) {\n process.stderr.write(\n `Using cached authentication for ${cached.user_email}\\n`,\n );\n return withToken(partial, cached.access_token);\n }\n } catch {\n // Cache read failure is non-fatal\n }\n\n // Device code flow requires a human to visit a URL and authorize.\n // In non-interactive contexts (CI, piped stdio), fail immediately\n // instead of hanging on the polling loop until expiry.\n if (!process.stderr.isTTY) {\n throw new Error(\n \"Error: No access token was provided.\\n\" +\n \"Run `sentry-mcp auth login` interactively first, or pass `--access-token` / `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n const tokenResponse = await authenticate({ clientId, host: OAUTH_HOST });\n\n try {\n await writeCachedToken(toCachedToken(tokenResponse, sentryHost, clientId));\n } catch {\n process.stderr.write(\"Warning: Could not cache authentication token.\\n\");\n }\n\n return withToken(partial, tokenResponse.access_token);\n}\n"],"mappings":";;;;;;AAMA,SAAS,UACPA,SACAC,aACgB;AAChB,QAAO;EAAE,GAAG;EAAS;CAAa;AACnC;;;;;;;;;AAUD,eAAsB,mBACpBD,SACyB;AACzB,KAAI,QAAQ,YACV,QAAO,UAAU,SAAS,QAAQ,YAAY;AAGhD,MAAK,+BAAW,QAAQ,WAAW,CACjC,OAAM,IAAI,MACR;CAKJ,MAAM,EAAE,UAAU,YAAY,GAAG;AAGjC,KAAI;EACF,MAAM,SAAS,MAAM,oCAAgB,YAAY,SAAS;AAC1D,MAAI,QAAQ;AACV,WAAQ,OAAO,OACZ,kCAAkC,OAAO,WAAW,IACtD;AACD,UAAO,UAAU,SAAS,OAAO,aAAa;EAC/C;CACF,QAAO,CAEP;AAKD,MAAK,QAAQ,OAAO,MAClB,OAAM,IAAI,MACR;CAKJ,MAAM,gBAAgB,MAAM,sCAAa;EAAE;EAAU,MAAME;CAAY,EAAC;AAExE,KAAI;AACF,QAAM,qCAAiB,4BAAc,eAAe,YAAY,SAAS,CAAC;CAC3E,QAAO;AACN,UAAQ,OAAO,MAAM,mDAAmD;CACzE;AAED,QAAO,UAAU,SAAS,cAAc,aAAa;AACtD"}
@@ -1,59 +0,0 @@
1
- import { LIB_VERSION } from "./version-NjstoynH.js";
2
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
- import * as Sentry from "@sentry/node";
4
-
5
- //#region src/transports/stdio.ts
6
- function getStdioSpanAttributes(context) {
7
- const attributes = {
8
- "app.transport": "stdio",
9
- "app.server.version": LIB_VERSION,
10
- "app.server.mode.experimental": context.experimentalMode ?? false,
11
- "network.transport": "pipe",
12
- "service.version": LIB_VERSION
13
- };
14
- if (context.sentryHost) attributes["app.upstream.host"] = context.sentryHost;
15
- if (context.mcpUrl) attributes["app.url.full"] = context.mcpUrl;
16
- return attributes;
17
- }
18
- /**
19
- * Starts the MCP server with stdio transport and telemetry.
20
- *
21
- * Connects the server using stdio transport for process-based communication.
22
- * Context is already captured in tool handler closures during buildServer().
23
- * All operations are wrapped in Sentry tracing for observability.
24
- *
25
- * @param server - Configured and instrumented MCP server instance (with context in closures)
26
- * @param context - Context values used for telemetry attributes
27
- *
28
- * @example CLI Integration
29
- * ```typescript
30
- * import { buildServer } from "./server.js";
31
- * import { startStdio } from "./transports/stdio.js";
32
- *
33
- * const context = {
34
- * accessToken: userToken,
35
- * sentryHost: "sentry.io",
36
- * userId: "user-123",
37
- * clientId: "cursor-ide",
38
- * constraints: {}
39
- * };
40
- *
41
- * const server = buildServer({ context }); // Context captured in closures
42
- * await startStdio(server, context);
43
- * ```
44
- */
45
- async function startStdio(server, context) {
46
- await Sentry.startNewTrace(async () => {
47
- return await Sentry.startSpan({
48
- name: "mcp.server/stdio",
49
- attributes: getStdioSpanAttributes(context)
50
- }, async () => {
51
- const transport = new StdioServerTransport();
52
- await server.connect(transport);
53
- });
54
- });
55
- }
56
-
57
- //#endregion
58
- export { startStdio };
59
- //# sourceMappingURL=stdio-0Gl343e-.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stdio-0Gl343e-.js","names":["context: StdioServerContext","attributes: Record<string, string | boolean>","server: McpServer","context: Context"],"sources":["../src/transports/stdio.ts"],"sourcesContent":["import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\n/**\n * Standard I/O Transport for MCP Server.\n *\n * Provides stdio-based communication for the Sentry MCP server, typically used\n * when the server runs as a subprocess communicating via stdin/stdout pipes.\n *\n * @example Basic Usage\n * ```typescript\n * import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const server = new Server();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\"\n * };\n *\n * await startStdio(server, context);\n * ```\n */\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport * as Sentry from \"@sentry/node\";\n\nexport type StdioServerContext = {\n sentryHost?: string;\n mcpUrl?: string;\n experimentalMode?: boolean;\n};\n\nfunction getStdioSpanAttributes(\n context: StdioServerContext,\n): Record<string, string | boolean> {\n const attributes: Record<string, string | boolean> = {\n \"app.transport\": \"stdio\",\n \"app.server.version\": LIB_VERSION,\n \"app.server.mode.experimental\": context.experimentalMode ?? false,\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n };\n\n if (context.sentryHost) {\n attributes[\"app.upstream.host\"] = context.sentryHost;\n }\n if (context.mcpUrl) {\n attributes[\"app.url.full\"] = context.mcpUrl;\n }\n\n return attributes;\n}\n\n/**\n * Starts the MCP server with stdio transport and telemetry.\n *\n * Connects the server using stdio transport for process-based communication.\n * Context is already captured in tool handler closures during buildServer().\n * All operations are wrapped in Sentry tracing for observability.\n *\n * @param server - Configured and instrumented MCP server instance (with context in closures)\n * @param context - Context values used for telemetry attributes\n *\n * @example CLI Integration\n * ```typescript\n * import { buildServer } from \"./server.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const context = {\n * accessToken: userToken,\n * sentryHost: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\",\n * constraints: {}\n * };\n *\n * const server = buildServer({ context }); // Context captured in closures\n * await startStdio(server, context);\n * ```\n */\nexport async function startStdio<Context extends StdioServerContext>(\n server: McpServer,\n context: Context,\n) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: getStdioSpanAttributes(context),\n },\n async () => {\n // Context already captured in tool handler closures during buildServer()\n const transport = new StdioServerTransport();\n await server.connect(transport);\n },\n );\n });\n}\n"],"mappings":";;;;;AA+BA,SAAS,uBACPA,SACkC;CAClC,MAAMC,aAA+C;EACnD,iBAAiB;EACjB,sBAAsB;EACtB,gCAAgC,QAAQ,oBAAoB;EAC5D,qBAAqB;EACrB,mBAAmB;CACpB;AAED,KAAI,QAAQ,WACV,YAAW,uBAAuB,QAAQ;AAE5C,KAAI,QAAQ,OACV,YAAW,kBAAkB,QAAQ;AAGvC,QAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,eAAsB,WACpBC,QACAC,SACA;AACA,OAAM,OAAO,cAAc,YAAY;AACrC,SAAO,MAAM,OAAO,UAClB;GACE,MAAM;GACN,YAAY,uBAAuB,QAAQ;EAC5C,GACD,YAAY;GAEV,MAAM,YAAY,IAAI;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
@@ -1,65 +0,0 @@
1
- const require_chunk = require('./chunk-Cv9WC9bY.cjs');
2
- const require_version = require('./version-_1CmW0BF.cjs');
3
- const __modelcontextprotocol_sdk_server_stdio_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/stdio.js"));
4
- const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
5
-
6
- //#region src/transports/stdio.ts
7
- function getStdioSpanAttributes(context) {
8
- const attributes = {
9
- "app.transport": "stdio",
10
- "app.server.version": require_version.LIB_VERSION,
11
- "app.server.mode.experimental": context.experimentalMode ?? false,
12
- "network.transport": "pipe",
13
- "service.version": require_version.LIB_VERSION
14
- };
15
- if (context.sentryHost) attributes["app.upstream.host"] = context.sentryHost;
16
- if (context.mcpUrl) attributes["app.url.full"] = context.mcpUrl;
17
- return attributes;
18
- }
19
- /**
20
- * Starts the MCP server with stdio transport and telemetry.
21
- *
22
- * Connects the server using stdio transport for process-based communication.
23
- * Context is already captured in tool handler closures during buildServer().
24
- * All operations are wrapped in Sentry tracing for observability.
25
- *
26
- * @param server - Configured and instrumented MCP server instance (with context in closures)
27
- * @param context - Context values used for telemetry attributes
28
- *
29
- * @example CLI Integration
30
- * ```typescript
31
- * import { buildServer } from "./server.js";
32
- * import { startStdio } from "./transports/stdio.js";
33
- *
34
- * const context = {
35
- * accessToken: userToken,
36
- * sentryHost: "sentry.io",
37
- * userId: "user-123",
38
- * clientId: "cursor-ide",
39
- * constraints: {}
40
- * };
41
- *
42
- * const server = buildServer({ context }); // Context captured in closures
43
- * await startStdio(server, context);
44
- * ```
45
- */
46
- async function startStdio(server, context) {
47
- await __sentry_node.startNewTrace(async () => {
48
- return await __sentry_node.startSpan({
49
- name: "mcp.server/stdio",
50
- attributes: getStdioSpanAttributes(context)
51
- }, async () => {
52
- const transport = new __modelcontextprotocol_sdk_server_stdio_js.StdioServerTransport();
53
- await server.connect(transport);
54
- });
55
- });
56
- }
57
-
58
- //#endregion
59
- Object.defineProperty(exports, 'startStdio', {
60
- enumerable: true,
61
- get: function () {
62
- return startStdio;
63
- }
64
- });
65
- //# sourceMappingURL=stdio-CZiqpRKP.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stdio-CZiqpRKP.cjs","names":["context: StdioServerContext","attributes: Record<string, string | boolean>","LIB_VERSION","server: McpServer","context: Context","StdioServerTransport"],"sources":["../src/transports/stdio.ts"],"sourcesContent":["import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\n/**\n * Standard I/O Transport for MCP Server.\n *\n * Provides stdio-based communication for the Sentry MCP server, typically used\n * when the server runs as a subprocess communicating via stdin/stdout pipes.\n *\n * @example Basic Usage\n * ```typescript\n * import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const server = new Server();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\"\n * };\n *\n * await startStdio(server, context);\n * ```\n */\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport * as Sentry from \"@sentry/node\";\n\nexport type StdioServerContext = {\n sentryHost?: string;\n mcpUrl?: string;\n experimentalMode?: boolean;\n};\n\nfunction getStdioSpanAttributes(\n context: StdioServerContext,\n): Record<string, string | boolean> {\n const attributes: Record<string, string | boolean> = {\n \"app.transport\": \"stdio\",\n \"app.server.version\": LIB_VERSION,\n \"app.server.mode.experimental\": context.experimentalMode ?? false,\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n };\n\n if (context.sentryHost) {\n attributes[\"app.upstream.host\"] = context.sentryHost;\n }\n if (context.mcpUrl) {\n attributes[\"app.url.full\"] = context.mcpUrl;\n }\n\n return attributes;\n}\n\n/**\n * Starts the MCP server with stdio transport and telemetry.\n *\n * Connects the server using stdio transport for process-based communication.\n * Context is already captured in tool handler closures during buildServer().\n * All operations are wrapped in Sentry tracing for observability.\n *\n * @param server - Configured and instrumented MCP server instance (with context in closures)\n * @param context - Context values used for telemetry attributes\n *\n * @example CLI Integration\n * ```typescript\n * import { buildServer } from \"./server.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const context = {\n * accessToken: userToken,\n * sentryHost: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\",\n * constraints: {}\n * };\n *\n * const server = buildServer({ context }); // Context captured in closures\n * await startStdio(server, context);\n * ```\n */\nexport async function startStdio<Context extends StdioServerContext>(\n server: McpServer,\n context: Context,\n) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: getStdioSpanAttributes(context),\n },\n async () => {\n // Context already captured in tool handler closures during buildServer()\n const transport = new StdioServerTransport();\n await server.connect(transport);\n },\n );\n });\n}\n"],"mappings":";;;;;;AA+BA,SAAS,uBACPA,SACkC;CAClC,MAAMC,aAA+C;EACnD,iBAAiB;EACjB,sBAAsBC;EACtB,gCAAgC,QAAQ,oBAAoB;EAC5D,qBAAqB;EACrB,mBAAmBA;CACpB;AAED,KAAI,QAAQ,WACV,YAAW,uBAAuB,QAAQ;AAE5C,KAAI,QAAQ,OACV,YAAW,kBAAkB,QAAQ;AAGvC,QAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,eAAsB,WACpBC,QACAC,SACA;AACA,OAAM,cAAO,cAAc,YAAY;AACrC,SAAO,MAAM,cAAO,UAClB;GACE,MAAM;GACN,YAAY,uBAAuB,QAAQ;EAC5C,GACD,YAAY;GAEV,MAAM,YAAY,IAAIC;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
@@ -1,51 +0,0 @@
1
- import { __commonJS } from "./chunk-CunrlGP7.js";
2
- import { require_token_error } from "./token-error-CBmJNKLY.js";
3
- import { require_token_util } from "./token-util-batRsXGA.js";
4
-
5
- //#region ../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js
6
- var require_token = __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
7
- var __defProp = Object.defineProperty;
8
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __export = (target, all) => {
12
- for (var name in all) __defProp(target, name, {
13
- get: all[name],
14
- enumerable: true
15
- });
16
- };
17
- var __copyProps = (to, from, except, desc) => {
18
- if (from && typeof from === "object" || typeof from === "function") {
19
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
20
- get: () => from[key],
21
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
22
- });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var token_exports = {};
28
- __export(token_exports, { refreshToken: () => refreshToken });
29
- module.exports = __toCommonJS(token_exports);
30
- var import_token_error = require_token_error();
31
- var import_token_util = require_token_util();
32
- async function refreshToken() {
33
- const { projectId, teamId } = (0, import_token_util.findProjectInfo)();
34
- let maybeToken = (0, import_token_util.loadToken)(projectId);
35
- if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
36
- const authToken = await (0, import_token_util.getVercelCliToken)();
37
- if (!authToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");
38
- if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");
39
- maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
40
- if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
41
- (0, import_token_util.saveToken)(maybeToken, projectId);
42
- }
43
- process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
44
- return;
45
- }
46
- } });
47
-
48
- //#endregion
49
- export default require_token();
50
-
51
- //# sourceMappingURL=token-3xpHVxQo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token-3xpHVxQo.js","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken() {\n const { projectId, teamId } = (0, import_token_util.findProjectInfo)();\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {\n const authToken = await (0, import_token_util.getVercelCliToken)();\n if (!authToken) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`\"\n );\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: Try re-linking your project with `vc link`\"\n );\n }\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,WAAW,CAAC,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;EAAM,EAAC;CAChE;CACD,IAAI,cAAc,CAAC,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,eAAe,SAAS,mBAAmB,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,MAAK,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,KAAK,MAAM,KAAK;IAAM,cAAc,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;GAAY,EAAC;EAAC;AAEzH,SAAO;CACR;CACD,IAAI,eAAe,CAAC,QAAQ,YAAY,UAAU,CAAE,GAAE,cAAc,EAAE,OAAO,KAAM,EAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,CAAE;AACtB,UAAS,eAAe,EACtB,cAAc,MAAM,aACrB,EAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,eAAe;EAC5B,MAAM,EAAE,WAAW,QAAQ,GAAG,CAAC,GAAG,kBAAkB,kBAAkB;EACtE,IAAI,aAAa,CAAC,GAAG,kBAAkB,WAAW,UAAU;AAC5D,OAAK,cAAc,CAAC,GAAG,kBAAkB,WAAW,CAAC,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,CAAC,EAAE;GAC7G,MAAM,YAAY,MAAM,CAAC,GAAG,kBAAkB,oBAAoB;AAClE,QAAK,UACH,OAAM,IAAI,mBAAmB,qBAC3B;AAGJ,QAAK,UACH,OAAM,IAAI,mBAAmB,qBAC3B;AAGJ,gBAAa,MAAM,CAAC,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,QAAK,WACH,OAAM,IAAI,mBAAmB,qBAAqB;AAEpD,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;EACxD;AACD,UAAQ,IAAI,oBAAoB,WAAW;AAC3C;CACD"}
@@ -1,55 +0,0 @@
1
- const require_chunk = require('./chunk-Cv9WC9bY.cjs');
2
- const require_token_error$1 = require('./token-error-x_miDBP3.cjs');
3
- const require_token_util$1 = require('./token-util-BRoQwIG6.cjs');
4
-
5
- //#region ../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js
6
- var require_token = require_chunk.__commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
7
- var __defProp = Object.defineProperty;
8
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __export = (target, all) => {
12
- for (var name in all) __defProp(target, name, {
13
- get: all[name],
14
- enumerable: true
15
- });
16
- };
17
- var __copyProps = (to, from, except, desc) => {
18
- if (from && typeof from === "object" || typeof from === "function") {
19
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
20
- get: () => from[key],
21
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
22
- });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var token_exports = {};
28
- __export(token_exports, { refreshToken: () => refreshToken });
29
- module.exports = __toCommonJS(token_exports);
30
- var import_token_error = require_token_error$1.require_token_error();
31
- var import_token_util = require_token_util$1.require_token_util();
32
- async function refreshToken() {
33
- const { projectId, teamId } = (0, import_token_util.findProjectInfo)();
34
- let maybeToken = (0, import_token_util.loadToken)(projectId);
35
- if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
36
- const authToken = await (0, import_token_util.getVercelCliToken)();
37
- if (!authToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");
38
- if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");
39
- maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
40
- if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
41
- (0, import_token_util.saveToken)(maybeToken, projectId);
42
- }
43
- process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
44
- return;
45
- }
46
- } });
47
-
48
- //#endregion
49
- Object.defineProperty(exports, 'default', {
50
- enumerable: true,
51
- get: function () {
52
- return require_token();
53
- }
54
- });
55
- //# sourceMappingURL=token-C7MavkKX.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token-C7MavkKX.cjs","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken() {\n const { projectId, teamId } = (0, import_token_util.findProjectInfo)();\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {\n const authToken = await (0, import_token_util.getVercelCliToken)();\n if (!authToken) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`\"\n );\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: Try re-linking your project with `vc link`\"\n );\n }\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,WAAW,CAAC,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;EAAM,EAAC;CAChE;CACD,IAAI,cAAc,CAAC,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,eAAe,SAAS,mBAAmB,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,MAAK,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,KAAK,MAAM,KAAK;IAAM,cAAc,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;GAAY,EAAC;EAAC;AAEzH,SAAO;CACR;CACD,IAAI,eAAe,CAAC,QAAQ,YAAY,UAAU,CAAE,GAAE,cAAc,EAAE,OAAO,KAAM,EAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,CAAE;AACtB,UAAS,eAAe,EACtB,cAAc,MAAM,aACrB,EAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,eAAe;EAC5B,MAAM,EAAE,WAAW,QAAQ,GAAG,CAAC,GAAG,kBAAkB,kBAAkB;EACtE,IAAI,aAAa,CAAC,GAAG,kBAAkB,WAAW,UAAU;AAC5D,OAAK,cAAc,CAAC,GAAG,kBAAkB,WAAW,CAAC,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,CAAC,EAAE;GAC7G,MAAM,YAAY,MAAM,CAAC,GAAG,kBAAkB,oBAAoB;AAClE,QAAK,UACH,OAAM,IAAI,mBAAmB,qBAC3B;AAGJ,QAAK,UACH,OAAM,IAAI,mBAAmB,qBAC3B;AAGJ,gBAAa,MAAM,CAAC,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,QAAK,WACH,OAAM,IAAI,mBAAmB,qBAAqB;AAEpD,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;EACxD;AACD,UAAQ,IAAI,oBAAoB,WAAW;AAC3C;CACD"}