@sentry/mcp-server 0.30.0 → 0.32.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 (136) hide show
  1. package/dist/auth/constants.cjs +9 -0
  2. package/dist/auth/constants.d.cts +31 -0
  3. package/dist/auth/constants.d.cts.map +1 -0
  4. package/dist/auth/constants.d.ts +31 -0
  5. package/dist/auth/constants.d.ts.map +1 -0
  6. package/dist/auth/constants.js +3 -0
  7. package/dist/auth/device-code-flow.cjs +10 -0
  8. package/dist/auth/device-code-flow.d.cts +34 -0
  9. package/dist/auth/device-code-flow.d.cts.map +1 -0
  10. package/dist/auth/device-code-flow.d.ts +34 -0
  11. package/dist/auth/device-code-flow.d.ts.map +1 -0
  12. package/dist/auth/device-code-flow.js +6 -0
  13. package/dist/auth/resolve-token.cjs +8 -0
  14. package/dist/auth/resolve-token.d.cts +17 -0
  15. package/dist/auth/resolve-token.d.cts.map +1 -0
  16. package/dist/auth/resolve-token.d.ts +17 -0
  17. package/dist/auth/resolve-token.d.ts.map +1 -0
  18. package/dist/auth/resolve-token.js +8 -0
  19. package/dist/auth/token-cache.cjs +5 -0
  20. package/dist/auth/token-cache.d.cts +11 -0
  21. package/dist/auth/token-cache.d.cts.map +1 -0
  22. package/dist/auth/token-cache.d.ts +11 -0
  23. package/dist/auth/token-cache.d.ts.map +1 -0
  24. package/dist/auth/token-cache.js +3 -0
  25. package/dist/auth/types.cjs +7 -0
  26. package/dist/auth/types.d.cts +2 -0
  27. package/dist/auth/types.d.ts +2 -0
  28. package/dist/auth/types.js +3 -0
  29. package/dist/auth-DamN9R04.cjs +90 -0
  30. package/dist/auth-DamN9R04.cjs.map +1 -0
  31. package/dist/auth-XNi9K4Nz.js +79 -0
  32. package/dist/auth-XNi9K4Nz.js.map +1 -0
  33. package/dist/cli/commands/auth.cjs +11 -0
  34. package/dist/cli/commands/auth.d.cts +8 -0
  35. package/dist/cli/commands/auth.d.cts.map +1 -0
  36. package/dist/cli/commands/auth.d.ts +8 -0
  37. package/dist/cli/commands/auth.d.ts.map +1 -0
  38. package/dist/cli/commands/auth.js +10 -0
  39. package/dist/cli/parse.cjs +1 -1
  40. package/dist/cli/parse.d.cts +1 -1
  41. package/dist/cli/parse.d.cts.map +1 -1
  42. package/dist/cli/parse.d.ts +1 -1
  43. package/dist/cli/parse.d.ts.map +1 -1
  44. package/dist/cli/parse.js +1 -1
  45. package/dist/cli/resolve.cjs +4 -2
  46. package/dist/cli/resolve.d.cts +9 -3
  47. package/dist/cli/resolve.d.cts.map +1 -1
  48. package/dist/cli/resolve.d.ts +9 -3
  49. package/dist/cli/resolve.d.ts.map +1 -1
  50. package/dist/cli/resolve.js +3 -2
  51. package/dist/cli/types.d.cts +2 -2
  52. package/dist/cli/types.d.ts +2 -2
  53. package/dist/cli/usage.cjs +1 -1
  54. package/dist/cli/usage.js +1 -1
  55. package/dist/{config-BYPjNBPX-CxPh7iM8.cjs → config-D1QOSX9W-BurxE_FB.cjs} +4 -4
  56. package/dist/{config-BYPjNBPX-CxPh7iM8.cjs.map → config-D1QOSX9W-BurxE_FB.cjs.map} +1 -1
  57. package/dist/{config-BYPjNBPX-CdPOenPb.js → config-D1QOSX9W-CtF1qegU.js} +4 -4
  58. package/dist/{config-BYPjNBPX-CdPOenPb.js.map → config-D1QOSX9W-CtF1qegU.js.map} +1 -1
  59. package/dist/config-DvaRyDc4.cjs +7 -0
  60. package/dist/{config-NKdlAxBc.js → config-UqbHNH-n.js} +1 -1
  61. package/dist/{resolve-Ci97NUwJ.js → constants-CnQOQOfw.js} +43 -122
  62. package/dist/constants-CnQOQOfw.js.map +1 -0
  63. package/dist/{resolve-CxQZsYhh.cjs → constants-zXY4MUBL.cjs} +84 -133
  64. package/dist/constants-zXY4MUBL.cjs.map +1 -0
  65. package/dist/device-code-flow-B-sYi7io.cjs +154 -0
  66. package/dist/device-code-flow-B-sYi7io.cjs.map +1 -0
  67. package/dist/device-code-flow-BCdcs8S7.js +124 -0
  68. package/dist/device-code-flow-BCdcs8S7.js.map +1 -0
  69. package/dist/index.cjs +1694 -808
  70. package/dist/index.cjs.map +1 -1
  71. package/dist/index.js +1678 -792
  72. package/dist/index.js.map +1 -1
  73. package/dist/{parse-c8rvP4YQ.js → parse-BC0czE2L.js} +3 -1
  74. package/dist/{parse-c8rvP4YQ.js.map → parse-BC0czE2L.js.map} +1 -1
  75. package/dist/{parse-C6k7VZkG.cjs → parse-CBlXTQfk.cjs} +3 -1
  76. package/dist/{parse-C6k7VZkG.cjs.map → parse-CBlXTQfk.cjs.map} +1 -1
  77. package/dist/resolve-D19wc4BJ.js +133 -0
  78. package/dist/resolve-D19wc4BJ.js.map +1 -0
  79. package/dist/resolve-DQS7cx8P.cjs +168 -0
  80. package/dist/resolve-DQS7cx8P.cjs.map +1 -0
  81. package/dist/resolve-token-BeHiwgSY.js +47 -0
  82. package/dist/resolve-token-BeHiwgSY.js.map +1 -0
  83. package/dist/resolve-token-DKH-nkWs.cjs +52 -0
  84. package/dist/resolve-token-DKH-nkWs.cjs.map +1 -0
  85. package/dist/{stdio-D7HAkmRe.js → stdio-B6V73MMI.js} +3 -7
  86. package/dist/stdio-B6V73MMI.js.map +1 -0
  87. package/dist/{stdio-BlFtz2dW.cjs → stdio-CSjj4HGd.cjs} +3 -19
  88. package/dist/stdio-CSjj4HGd.cjs.map +1 -0
  89. package/dist/{token-CwkkxgwR.js → token-D7eiINbV.js} +2 -2
  90. package/dist/{token-CwkkxgwR.js.map → token-D7eiINbV.js.map} +1 -1
  91. package/dist/{token-C7V4_3ji.cjs → token-Dx4qrxlx.cjs} +3 -3
  92. package/dist/{token-C7V4_3ji.cjs.map → token-Dx4qrxlx.cjs.map} +1 -1
  93. package/dist/token-cache-BTEUyVx2.js +66 -0
  94. package/dist/token-cache-BTEUyVx2.js.map +1 -0
  95. package/dist/token-cache-iqkTOca3.cjs +84 -0
  96. package/dist/token-cache-iqkTOca3.cjs.map +1 -0
  97. package/dist/{token-error-BCFB3iKM.cjs → token-error-x_miDBP3.cjs} +1 -1
  98. package/dist/{token-error-BCFB3iKM.cjs.map → token-error-x_miDBP3.cjs.map} +1 -1
  99. package/dist/{token-util-D5kD3Z8e.js → token-util-DtX1UM9f.js} +1 -1
  100. package/dist/{token-util-CQ4Ghf_7.js → token-util-VkLmCUNV.js} +1 -1
  101. package/dist/{token-util-CQ4Ghf_7.js.map → token-util-VkLmCUNV.js.map} +1 -1
  102. package/dist/{token-util-8fvl2CtH.cjs → token-util-bEa_1v46.cjs} +2 -2
  103. package/dist/{token-util-CMaRPlqM.cjs → token-util-oe0G9a-s.cjs} +2 -2
  104. package/dist/{token-util-CMaRPlqM.cjs.map → token-util-oe0G9a-s.cjs.map} +1 -1
  105. package/dist/transports/stdio.cjs +2 -1
  106. package/dist/transports/stdio.js +2 -1
  107. package/dist/types-BJpeKPWI.d.cts +112 -0
  108. package/dist/types-BJpeKPWI.d.cts.map +1 -0
  109. package/dist/types-C336ZSwF.js +57 -0
  110. package/dist/types-C336ZSwF.js.map +1 -0
  111. package/dist/types-DDkgkRP9.d.ts +112 -0
  112. package/dist/types-DDkgkRP9.d.ts.map +1 -0
  113. package/dist/types-DViCeKUc.cjs +87 -0
  114. package/dist/types-DViCeKUc.cjs.map +1 -0
  115. package/dist/{types-BZvFOe59.d.ts → types-T07_vWhw.d.cts} +15 -5
  116. package/dist/types-T07_vWhw.d.cts.map +1 -0
  117. package/dist/{types-C0DSLPbp.d.cts → types-uISvMJKw.d.ts} +15 -5
  118. package/dist/types-uISvMJKw.d.ts.map +1 -0
  119. package/dist/{usage-DAChHAia.cjs → usage-DqxR1zdC.cjs} +17 -6
  120. package/dist/usage-DqxR1zdC.cjs.map +1 -0
  121. package/dist/{usage-BRTpzFg9.js → usage-QnwsoeF4.js} +17 -6
  122. package/dist/usage-QnwsoeF4.js.map +1 -0
  123. package/dist/version-BBolBvwF.js +7 -0
  124. package/dist/version-BBolBvwF.js.map +1 -0
  125. package/dist/version-g6exOvkr.cjs +19 -0
  126. package/dist/version-g6exOvkr.cjs.map +1 -0
  127. package/package.json +5 -5
  128. package/dist/config-CLW41PUq.cjs +0 -7
  129. package/dist/resolve-Ci97NUwJ.js.map +0 -1
  130. package/dist/resolve-CxQZsYhh.cjs.map +0 -1
  131. package/dist/stdio-BlFtz2dW.cjs.map +0 -1
  132. package/dist/stdio-D7HAkmRe.js.map +0 -1
  133. package/dist/types-BZvFOe59.d.ts.map +0 -1
  134. package/dist/types-C0DSLPbp.d.cts.map +0 -1
  135. package/dist/usage-BRTpzFg9.js.map +0 -1
  136. package/dist/usage-DAChHAia.cjs.map +0 -1
@@ -1,19 +1,27 @@
1
1
 
2
2
  //#region src/cli/usage.ts
3
3
  function buildUsage(packageName, allSkills) {
4
- return `Usage: ${packageName} --access-token=<token> [--host=<host>]
4
+ return `Usage: ${packageName} [--access-token=<token>] [--host=<host>]
5
+ ${packageName} auth [login|logout|status]
5
6
 
6
- Required:
7
+ Commands:
8
+ auth login Authenticate via device code flow (sentry.io only)
9
+ auth logout Clear cached authentication
10
+ auth status Show current authentication state
11
+
12
+ Authentication:
7
13
  --access-token <token> Sentry User Auth Token with API access
14
+ Optional for sentry.io (device code flow is used if omitted)
15
+ Required for self-hosted instances
8
16
 
9
17
  Common optional flags:
10
18
  --host <host> Change Sentry host (self-hosted)
11
19
  --sentry-dsn <dsn> Override DSN used for telemetry reporting
12
20
  --agent Agent mode: only expose use_sentry tool (for AI agents)
13
- --experimental Enable experimental tools (hidden by default)
21
+ --experimental Enable forward-looking tool variants and experimental features
14
22
 
15
23
  Embedded agent configuration:
16
- --agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)
24
+ --agent-provider <provider> LLM provider: openai, azure-openai, or anthropic (auto-detects from API keys)
17
25
  --openai-base-url <url> Override OpenAI API base URL
18
26
  --openai-model <model> Override OpenAI model (default: gpt-5)
19
27
  --anthropic-base-url <url> Override Anthropic API base URL
@@ -31,16 +39,19 @@ All skills: ${allSkills.join(", ")}
31
39
 
32
40
  Environment variables:
33
41
  SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)
42
+ SENTRY_CLIENT_ID Override OAuth client ID for device code flow
34
43
  OPENAI_API_KEY OpenAI API key for AI-powered search tools
35
44
  ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools
36
- EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic
45
+ EMBEDDED_AGENT_PROVIDER Provider override: openai, azure-openai, or anthropic
37
46
  MCP_DISABLE_SKILLS Disable specific skills (comma-separated)
38
47
 
39
48
  Examples:
49
+ ${packageName} # device code auth (sentry.io only)
40
50
  ${packageName} --access-token=TOKEN
41
51
  ${packageName} --access-token=TOKEN --skills=inspect,triage
42
52
  ${packageName} --access-token=TOKEN --host=sentry.example.com
43
53
  ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer
54
+ ${packageName} --access-token=TOKEN --agent-provider=azure-openai --openai-base-url=https://example.openai.azure.com/openai/v1/
44
55
  ${packageName} --access-token=TOKEN --agent-provider=anthropic`;
45
56
  }
46
57
 
@@ -51,4 +62,4 @@ Object.defineProperty(exports, 'buildUsage', {
51
62
  return buildUsage;
52
63
  }
53
64
  });
54
- //# sourceMappingURL=usage-DAChHAia.cjs.map
65
+ //# sourceMappingURL=usage-DqxR1zdC.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage-DqxR1zdC.cjs","names":["packageName: string","allSkills: ReadonlyArray<Skill>"],"sources":["../src/cli/usage.ts"],"sourcesContent":["import type { Skill } from \"@sentry/mcp-core/skills\";\n\nexport function buildUsage(\n packageName: string,\n allSkills: ReadonlyArray<Skill>,\n): string {\n return `Usage: ${packageName} [--access-token=<token>] [--host=<host>]\n ${packageName} auth [login|logout|status]\n\nCommands:\n auth login Authenticate via device code flow (sentry.io only)\n auth logout Clear cached authentication\n auth status Show current authentication state\n\nAuthentication:\n --access-token <token> Sentry User Auth Token with API access\n Optional for sentry.io (device code flow is used if omitted)\n Required for self-hosted instances\n\nCommon optional flags:\n --host <host> Change Sentry host (self-hosted)\n --sentry-dsn <dsn> Override DSN used for telemetry reporting\n --agent Agent mode: only expose use_sentry tool (for AI agents)\n --experimental Enable forward-looking tool variants and experimental features\n\nEmbedded agent configuration:\n --agent-provider <provider> LLM provider: openai, azure-openai, or anthropic (auto-detects from API keys)\n --openai-base-url <url> Override OpenAI API base URL\n --openai-model <model> Override OpenAI model (default: gpt-5)\n --anthropic-base-url <url> Override Anthropic API base URL\n --anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)\n\nSession constraints:\n --organization-slug <slug> Force all calls to an organization\n --project-slug <slug> Optional project constraint\n\nSkill controls:\n --skills <list> Specify which skills to grant (default: all skills)\n --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)\n\nAll skills: ${allSkills.join(\", \")}\n\nEnvironment variables:\n SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)\n SENTRY_CLIENT_ID Override OAuth client ID for device code flow\n OPENAI_API_KEY OpenAI API key for AI-powered search tools\n ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools\n EMBEDDED_AGENT_PROVIDER Provider override: openai, azure-openai, or anthropic\n MCP_DISABLE_SKILLS Disable specific skills (comma-separated)\n\nExamples:\n ${packageName} # device code auth (sentry.io only)\n ${packageName} --access-token=TOKEN\n ${packageName} --access-token=TOKEN --skills=inspect,triage\n ${packageName} --access-token=TOKEN --host=sentry.example.com\n ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer\n ${packageName} --access-token=TOKEN --agent-provider=azure-openai --openai-base-url=https://example.openai.azure.com/openai/v1/\n ${packageName} --access-token=TOKEN --agent-provider=anthropic`;\n}\n"],"mappings":";;AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;SACtB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCP,UAAU,KAAK,KAAK,CAAC;;;;;;;;;;;IAW/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
@@ -1,18 +1,26 @@
1
1
  //#region src/cli/usage.ts
2
2
  function buildUsage(packageName, allSkills) {
3
- return `Usage: ${packageName} --access-token=<token> [--host=<host>]
3
+ return `Usage: ${packageName} [--access-token=<token>] [--host=<host>]
4
+ ${packageName} auth [login|logout|status]
4
5
 
5
- Required:
6
+ Commands:
7
+ auth login Authenticate via device code flow (sentry.io only)
8
+ auth logout Clear cached authentication
9
+ auth status Show current authentication state
10
+
11
+ Authentication:
6
12
  --access-token <token> Sentry User Auth Token with API access
13
+ Optional for sentry.io (device code flow is used if omitted)
14
+ Required for self-hosted instances
7
15
 
8
16
  Common optional flags:
9
17
  --host <host> Change Sentry host (self-hosted)
10
18
  --sentry-dsn <dsn> Override DSN used for telemetry reporting
11
19
  --agent Agent mode: only expose use_sentry tool (for AI agents)
12
- --experimental Enable experimental tools (hidden by default)
20
+ --experimental Enable forward-looking tool variants and experimental features
13
21
 
14
22
  Embedded agent configuration:
15
- --agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)
23
+ --agent-provider <provider> LLM provider: openai, azure-openai, or anthropic (auto-detects from API keys)
16
24
  --openai-base-url <url> Override OpenAI API base URL
17
25
  --openai-model <model> Override OpenAI model (default: gpt-5)
18
26
  --anthropic-base-url <url> Override Anthropic API base URL
@@ -30,19 +38,22 @@ All skills: ${allSkills.join(", ")}
30
38
 
31
39
  Environment variables:
32
40
  SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)
41
+ SENTRY_CLIENT_ID Override OAuth client ID for device code flow
33
42
  OPENAI_API_KEY OpenAI API key for AI-powered search tools
34
43
  ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools
35
- EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic
44
+ EMBEDDED_AGENT_PROVIDER Provider override: openai, azure-openai, or anthropic
36
45
  MCP_DISABLE_SKILLS Disable specific skills (comma-separated)
37
46
 
38
47
  Examples:
48
+ ${packageName} # device code auth (sentry.io only)
39
49
  ${packageName} --access-token=TOKEN
40
50
  ${packageName} --access-token=TOKEN --skills=inspect,triage
41
51
  ${packageName} --access-token=TOKEN --host=sentry.example.com
42
52
  ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer
53
+ ${packageName} --access-token=TOKEN --agent-provider=azure-openai --openai-base-url=https://example.openai.azure.com/openai/v1/
43
54
  ${packageName} --access-token=TOKEN --agent-provider=anthropic`;
44
55
  }
45
56
 
46
57
  //#endregion
47
58
  export { buildUsage };
48
- //# sourceMappingURL=usage-BRTpzFg9.js.map
59
+ //# sourceMappingURL=usage-QnwsoeF4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage-QnwsoeF4.js","names":["packageName: string","allSkills: ReadonlyArray<Skill>"],"sources":["../src/cli/usage.ts"],"sourcesContent":["import type { Skill } from \"@sentry/mcp-core/skills\";\n\nexport function buildUsage(\n packageName: string,\n allSkills: ReadonlyArray<Skill>,\n): string {\n return `Usage: ${packageName} [--access-token=<token>] [--host=<host>]\n ${packageName} auth [login|logout|status]\n\nCommands:\n auth login Authenticate via device code flow (sentry.io only)\n auth logout Clear cached authentication\n auth status Show current authentication state\n\nAuthentication:\n --access-token <token> Sentry User Auth Token with API access\n Optional for sentry.io (device code flow is used if omitted)\n Required for self-hosted instances\n\nCommon optional flags:\n --host <host> Change Sentry host (self-hosted)\n --sentry-dsn <dsn> Override DSN used for telemetry reporting\n --agent Agent mode: only expose use_sentry tool (for AI agents)\n --experimental Enable forward-looking tool variants and experimental features\n\nEmbedded agent configuration:\n --agent-provider <provider> LLM provider: openai, azure-openai, or anthropic (auto-detects from API keys)\n --openai-base-url <url> Override OpenAI API base URL\n --openai-model <model> Override OpenAI model (default: gpt-5)\n --anthropic-base-url <url> Override Anthropic API base URL\n --anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)\n\nSession constraints:\n --organization-slug <slug> Force all calls to an organization\n --project-slug <slug> Optional project constraint\n\nSkill controls:\n --skills <list> Specify which skills to grant (default: all skills)\n --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)\n\nAll skills: ${allSkills.join(\", \")}\n\nEnvironment variables:\n SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)\n SENTRY_CLIENT_ID Override OAuth client ID for device code flow\n OPENAI_API_KEY OpenAI API key for AI-powered search tools\n ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools\n EMBEDDED_AGENT_PROVIDER Provider override: openai, azure-openai, or anthropic\n MCP_DISABLE_SKILLS Disable specific skills (comma-separated)\n\nExamples:\n ${packageName} # device code auth (sentry.io only)\n ${packageName} --access-token=TOKEN\n ${packageName} --access-token=TOKEN --skills=inspect,triage\n ${packageName} --access-token=TOKEN --host=sentry.example.com\n ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer\n ${packageName} --access-token=TOKEN --agent-provider=azure-openai --openai-base-url=https://example.openai.azure.com/openai/v1/\n ${packageName} --access-token=TOKEN --agent-provider=anthropic`;\n}\n"],"mappings":";AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;SACtB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCP,UAAU,KAAK,KAAK,CAAC;;;;;;;;;;;IAW/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
@@ -0,0 +1,7 @@
1
+ //#region ../mcp-core/dist/version-Bfodi9aQ.js
2
+ const LIB_VERSION = typeof process !== "undefined" && "0.32.0" || "0.0.0";
3
+ const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
4
+
5
+ //#endregion
6
+ export { LIB_VERSION, USER_AGENT };
7
+ //# sourceMappingURL=version-BBolBvwF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-BBolBvwF.js","names":[],"sources":["../../mcp-core/dist/version-Bfodi9aQ.js"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.32.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-Bfodi9aQ.js.map"],"mappings":";AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY"}
@@ -0,0 +1,19 @@
1
+
2
+ //#region ../mcp-core/dist/version-Bfodi9aQ.js
3
+ const LIB_VERSION = typeof process !== "undefined" && "0.32.0" || "0.0.0";
4
+ const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
5
+
6
+ //#endregion
7
+ Object.defineProperty(exports, 'LIB_VERSION', {
8
+ enumerable: true,
9
+ get: function () {
10
+ return LIB_VERSION;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, 'USER_AGENT', {
14
+ enumerable: true,
15
+ get: function () {
16
+ return USER_AGENT;
17
+ }
18
+ });
19
+ //# sourceMappingURL=version-g6exOvkr.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-g6exOvkr.cjs","names":[],"sources":["../../mcp-core/dist/version-Bfodi9aQ.js"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.32.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-Bfodi9aQ.js.map"],"mappings":";;AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sentry/mcp-server",
3
3
  "mcpName": "io.github.getsentry/sentry-mcp",
4
- "version": "0.30.0",
4
+ "version": "0.32.0",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=20"
@@ -52,10 +52,10 @@
52
52
  "tsdown": "^0.12.9",
53
53
  "tsx": "^4.20.3",
54
54
  "typescript": "^5.8.3",
55
- "vitest": "^3.2.4",
56
- "@sentry/mcp-core": "0.30.0",
57
- "@sentry/mcp-server-mocks": "0.30.0",
58
- "@sentry/mcp-server-tsconfig": "0.30.0"
55
+ "vitest": "^4.1.2",
56
+ "@sentry/mcp-server-tsconfig": "0.32.0",
57
+ "@sentry/mcp-core": "0.32.0",
58
+ "@sentry/mcp-server-mocks": "0.32.0"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsdown",
@@ -1,7 +0,0 @@
1
- const require_config_BYPjNBPX = require('./config-BYPjNBPX-CxPh7iM8.cjs');
2
-
3
- exports.BASE_COMMON_FIELDS = require_config_BYPjNBPX.BASE_COMMON_FIELDS;
4
- exports.DATASET_EXAMPLES = require_config_BYPjNBPX.DATASET_EXAMPLES;
5
- exports.DATASET_FIELDS = require_config_BYPjNBPX.DATASET_FIELDS;
6
- exports.NUMERIC_FIELDS = require_config_BYPjNBPX.NUMERIC_FIELDS;
7
- exports.RECOMMENDED_FIELDS = require_config_BYPjNBPX.RECOMMENDED_FIELDS;
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-Ci97NUwJ.js","names":["invalid: string[]","source?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider: \"openai\" | \"anthropic\" | undefined"],"sources":["../../mcp-core/dist/skills-DEPBbN1h.js","../../mcp-core/dist/url-utils-hSW2gkfr.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: \"Search for errors, analyze traces, and explore event details\",\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: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\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, and DSNs\",\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 tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) if (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\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 DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn skill in SKILLS;\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 tools = toolsModule.default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) {\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 { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-DEPBbN1h.js.map","//#region src/utils/url-utils.ts\n/**\n* Determines if a Sentry instance is SaaS or self-hosted based on the host.\n* @param host The Sentry host (e.g., \"sentry.io\" or \"sentry.company.com\")\n* @returns true if SaaS instance, false if self-hosted\n*/\nfunction isSentryHost(host) {\n\treturn host === \"sentry.io\" || host.endsWith(\".sentry.io\");\n}\n/**\n* Generates a Sentry issue URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param issueId Issue identifier (e.g., \"PROJECT-123\")\n* @returns The complete issue URL\n*/\nfunction getIssueUrl(host, organizationSlug, issueId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;\n}\n/**\n* Generates a Sentry issues search URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Optional search query\n* @param projectSlugOrId Optional project slug or ID\n* @returns The complete issues search URL\n*/\nfunction getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;\n\tconst params = new URLSearchParams();\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (query) params.append(\"query\", query);\n\tconst queryString = params.toString();\n\tif (queryString) url += `?${queryString}`;\n\treturn url;\n}\n/**\n* Generates a Sentry trace URL for performance investigation.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param traceId Trace identifier\n* @returns The complete trace URL\n*/\nfunction getTraceUrl(host, organizationSlug, traceId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n}\n/**\n* Generates a Sentry events explorer URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Search query\n* @param dataset Dataset type\n* @param projectSlug Optional project slug\n* @param fields Optional fields to display\n* @returns The complete events explorer URL\n*/\nfunction getEventsExplorerUrl(host, organizationSlug, query, dataset = \"spans\", projectSlug, fields) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/explore/` : `https://${host}/organizations/${organizationSlug}/explore/`;\n\tconst params = new URLSearchParams();\n\tparams.append(\"query\", query);\n\tparams.append(\"dataset\", dataset);\n\tparams.append(\"layout\", \"table\");\n\tif (projectSlug) params.append(\"project\", projectSlug);\n\tif (fields && fields.length > 0) for (const field of fields) params.append(\"field\", field);\n\turl += `?${params.toString()}`;\n\treturn url;\n}\n/**\n* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction _validateSentryHostInternal(host) {\n\tif (host.startsWith(\"http://\") || host.startsWith(\"https://\")) throw new Error(\"SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.\");\n}\n/**\n* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction _validateAndParseSentryUrlInternal(url) {\n\tif (!url.startsWith(\"https://\")) throw new Error(\"SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).\");\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn parsedUrl.host;\n\t} catch (error) {\n\t\tthrow new Error(\"SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).\");\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param host The hostname to validate\n*/\nfunction validateSentryHost(host) {\n\ttry {\n\t\t_validateSentryHostInternal(host);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n*/\nfunction validateAndParseSentryUrl(url) {\n\ttry {\n\t\treturn _validateAndParseSentryUrlInternal(url);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error instead of exiting the process (for testing).\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction validateSentryHostThrows(host) {\n\t_validateSentryHostInternal(host);\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error instead of exiting the process (for testing).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction validateAndParseSentryUrlThrows(url) {\n\treturn _validateAndParseSentryUrlInternal(url);\n}\n/**\n* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.\n*\n* @param url The URL to validate and normalize\n* @returns The normalized URL string\n* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol\n*/\nfunction validateOpenAiBaseUrlThrows(url) {\n\tconst trimmed = url.trim();\n\tif (trimmed.length === 0) throw new Error(\"OPENAI base URL must not be empty.\");\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(trimmed);\n\t} catch (error) {\n\t\tthrow new Error(\"OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).\", { cause: error });\n\t}\n\tif (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") throw new Error(\"OPENAI base URL must use http or https scheme (e.g., https://example.com/v1).\");\n\treturn parsed.toString();\n}\n\n//#endregion\nexport { getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHost, validateSentryHostThrows };\n//# sourceMappingURL=url-utils-hSW2gkfr.js.map","import { ALL_SKILLS, parseSkills, type Skill } from \"@sentry/mcp-core/skills\";\nimport {\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport type { MergedArgs, ResolvedConfig } 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\nexport function finalize(input: MergedArgs): ResolvedConfig {\n // Access token required\n if (!input.accessToken) {\n throw new Error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n // Determine host from url/host with validation\n let sentryHost = \"sentry.io\";\n if (input.url) {\n sentryHost = validateAndParseSentryUrlThrows(input.url);\n } else if (input.host) {\n validateSentryHostThrows(input.host);\n sentryHost = input.host;\n }\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to ALL 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 skills (inspect, docs, seer, triage, project-management)\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) {\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 skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ALL_SKILLS);\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: \"openai\" | \"anthropic\" | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (provider !== \"openai\" && provider !== \"anthropic\") {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\" or \"anthropic\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n sentryHost,\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":";AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,QAAQ;EACP,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,sBAAsB;EACrB,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;AACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAY5E,M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M;EACjB,eAAe;EACf,aAAa,MAAM;EACnB,kBAAkB;EAClB,gBAAgB,MAAM;EACtB;EACA;EACA,kBAAkB,MAAM;EACxB,aAAa,MAAM;CACpB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-CxQZsYhh.cjs","names":["invalid: string[]","source?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider: \"openai\" | \"anthropic\" | undefined"],"sources":["../../mcp-core/dist/skills-DEPBbN1h.js","../../mcp-core/dist/url-utils-hSW2gkfr.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: \"Search for errors, analyze traces, and explore event details\",\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: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\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, and DSNs\",\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 tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) if (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\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 DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn skill in SKILLS;\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 tools = toolsModule.default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) {\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 { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-DEPBbN1h.js.map","//#region src/utils/url-utils.ts\n/**\n* Determines if a Sentry instance is SaaS or self-hosted based on the host.\n* @param host The Sentry host (e.g., \"sentry.io\" or \"sentry.company.com\")\n* @returns true if SaaS instance, false if self-hosted\n*/\nfunction isSentryHost(host) {\n\treturn host === \"sentry.io\" || host.endsWith(\".sentry.io\");\n}\n/**\n* Generates a Sentry issue URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param issueId Issue identifier (e.g., \"PROJECT-123\")\n* @returns The complete issue URL\n*/\nfunction getIssueUrl(host, organizationSlug, issueId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;\n}\n/**\n* Generates a Sentry issues search URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Optional search query\n* @param projectSlugOrId Optional project slug or ID\n* @returns The complete issues search URL\n*/\nfunction getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;\n\tconst params = new URLSearchParams();\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (query) params.append(\"query\", query);\n\tconst queryString = params.toString();\n\tif (queryString) url += `?${queryString}`;\n\treturn url;\n}\n/**\n* Generates a Sentry trace URL for performance investigation.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param traceId Trace identifier\n* @returns The complete trace URL\n*/\nfunction getTraceUrl(host, organizationSlug, traceId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n}\n/**\n* Generates a Sentry events explorer URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Search query\n* @param dataset Dataset type\n* @param projectSlug Optional project slug\n* @param fields Optional fields to display\n* @returns The complete events explorer URL\n*/\nfunction getEventsExplorerUrl(host, organizationSlug, query, dataset = \"spans\", projectSlug, fields) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/explore/` : `https://${host}/organizations/${organizationSlug}/explore/`;\n\tconst params = new URLSearchParams();\n\tparams.append(\"query\", query);\n\tparams.append(\"dataset\", dataset);\n\tparams.append(\"layout\", \"table\");\n\tif (projectSlug) params.append(\"project\", projectSlug);\n\tif (fields && fields.length > 0) for (const field of fields) params.append(\"field\", field);\n\turl += `?${params.toString()}`;\n\treturn url;\n}\n/**\n* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction _validateSentryHostInternal(host) {\n\tif (host.startsWith(\"http://\") || host.startsWith(\"https://\")) throw new Error(\"SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.\");\n}\n/**\n* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction _validateAndParseSentryUrlInternal(url) {\n\tif (!url.startsWith(\"https://\")) throw new Error(\"SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).\");\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn parsedUrl.host;\n\t} catch (error) {\n\t\tthrow new Error(\"SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).\");\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param host The hostname to validate\n*/\nfunction validateSentryHost(host) {\n\ttry {\n\t\t_validateSentryHostInternal(host);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n*/\nfunction validateAndParseSentryUrl(url) {\n\ttry {\n\t\treturn _validateAndParseSentryUrlInternal(url);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error instead of exiting the process (for testing).\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction validateSentryHostThrows(host) {\n\t_validateSentryHostInternal(host);\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error instead of exiting the process (for testing).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction validateAndParseSentryUrlThrows(url) {\n\treturn _validateAndParseSentryUrlInternal(url);\n}\n/**\n* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.\n*\n* @param url The URL to validate and normalize\n* @returns The normalized URL string\n* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol\n*/\nfunction validateOpenAiBaseUrlThrows(url) {\n\tconst trimmed = url.trim();\n\tif (trimmed.length === 0) throw new Error(\"OPENAI base URL must not be empty.\");\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(trimmed);\n\t} catch (error) {\n\t\tthrow new Error(\"OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).\", { cause: error });\n\t}\n\tif (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") throw new Error(\"OPENAI base URL must use http or https scheme (e.g., https://example.com/v1).\");\n\treturn parsed.toString();\n}\n\n//#endregion\nexport { getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHost, validateSentryHostThrows };\n//# sourceMappingURL=url-utils-hSW2gkfr.js.map","import { ALL_SKILLS, parseSkills, type Skill } from \"@sentry/mcp-core/skills\";\nimport {\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport type { MergedArgs, ResolvedConfig } 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\nexport function finalize(input: MergedArgs): ResolvedConfig {\n // Access token required\n if (!input.accessToken) {\n throw new Error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n // Determine host from url/host with validation\n let sentryHost = \"sentry.io\";\n if (input.url) {\n sentryHost = validateAndParseSentryUrlThrows(input.url);\n } else if (input.host) {\n validateSentryHostThrows(input.host);\n sentryHost = input.host;\n }\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to ALL 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 skills (inspect, docs, seer, triage, project-management)\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) {\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 skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ALL_SKILLS);\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: \"openai\" | \"anthropic\" | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (provider !== \"openai\" && provider !== \"anthropic\") {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\" or \"anthropic\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n sentryHost,\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":";;AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,QAAQ;EACP,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,sBAAsB;EACrB,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;AACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAY5E,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAM,iBAAiB,aAAa,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AACpF,SAAS,aAAa,OAAO;AAC5B,QAAO,SAAS;AAChB;AACD,SAAS,kBAAkB,eAAe,YAAY;AACrD,MAAK,iBAAiB,WAAW,WAAW,EAAG,QAAO;AACtD,QAAO,WAAW,KAAK,CAAC,UAAU,cAAc,IAAI,MAAM,CAAC;AAC3D;AACD,SAAS,YAAY,OAAO;CAC3B,MAAM,wBAAwB,IAAI;CAClC,MAAM,UAAU,CAAE;AAClB,MAAK,MAAO,QAAO;EAClB;EACA;CACA;CACD,IAAI,SAAS,CAAE;AACf,YAAW,UAAU,SAAU,UAAS,MAAM,MAAM,IAAI;UAC/C,MAAM,QAAQ,MAAM,CAAE,UAAS,MAAM,IAAI,CAAC,aAAa,MAAM,WAAW,IAAI,GAAG;AACxF,MAAK,M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,MAEC,eAAc,IAAI,IAAW;AAI/B,KAAI,MAAM,eAAe;EACvB,MAAM,EAAE,OAAO,iBAAiB,SAAS,GAAG,YAC1C,MAAM,cACP;AACD,MAAI,QAAQ,SAAS,EACnB,OAAM,IAAI,MAAM,oBAAoB,SAAS,mBAAmB;AAElE,OAAK,MAAM,SAAS,gBAClB,aAAY,OAAO,MAAM;AAE3B,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MACR;CAGL;CAED,MAAM,wBAAwB,MAAM,gBAChC,4BAA4B,MAAM,cAAc;CAIpD,MAAM,2BAA2B,MAAM,mBACnC,4BAA4B,MAAM,iBAAiB;CAIvD,IAAIC;AACJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MAAI,aAAa,YAAY,aAAa,YACxC,OAAM,IAAI,OACP,iCAAiC,MAAM,cAAc;AAG1D,kBAAgB;CACjB;AAED,QAAO;EACL,aAAa,MAAM;EACnB;EACA,QAAQ,MAAM;EACd,WAAW,MAAM;EACjB,eAAe;EACf,aAAa,MAAM;EACnB,kBAAkB;EAClB,gBAAgB,MAAM;EACtB;EACA;EACA,kBAAkB,MAAM;EACxB,aAAa,MAAM;CACpB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"stdio-BlFtz2dW.cjs","names":["server: McpServer","context: ServerContext","StdioServerTransport"],"sources":["../../mcp-core/dist/version-CQ6lY8HC.js","../src/transports/stdio.ts"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.30.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-CQ6lY8HC.js.map","/**\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 type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport type { ServerContext } from \"@sentry/mcp-core/types\";\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 - Server context with authentication and configuration (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(server: McpServer, context: ServerContext) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: {\n \"mcp.transport\": \"stdio\",\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n },\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":";;;;;AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmD7C,eAAsB,WAAWA,QAAmBC,SAAwB;AAC1E,OAAM,cAAO,cAAc,YAAY;AACrC,SAAO,MAAM,cAAO,UAClB;GACE,MAAM;GACN,YAAY;IACV,iBAAiB;IACjB,qBAAqB;IACrB,mBAAmB;GACpB;EACF,GACD,YAAY;GAEV,MAAM,YAAY,IAAIC;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"stdio-D7HAkmRe.js","names":["server: McpServer","context: ServerContext"],"sources":["../../mcp-core/dist/version-CQ6lY8HC.js","../src/transports/stdio.ts"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.30.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-CQ6lY8HC.js.map","/**\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 type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport type { ServerContext } from \"@sentry/mcp-core/types\";\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 - Server context with authentication and configuration (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(server: McpServer, context: ServerContext) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: {\n \"mcp.transport\": \"stdio\",\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n },\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":";;;;AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmD7C,eAAsB,WAAWA,QAAmBC,SAAwB;AAC1E,OAAM,OAAO,cAAc,YAAY;AACrC,SAAO,MAAM,OAAO,UAClB;GACE,MAAM;GACN,YAAY;IACV,iBAAiB;IACjB,qBAAqB;IACrB,mBAAmB;GACpB;EACF,GACD,YAAY;GAEV,MAAM,YAAY,IAAI;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-BZvFOe59.d.ts","names":[],"sources":["../src/cli/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,OAAA;;EAAA,IAAA,CAAA,EAAA,MAAO;EAsBP,GAAA,CAAA,EAAA,MAAO;EAaP,MAAA,CAAA,EAAA,MAAU;EAsBV,SAAA,CAAA,EAAA,MAAc;EAAA,aAAA,CAAA,EAAA,MAAA;EAAA,WAWP,CAAA,EAAA,MAAA;EAAK,gBAAT,CAAA,EAAA,MAAA;EAAG,cAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;KA9CN,OAAA;;;;;;;;;;;;KAaA,UAAA;;;;;;;;;;;;;;;;;;;;;KAsBA,cAAA;;;;;;;;;;;eAWG,IAAI"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-C0DSLPbp.d.cts","names":[],"sources":["../src/cli/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,OAAA;;EAAA,IAAA,CAAA,EAAA,MAAO;EAsBP,GAAA,CAAA,EAAA,MAAO;EAaP,MAAA,CAAA,EAAA,MAAU;EAsBV,SAAA,CAAA,EAAA,MAAc;EAAA,aAAA,CAAA,EAAA,MAAA;EAAA,WAWP,CAAA,EAAA,MAAA;EAAK,gBAAT,CAAA,EAAA,MAAA;EAAG,cAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;KA9CN,OAAA;;;;;;;;;;;;KAaA,UAAA;;;;;;;;;;;;;;;;;;;;;KAsBA,cAAA;;;;;;;;;;;eAWG,IAAI"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usage-BRTpzFg9.js","names":["packageName: string","allSkills: ReadonlyArray<Skill>"],"sources":["../src/cli/usage.ts"],"sourcesContent":["import type { Skill } from \"@sentry/mcp-core/skills\";\n\nexport function buildUsage(\n packageName: string,\n allSkills: ReadonlyArray<Skill>,\n): string {\n return `Usage: ${packageName} --access-token=<token> [--host=<host>]\n\nRequired:\n --access-token <token> Sentry User Auth Token with API access\n\nCommon optional flags:\n --host <host> Change Sentry host (self-hosted)\n --sentry-dsn <dsn> Override DSN used for telemetry reporting\n --agent Agent mode: only expose use_sentry tool (for AI agents)\n --experimental Enable experimental tools (hidden by default)\n\nEmbedded agent configuration:\n --agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)\n --openai-base-url <url> Override OpenAI API base URL\n --openai-model <model> Override OpenAI model (default: gpt-5)\n --anthropic-base-url <url> Override Anthropic API base URL\n --anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)\n\nSession constraints:\n --organization-slug <slug> Force all calls to an organization\n --project-slug <slug> Optional project constraint\n\nSkill controls:\n --skills <list> Specify which skills to grant (default: all skills)\n --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)\n\nAll skills: ${allSkills.join(\", \")}\n\nEnvironment variables:\n SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)\n OPENAI_API_KEY OpenAI API key for AI-powered search tools\n ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools\n EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic\n MCP_DISABLE_SKILLS Disable specific skills (comma-separated)\n\nExamples:\n ${packageName} --access-token=TOKEN\n ${packageName} --access-token=TOKEN --skills=inspect,triage\n ${packageName} --access-token=TOKEN --host=sentry.example.com\n ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer\n ${packageName} --access-token=TOKEN --agent-provider=anthropic`;\n}\n"],"mappings":";AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;cA0BjB,UAAU,KAAK,KAAK,CAAC;;;;;;;;;;IAU/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usage-DAChHAia.cjs","names":["packageName: string","allSkills: ReadonlyArray<Skill>"],"sources":["../src/cli/usage.ts"],"sourcesContent":["import type { Skill } from \"@sentry/mcp-core/skills\";\n\nexport function buildUsage(\n packageName: string,\n allSkills: ReadonlyArray<Skill>,\n): string {\n return `Usage: ${packageName} --access-token=<token> [--host=<host>]\n\nRequired:\n --access-token <token> Sentry User Auth Token with API access\n\nCommon optional flags:\n --host <host> Change Sentry host (self-hosted)\n --sentry-dsn <dsn> Override DSN used for telemetry reporting\n --agent Agent mode: only expose use_sentry tool (for AI agents)\n --experimental Enable experimental tools (hidden by default)\n\nEmbedded agent configuration:\n --agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)\n --openai-base-url <url> Override OpenAI API base URL\n --openai-model <model> Override OpenAI model (default: gpt-5)\n --anthropic-base-url <url> Override Anthropic API base URL\n --anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)\n\nSession constraints:\n --organization-slug <slug> Force all calls to an organization\n --project-slug <slug> Optional project constraint\n\nSkill controls:\n --skills <list> Specify which skills to grant (default: all skills)\n --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)\n\nAll skills: ${allSkills.join(\", \")}\n\nEnvironment variables:\n SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)\n OPENAI_API_KEY OpenAI API key for AI-powered search tools\n ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools\n EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic\n MCP_DISABLE_SKILLS Disable specific skills (comma-separated)\n\nExamples:\n ${packageName} --access-token=TOKEN\n ${packageName} --access-token=TOKEN --skills=inspect,triage\n ${packageName} --access-token=TOKEN --host=sentry.example.com\n ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer\n ${packageName} --access-token=TOKEN --agent-provider=anthropic`;\n}\n"],"mappings":";;AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;cA0BjB,UAAU,KAAK,KAAK,CAAC;;;;;;;;;;IAU/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}