@sentry/mcp-server 0.24.0 → 0.25.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.
- package/dist/cli/parse.cjs +1 -1
- package/dist/cli/parse.d.cts +1 -1
- package/dist/cli/parse.d.cts.map +1 -1
- package/dist/cli/parse.d.ts +1 -1
- package/dist/cli/parse.d.ts.map +1 -1
- package/dist/cli/parse.js +1 -1
- package/dist/cli/resolve.cjs +1 -2
- package/dist/cli/resolve.d.cts +2 -3
- package/dist/cli/resolve.d.cts.map +1 -1
- package/dist/cli/resolve.d.ts +2 -3
- package/dist/cli/resolve.d.ts.map +1 -1
- package/dist/cli/resolve.js +2 -2
- package/dist/cli/types.d.cts +1 -1
- package/dist/cli/types.d.ts +1 -1
- package/dist/cli/usage.cjs +1 -1
- package/dist/cli/usage.d.cts +1 -2
- package/dist/cli/usage.d.cts.map +1 -1
- package/dist/cli/usage.d.ts +1 -2
- package/dist/cli/usage.d.ts.map +1 -1
- package/dist/cli/usage.js +1 -1
- package/dist/config-BEgU9ylR.js +3 -0
- package/dist/{config-DtimzxvV-D3ccpxhQ.cjs → config-BoFBjXRq-CGHqlnJ9.cjs} +296 -4
- package/dist/config-BoFBjXRq-CGHqlnJ9.cjs.map +1 -0
- package/dist/{config-DtimzxvV-BItTrGiz.js → config-BoFBjXRq-CMdBQOkQ.js} +291 -5
- package/dist/config-BoFBjXRq-CMdBQOkQ.js.map +1 -0
- package/dist/config-rZ982IEm.cjs +7 -0
- package/dist/index.cjs +333 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +329 -160
- package/dist/index.js.map +1 -1
- package/dist/{parse-Dn9XeQSj.js → parse-46t_fITC.js} +2 -26
- package/dist/parse-46t_fITC.js.map +1 -0
- package/dist/{parse-By6nDBNs.cjs → parse-BjIH83SX.cjs} +2 -26
- package/dist/parse-BjIH83SX.cjs.map +1 -0
- package/dist/resolve-CdTP9riu.cjs +286 -0
- package/dist/resolve-CdTP9riu.cjs.map +1 -0
- package/dist/resolve-Cg3SH2zt.js +232 -0
- package/dist/resolve-Cg3SH2zt.js.map +1 -0
- package/dist/{stdio-iRuX-anh.cjs → stdio-Cl-Ib8bu.cjs} +4 -4
- package/dist/{stdio-iRuX-anh.cjs.map → stdio-Cl-Ib8bu.cjs.map} +1 -1
- package/dist/{stdio-Cp-EJZB9.js → stdio-CwqdTAhY.js} +4 -4
- package/dist/{stdio-Cp-EJZB9.js.map → stdio-CwqdTAhY.js.map} +1 -1
- package/dist/transports/stdio.cjs +1 -1
- package/dist/transports/stdio.js +1 -1
- package/dist/{types-CM88pHH_.d.ts → types-D5f00mg9.d.ts} +2 -11
- package/dist/types-D5f00mg9.d.ts.map +1 -0
- package/dist/{types-CnLRMjvf.d.cts → types-DpmAC3S8.d.cts} +2 -11
- package/dist/types-DpmAC3S8.d.cts.map +1 -0
- package/dist/{usage-DMGbIpV-.js → usage-BzYvqaru.js} +3 -11
- package/dist/usage-BzYvqaru.js.map +1 -0
- package/dist/{usage-iwGZsu3a.cjs → usage-DD58xBe3.cjs} +3 -11
- package/dist/usage-DD58xBe3.cjs.map +1 -0
- package/package.json +5 -4
- package/dist/config-Bs1p6XwV.js +0 -3
- package/dist/config-DFewJLVx.cjs +0 -6
- package/dist/config-DtimzxvV-BItTrGiz.js.map +0 -1
- package/dist/config-DtimzxvV-D3ccpxhQ.cjs.map +0 -1
- package/dist/parse-By6nDBNs.cjs.map +0 -1
- package/dist/parse-Dn9XeQSj.js.map +0 -1
- package/dist/resolve-BCdS4js5.js +0 -590
- package/dist/resolve-BCdS4js5.js.map +0 -1
- package/dist/resolve-BMmRdCFJ.cjs +0 -692
- package/dist/resolve-BMmRdCFJ.cjs.map +0 -1
- package/dist/types-CM88pHH_.d.ts.map +0 -1
- package/dist/types-CnLRMjvf.d.cts.map +0 -1
- package/dist/usage-DMGbIpV-.js.map +0 -1
- package/dist/usage-iwGZsu3a.cjs.map +0 -1
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
//#region ../mcp-core/dist/skills-DEPBbN1h.js
|
|
2
|
+
const SKILLS = {
|
|
3
|
+
inspect: {
|
|
4
|
+
id: "inspect",
|
|
5
|
+
name: "Inspect Issues & Events",
|
|
6
|
+
description: "Search for errors, analyze traces, and explore event details",
|
|
7
|
+
defaultEnabled: true,
|
|
8
|
+
order: 1
|
|
9
|
+
},
|
|
10
|
+
seer: {
|
|
11
|
+
id: "seer",
|
|
12
|
+
name: "Seer",
|
|
13
|
+
description: "Sentry's AI debugger that helps you analyze, root cause, and fix issues",
|
|
14
|
+
defaultEnabled: true,
|
|
15
|
+
order: 2
|
|
16
|
+
},
|
|
17
|
+
docs: {
|
|
18
|
+
id: "docs",
|
|
19
|
+
name: "Documentation",
|
|
20
|
+
description: "Search and read Sentry SDK documentation",
|
|
21
|
+
defaultEnabled: false,
|
|
22
|
+
order: 3
|
|
23
|
+
},
|
|
24
|
+
triage: {
|
|
25
|
+
id: "triage",
|
|
26
|
+
name: "Triage Issues",
|
|
27
|
+
description: "Resolve, assign, and update issues",
|
|
28
|
+
defaultEnabled: false,
|
|
29
|
+
order: 4
|
|
30
|
+
},
|
|
31
|
+
"project-management": {
|
|
32
|
+
id: "project-management",
|
|
33
|
+
name: "Manage Projects & Teams",
|
|
34
|
+
description: "Create and modify projects, teams, and DSNs",
|
|
35
|
+
defaultEnabled: false,
|
|
36
|
+
order: 5
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
|
|
40
|
+
const ALL_SKILLS = Object.keys(SKILLS);
|
|
41
|
+
const DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);
|
|
42
|
+
function isValidSkill(skill) {
|
|
43
|
+
return skill in SKILLS;
|
|
44
|
+
}
|
|
45
|
+
function isEnabledBySkills(grantedSkills, toolSkills) {
|
|
46
|
+
if (!grantedSkills || toolSkills.length === 0) return false;
|
|
47
|
+
return toolSkills.some((skill) => grantedSkills.has(skill));
|
|
48
|
+
}
|
|
49
|
+
function parseSkills(input) {
|
|
50
|
+
const valid = /* @__PURE__ */ new Set();
|
|
51
|
+
const invalid = [];
|
|
52
|
+
if (!input) return {
|
|
53
|
+
valid,
|
|
54
|
+
invalid
|
|
55
|
+
};
|
|
56
|
+
let skills = [];
|
|
57
|
+
if (typeof input === "string") skills = input.split(",");
|
|
58
|
+
else if (Array.isArray(input)) skills = input.map((v) => typeof v === "string" ? v : "");
|
|
59
|
+
for (const skill of skills) {
|
|
60
|
+
const trimmed = String(skill).trim();
|
|
61
|
+
if (isValidSkill(trimmed)) valid.add(trimmed);
|
|
62
|
+
else if (trimmed) invalid.push(trimmed);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
valid,
|
|
66
|
+
invalid
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../mcp-core/dist/url-utils-hSW2gkfr.js
|
|
72
|
+
/**
|
|
73
|
+
* Determines if a Sentry instance is SaaS or self-hosted based on the host.
|
|
74
|
+
* @param host The Sentry host (e.g., "sentry.io" or "sentry.company.com")
|
|
75
|
+
* @returns true if SaaS instance, false if self-hosted
|
|
76
|
+
*/
|
|
77
|
+
function isSentryHost(host) {
|
|
78
|
+
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Generates a Sentry issue URL.
|
|
82
|
+
* @param host The Sentry host (may include regional subdomain for API access)
|
|
83
|
+
* @param organizationSlug Organization identifier
|
|
84
|
+
* @param issueId Issue identifier (e.g., "PROJECT-123")
|
|
85
|
+
* @returns The complete issue URL
|
|
86
|
+
*/
|
|
87
|
+
function getIssueUrl(host, organizationSlug, issueId) {
|
|
88
|
+
const isSaas = isSentryHost(host);
|
|
89
|
+
const webHost = isSaas ? "sentry.io" : host;
|
|
90
|
+
return isSaas ? `https://${organizationSlug}.${webHost}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Generates a Sentry issues search URL.
|
|
94
|
+
* @param host The Sentry host (may include regional subdomain for API access)
|
|
95
|
+
* @param organizationSlug Organization identifier
|
|
96
|
+
* @param query Optional search query
|
|
97
|
+
* @param projectSlugOrId Optional project slug or ID
|
|
98
|
+
* @returns The complete issues search URL
|
|
99
|
+
*/
|
|
100
|
+
function getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {
|
|
101
|
+
const isSaas = isSentryHost(host);
|
|
102
|
+
const webHost = isSaas ? "sentry.io" : host;
|
|
103
|
+
let url = isSaas ? `https://${organizationSlug}.${webHost}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;
|
|
104
|
+
const params = new URLSearchParams();
|
|
105
|
+
if (projectSlugOrId) params.append("project", projectSlugOrId);
|
|
106
|
+
if (query) params.append("query", query);
|
|
107
|
+
const queryString = params.toString();
|
|
108
|
+
if (queryString) url += `?${queryString}`;
|
|
109
|
+
return url;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Generates a Sentry trace URL for performance investigation.
|
|
113
|
+
* @param host The Sentry host (may include regional subdomain for API access)
|
|
114
|
+
* @param organizationSlug Organization identifier
|
|
115
|
+
* @param traceId Trace identifier
|
|
116
|
+
* @returns The complete trace URL
|
|
117
|
+
*/
|
|
118
|
+
function getTraceUrl(host, organizationSlug, traceId) {
|
|
119
|
+
const isSaas = isSentryHost(host);
|
|
120
|
+
const webHost = isSaas ? "sentry.io" : host;
|
|
121
|
+
return isSaas ? `https://${organizationSlug}.${webHost}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).
|
|
125
|
+
* Throws an error if validation fails instead of exiting the process.
|
|
126
|
+
*
|
|
127
|
+
* @param host The hostname to validate
|
|
128
|
+
* @throws {Error} If the host contains a protocol
|
|
129
|
+
*/
|
|
130
|
+
function _validateSentryHostInternal(host) {
|
|
131
|
+
if (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.");
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
135
|
+
* Throws an error if validation fails instead of exiting the process.
|
|
136
|
+
*
|
|
137
|
+
* @param url The HTTPS URL to validate and parse
|
|
138
|
+
* @returns The extracted hostname from the URL
|
|
139
|
+
* @throws {Error} If the URL is invalid or not HTTPS
|
|
140
|
+
*/
|
|
141
|
+
function _validateAndParseSentryUrlInternal(url) {
|
|
142
|
+
if (!url.startsWith("https://")) throw new Error("SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).");
|
|
143
|
+
try {
|
|
144
|
+
const parsedUrl = new URL(url);
|
|
145
|
+
return parsedUrl.host;
|
|
146
|
+
} catch (error) {
|
|
147
|
+
throw new Error("SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
152
|
+
* Throws an error instead of exiting the process (for testing).
|
|
153
|
+
*
|
|
154
|
+
* @param host The hostname to validate
|
|
155
|
+
* @throws {Error} If the host contains a protocol
|
|
156
|
+
*/
|
|
157
|
+
function validateSentryHostThrows(host) {
|
|
158
|
+
_validateSentryHostInternal(host);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
162
|
+
* Throws an error instead of exiting the process (for testing).
|
|
163
|
+
*
|
|
164
|
+
* @param url The HTTPS URL to validate and parse
|
|
165
|
+
* @returns The extracted hostname from the URL
|
|
166
|
+
* @throws {Error} If the URL is invalid or not HTTPS
|
|
167
|
+
*/
|
|
168
|
+
function validateAndParseSentryUrlThrows(url) {
|
|
169
|
+
return _validateAndParseSentryUrlInternal(url);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.
|
|
173
|
+
*
|
|
174
|
+
* @param url The URL to validate and normalize
|
|
175
|
+
* @returns The normalized URL string
|
|
176
|
+
* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol
|
|
177
|
+
*/
|
|
178
|
+
function validateOpenAiBaseUrlThrows(url) {
|
|
179
|
+
const trimmed = url.trim();
|
|
180
|
+
if (trimmed.length === 0) throw new Error("OPENAI base URL must not be empty.");
|
|
181
|
+
let parsed;
|
|
182
|
+
try {
|
|
183
|
+
parsed = new URL(trimmed);
|
|
184
|
+
} catch (error) {
|
|
185
|
+
throw new Error("OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).", { cause: error });
|
|
186
|
+
}
|
|
187
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") throw new Error("OPENAI base URL must use http or https scheme (e.g., https://example.com/v1).");
|
|
188
|
+
return parsed.toString();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/cli/resolve.ts
|
|
193
|
+
function formatInvalidSkills(invalid, envName) {
|
|
194
|
+
const where = envName ? `${envName} provided` : "Invalid skills provided";
|
|
195
|
+
const allSkills = Object.keys(SKILLS).join(", ");
|
|
196
|
+
return `Error: ${where}: ${invalid.join(", ")}\nAvailable skills: ${allSkills}`;
|
|
197
|
+
}
|
|
198
|
+
function finalize(input) {
|
|
199
|
+
if (!input.accessToken) throw new Error("Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
|
|
200
|
+
let sentryHost = "sentry.io";
|
|
201
|
+
if (input.url) sentryHost = validateAndParseSentryUrlThrows(input.url);
|
|
202
|
+
else if (input.host) {
|
|
203
|
+
validateSentryHostThrows(input.host);
|
|
204
|
+
sentryHost = input.host;
|
|
205
|
+
}
|
|
206
|
+
let finalSkills = void 0;
|
|
207
|
+
if (input.skills) {
|
|
208
|
+
const { valid, invalid } = parseSkills(input.skills);
|
|
209
|
+
if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
|
|
210
|
+
if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
|
|
211
|
+
finalSkills = valid;
|
|
212
|
+
} else {
|
|
213
|
+
const allSkills = Object.keys(SKILLS);
|
|
214
|
+
finalSkills = new Set(allSkills);
|
|
215
|
+
}
|
|
216
|
+
const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
|
|
217
|
+
return {
|
|
218
|
+
accessToken: input.accessToken,
|
|
219
|
+
sentryHost,
|
|
220
|
+
mcpUrl: input.mcpUrl,
|
|
221
|
+
sentryDsn: input.sentryDsn,
|
|
222
|
+
openaiBaseUrl: resolvedOpenAiBaseUrl,
|
|
223
|
+
openaiModel: input.openaiModel,
|
|
224
|
+
finalSkills,
|
|
225
|
+
organizationSlug: input.organizationSlug,
|
|
226
|
+
projectSlug: input.projectSlug
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
//#endregion
|
|
231
|
+
export { ALL_SKILLS, SKILLS, finalize, formatInvalidSkills, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isEnabledBySkills, isSentryHost };
|
|
232
|
+
//# sourceMappingURL=resolve-Cg3SH2zt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-Cg3SH2zt.js","names":["invalid: string[]","envName?: string","input: MergedArgs","finalSkills: Set<Skill> | 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 { parseSkills, SKILLS, 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 envName?: string,\n): string {\n const where = envName ? `${envName} provided` : \"Invalid skills provided\";\n const allSkills = Object.keys(SKILLS).join(\", \");\n return `Error: ${where}: ${invalid.join(\", \")}\\nAvailable skills: ${allSkills}`;\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> | undefined = undefined;\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 const allSkills = Object.keys(SKILLS) as Skill[];\n finalSkills = new Set<Skill>(allSkills);\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\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 finalSkills,\n organizationSlug: input.organizationSlug,\n projectSlug: input.projectSlug,\n };\n}\n"],"mappings":"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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DoeelZqw.cjs');
|
|
2
|
-
const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
|
|
3
2
|
const __modelcontextprotocol_sdk_server_stdio_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/stdio.js"));
|
|
3
|
+
const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
|
|
4
4
|
|
|
5
|
-
//#region ../mcp-core/dist/version-
|
|
6
|
-
const LIB_VERSION = typeof process !== "undefined" && "0.
|
|
5
|
+
//#region ../mcp-core/dist/version-BEmZB6qA.js
|
|
6
|
+
const LIB_VERSION = typeof process !== "undefined" && "0.25.0" || "0.0.0";
|
|
7
7
|
const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
@@ -70,4 +70,4 @@ Object.defineProperty(exports, 'startStdio', {
|
|
|
70
70
|
return startStdio;
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
//# sourceMappingURL=stdio-
|
|
73
|
+
//# sourceMappingURL=stdio-Cl-Ib8bu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-
|
|
1
|
+
{"version":3,"file":"stdio-Cl-Ib8bu.cjs","names":["server: McpServer","context: ServerContext","StdioServerTransport"],"sources":["../../mcp-core/dist/version-BEmZB6qA.js","../src/transports/stdio.ts"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.25.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-BEmZB6qA.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,8 +1,8 @@
|
|
|
1
|
-
import * as Sentry from "@sentry/node";
|
|
2
1
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
|
+
import * as Sentry from "@sentry/node";
|
|
3
3
|
|
|
4
|
-
//#region ../mcp-core/dist/version-
|
|
5
|
-
const LIB_VERSION = typeof process !== "undefined" && "0.
|
|
4
|
+
//#region ../mcp-core/dist/version-BEmZB6qA.js
|
|
5
|
+
const LIB_VERSION = typeof process !== "undefined" && "0.25.0" || "0.0.0";
|
|
6
6
|
const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
@@ -52,4 +52,4 @@ async function startStdio(server, context) {
|
|
|
52
52
|
|
|
53
53
|
//#endregion
|
|
54
54
|
export { LIB_VERSION, USER_AGENT, startStdio };
|
|
55
|
-
//# sourceMappingURL=stdio-
|
|
55
|
+
//# sourceMappingURL=stdio-CwqdTAhY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-
|
|
1
|
+
{"version":3,"file":"stdio-CwqdTAhY.js","names":["server: McpServer","context: ServerContext"],"sources":["../../mcp-core/dist/version-BEmZB6qA.js","../src/transports/stdio.ts"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.25.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-BEmZB6qA.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"}
|
package/dist/transports/stdio.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Scope } from "@sentry/mcp-core/permissions";
|
|
2
1
|
import { Skill } from "@sentry/mcp-core/skills";
|
|
3
2
|
|
|
4
3
|
//#region src/cli/types.d.ts
|
|
@@ -10,9 +9,6 @@ type CliArgs = {
|
|
|
10
9
|
sentryDsn?: string;
|
|
11
10
|
openaiBaseUrl?: string;
|
|
12
11
|
openaiModel?: string;
|
|
13
|
-
scopes?: string;
|
|
14
|
-
addScopes?: string;
|
|
15
|
-
allScopes?: boolean;
|
|
16
12
|
skills?: string;
|
|
17
13
|
agent?: boolean;
|
|
18
14
|
organizationSlug?: string;
|
|
@@ -28,8 +24,6 @@ type EnvArgs = {
|
|
|
28
24
|
mcpUrl?: string;
|
|
29
25
|
sentryDsn?: string;
|
|
30
26
|
openaiModel?: string;
|
|
31
|
-
scopes?: string;
|
|
32
|
-
addScopes?: string;
|
|
33
27
|
skills?: string;
|
|
34
28
|
};
|
|
35
29
|
type MergedArgs = {
|
|
@@ -40,9 +34,6 @@ type MergedArgs = {
|
|
|
40
34
|
sentryDsn?: string;
|
|
41
35
|
openaiBaseUrl?: string;
|
|
42
36
|
openaiModel?: string;
|
|
43
|
-
scopes?: string;
|
|
44
|
-
addScopes?: string;
|
|
45
|
-
allScopes?: boolean;
|
|
46
37
|
skills?: string;
|
|
47
38
|
agent?: boolean;
|
|
48
39
|
organizationSlug?: string;
|
|
@@ -58,7 +49,7 @@ type ResolvedConfig = {
|
|
|
58
49
|
sentryDsn?: string;
|
|
59
50
|
openaiBaseUrl?: string;
|
|
60
51
|
openaiModel?: string;
|
|
61
|
-
|
|
52
|
+
/** Primary authorization method */
|
|
62
53
|
finalSkills?: Set<Skill>;
|
|
63
54
|
organizationSlug?: string;
|
|
64
55
|
projectSlug?: string;
|
|
@@ -66,4 +57,4 @@ type ResolvedConfig = {
|
|
|
66
57
|
//# sourceMappingURL=types.d.ts.map
|
|
67
58
|
//#endregion
|
|
68
59
|
export { CliArgs, EnvArgs, MergedArgs, ResolvedConfig };
|
|
69
|
-
//# sourceMappingURL=types-
|
|
60
|
+
//# sourceMappingURL=types-D5f00mg9.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-D5f00mg9.d.ts","names":[],"sources":["../src/cli/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,OAAA;;EAAA,IAAA,CAAA,EAAA,MAAO;EAiBP,GAAA,CAAA,EAAA,MAAO;EAUP,MAAA,CAAA,EAAA,MAAU;EAiBV,SAAA,CAAA,EAAA,MAAc;EAAA,aAAA,CAAA,EAAA,MAAA;EAAA,WAQN,CAAA,EAAA,MAAA;EAAK,MAAT,CAAA,EAAA,MAAA;EAAG,KAAA,CAAA,EAAA,OAAA;;;;;;;KAnCP,OAAA;;;;;;;;;KAUA,UAAA;;;;;;;;;;;;;;;;KAiBA,cAAA;;;;;;;;gBAQI,IAAI"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Scope } from "@sentry/mcp-core/permissions";
|
|
2
1
|
import { Skill } from "@sentry/mcp-core/skills";
|
|
3
2
|
|
|
4
3
|
//#region src/cli/types.d.ts
|
|
@@ -10,9 +9,6 @@ type CliArgs = {
|
|
|
10
9
|
sentryDsn?: string;
|
|
11
10
|
openaiBaseUrl?: string;
|
|
12
11
|
openaiModel?: string;
|
|
13
|
-
scopes?: string;
|
|
14
|
-
addScopes?: string;
|
|
15
|
-
allScopes?: boolean;
|
|
16
12
|
skills?: string;
|
|
17
13
|
agent?: boolean;
|
|
18
14
|
organizationSlug?: string;
|
|
@@ -28,8 +24,6 @@ type EnvArgs = {
|
|
|
28
24
|
mcpUrl?: string;
|
|
29
25
|
sentryDsn?: string;
|
|
30
26
|
openaiModel?: string;
|
|
31
|
-
scopes?: string;
|
|
32
|
-
addScopes?: string;
|
|
33
27
|
skills?: string;
|
|
34
28
|
};
|
|
35
29
|
type MergedArgs = {
|
|
@@ -40,9 +34,6 @@ type MergedArgs = {
|
|
|
40
34
|
sentryDsn?: string;
|
|
41
35
|
openaiBaseUrl?: string;
|
|
42
36
|
openaiModel?: string;
|
|
43
|
-
scopes?: string;
|
|
44
|
-
addScopes?: string;
|
|
45
|
-
allScopes?: boolean;
|
|
46
37
|
skills?: string;
|
|
47
38
|
agent?: boolean;
|
|
48
39
|
organizationSlug?: string;
|
|
@@ -58,7 +49,7 @@ type ResolvedConfig = {
|
|
|
58
49
|
sentryDsn?: string;
|
|
59
50
|
openaiBaseUrl?: string;
|
|
60
51
|
openaiModel?: string;
|
|
61
|
-
|
|
52
|
+
/** Primary authorization method */
|
|
62
53
|
finalSkills?: Set<Skill>;
|
|
63
54
|
organizationSlug?: string;
|
|
64
55
|
projectSlug?: string;
|
|
@@ -66,4 +57,4 @@ type ResolvedConfig = {
|
|
|
66
57
|
//# sourceMappingURL=types.d.ts.map
|
|
67
58
|
//#endregion
|
|
68
59
|
export { CliArgs, EnvArgs, MergedArgs, ResolvedConfig };
|
|
69
|
-
//# sourceMappingURL=types-
|
|
60
|
+
//# sourceMappingURL=types-DpmAC3S8.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-DpmAC3S8.d.cts","names":[],"sources":["../src/cli/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,OAAA;;EAAA,IAAA,CAAA,EAAA,MAAO;EAiBP,GAAA,CAAA,EAAA,MAAO;EAUP,MAAA,CAAA,EAAA,MAAU;EAiBV,SAAA,CAAA,EAAA,MAAc;EAAA,aAAA,CAAA,EAAA,MAAA;EAAA,WAQN,CAAA,EAAA,MAAA;EAAK,MAAT,CAAA,EAAA,MAAA;EAAG,KAAA,CAAA,EAAA,OAAA;;;;;;;KAnCP,OAAA;;;;;;;;;KAUA,UAAA;;;;;;;;;;;;;;;;KAiBA,cAAA;;;;;;;;gBAQI,IAAI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/cli/usage.ts
|
|
2
|
-
function buildUsage(packageName,
|
|
2
|
+
function buildUsage(packageName, allSkills) {
|
|
3
3
|
return `Usage: ${packageName} --access-token=<token> [--host=<host>]
|
|
4
4
|
|
|
5
5
|
Required:
|
|
@@ -16,19 +16,11 @@ Session constraints:
|
|
|
16
16
|
--organization-slug <slug> Force all calls to an organization
|
|
17
17
|
--project-slug <slug> Optional project constraint
|
|
18
18
|
|
|
19
|
-
Skill controls
|
|
19
|
+
Skill controls:
|
|
20
20
|
--skills <list> Specify which skills to grant (default: all skills)
|
|
21
21
|
|
|
22
22
|
All skills: ${allSkills.join(", ")}
|
|
23
23
|
|
|
24
|
-
Scope controls (legacy - deprecated, use skills instead):
|
|
25
|
-
--scopes <list> Override default scopes
|
|
26
|
-
--add-scopes <list> Add scopes to defaults
|
|
27
|
-
--all-scopes Grant every available scope
|
|
28
|
-
|
|
29
|
-
Default scopes: ${defaultScopes.join(", ")}
|
|
30
|
-
All scopes: ${allScopes.join(", ")}
|
|
31
|
-
|
|
32
24
|
Examples:
|
|
33
25
|
${packageName} --access-token=TOKEN
|
|
34
26
|
${packageName} --access-token=TOKEN --skills=inspect,triage
|
|
@@ -39,4 +31,4 @@ Examples:
|
|
|
39
31
|
|
|
40
32
|
//#endregion
|
|
41
33
|
export { buildUsage };
|
|
42
|
-
//# sourceMappingURL=usage-
|
|
34
|
+
//# sourceMappingURL=usage-BzYvqaru.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-BzYvqaru.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 --openai-base-url <url> Override OpenAI API base URL for embedded agents\n --openai-model <model> Override OpenAI model (default: gpt-5, reasoning effort: low)\n --agent Agent mode: only expose use_sentry tool (for AI agents)\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\nAll skills: ${allSkills.join(\", \")}\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 --openai-model=o1-mini\n ${packageName} --access-token=TOKEN --openai-base-url=https://proxy.example.com/v1`;\n}\n"],"mappings":";AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;;;;;;;;;;;;;;;;;;;cAmBjB,UAAU,KAAK,KAAK,CAAC;;;IAG/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
//#region src/cli/usage.ts
|
|
3
|
-
function buildUsage(packageName,
|
|
3
|
+
function buildUsage(packageName, allSkills) {
|
|
4
4
|
return `Usage: ${packageName} --access-token=<token> [--host=<host>]
|
|
5
5
|
|
|
6
6
|
Required:
|
|
@@ -17,19 +17,11 @@ Session constraints:
|
|
|
17
17
|
--organization-slug <slug> Force all calls to an organization
|
|
18
18
|
--project-slug <slug> Optional project constraint
|
|
19
19
|
|
|
20
|
-
Skill controls
|
|
20
|
+
Skill controls:
|
|
21
21
|
--skills <list> Specify which skills to grant (default: all skills)
|
|
22
22
|
|
|
23
23
|
All skills: ${allSkills.join(", ")}
|
|
24
24
|
|
|
25
|
-
Scope controls (legacy - deprecated, use skills instead):
|
|
26
|
-
--scopes <list> Override default scopes
|
|
27
|
-
--add-scopes <list> Add scopes to defaults
|
|
28
|
-
--all-scopes Grant every available scope
|
|
29
|
-
|
|
30
|
-
Default scopes: ${defaultScopes.join(", ")}
|
|
31
|
-
All scopes: ${allScopes.join(", ")}
|
|
32
|
-
|
|
33
25
|
Examples:
|
|
34
26
|
${packageName} --access-token=TOKEN
|
|
35
27
|
${packageName} --access-token=TOKEN --skills=inspect,triage
|
|
@@ -45,4 +37,4 @@ Object.defineProperty(exports, 'buildUsage', {
|
|
|
45
37
|
return buildUsage;
|
|
46
38
|
}
|
|
47
39
|
});
|
|
48
|
-
//# sourceMappingURL=usage-
|
|
40
|
+
//# sourceMappingURL=usage-DD58xBe3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-DD58xBe3.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 --openai-base-url <url> Override OpenAI API base URL for embedded agents\n --openai-model <model> Override OpenAI model (default: gpt-5, reasoning effort: low)\n --agent Agent mode: only expose use_sentry tool (for AI agents)\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\nAll skills: ${allSkills.join(\", \")}\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 --openai-model=o1-mini\n ${packageName} --access-token=TOKEN --openai-base-url=https://proxy.example.com/v1`;\n}\n"],"mappings":";;AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;;;;;;;;;;;;;;;;;;;cAmBjB,UAAU,KAAK,KAAK,CAAC;;;IAG/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/mcp-server",
|
|
3
|
-
"
|
|
3
|
+
"mcpName": "io.github.getsentry/sentry-mcp",
|
|
4
|
+
"version": "0.25.0",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"engines": {
|
|
6
7
|
"node": ">=20"
|
|
@@ -52,9 +53,9 @@
|
|
|
52
53
|
"tsx": "^4.20.3",
|
|
53
54
|
"typescript": "^5.8.3",
|
|
54
55
|
"vitest": "^3.2.4",
|
|
55
|
-
"@sentry/mcp-core": "0.
|
|
56
|
-
"@sentry/mcp-server-
|
|
57
|
-
"@sentry/mcp-server-
|
|
56
|
+
"@sentry/mcp-core": "0.25.0",
|
|
57
|
+
"@sentry/mcp-server-mocks": "0.25.0",
|
|
58
|
+
"@sentry/mcp-server-tsconfig": "0.25.0"
|
|
58
59
|
},
|
|
59
60
|
"scripts": {
|
|
60
61
|
"build": "tsdown",
|
package/dist/config-Bs1p6XwV.js
DELETED
package/dist/config-DFewJLVx.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const require_config_DtimzxvV = require('./config-DtimzxvV-D3ccpxhQ.cjs');
|
|
2
|
-
|
|
3
|
-
exports.BASE_COMMON_FIELDS = require_config_DtimzxvV.BASE_COMMON_FIELDS;
|
|
4
|
-
exports.DATASET_FIELDS = require_config_DtimzxvV.DATASET_FIELDS;
|
|
5
|
-
exports.NUMERIC_FIELDS = require_config_DtimzxvV.NUMERIC_FIELDS;
|
|
6
|
-
exports.RECOMMENDED_FIELDS = require_config_DtimzxvV.RECOMMENDED_FIELDS;
|