@sentry/mcp-server 0.25.0 → 0.27.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 -1
- package/dist/cli/resolve.d.cts +1 -1
- package/dist/cli/resolve.d.ts +1 -1
- package/dist/cli/resolve.js +1 -1
- 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.js +1 -1
- package/dist/{config-BoFBjXRq-CGHqlnJ9.cjs → config-CEjP2CYO-CZKUamRu.cjs} +2 -2
- package/dist/{config-BoFBjXRq-CGHqlnJ9.cjs.map → config-CEjP2CYO-CZKUamRu.cjs.map} +1 -1
- package/dist/{config-BoFBjXRq-CMdBQOkQ.js → config-CEjP2CYO-DNCUeo0R.js} +2 -2
- package/dist/{config-BoFBjXRq-CMdBQOkQ.js.map → config-CEjP2CYO-DNCUeo0R.js.map} +1 -1
- package/dist/config-CwE3_vz4.cjs +7 -0
- package/dist/{config-BEgU9ylR.js → config-HqPAzoGg.js} +1 -1
- package/dist/index.cjs +2573 -243
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2571 -241
- package/dist/index.js.map +1 -1
- package/dist/{parse-46t_fITC.js → parse-B9o4fVyT.js} +12 -1
- package/dist/parse-B9o4fVyT.js.map +1 -0
- package/dist/{parse-BjIH83SX.cjs → parse-c_3eNB2Z.cjs} +12 -1
- package/dist/parse-c_3eNB2Z.cjs.map +1 -0
- package/dist/{resolve-CdTP9riu.cjs → resolve-DFUPLqHE.cjs} +11 -1
- package/dist/resolve-DFUPLqHE.cjs.map +1 -0
- package/dist/{resolve-Cg3SH2zt.js → resolve-DpUhCbfh.js} +11 -1
- package/dist/resolve-DpUhCbfh.js.map +1 -0
- package/dist/{stdio-CwqdTAhY.js → stdio-D7VKnapT.js} +3 -3
- package/dist/{stdio-CwqdTAhY.js.map → stdio-D7VKnapT.js.map} +1 -1
- package/dist/{stdio-Cl-Ib8bu.cjs → stdio-Dv01oTty.cjs} +3 -3
- package/dist/{stdio-Cl-Ib8bu.cjs.map → stdio-Dv01oTty.cjs.map} +1 -1
- package/dist/transports/stdio.cjs +1 -1
- package/dist/transports/stdio.js +1 -1
- package/dist/{types-D5f00mg9.d.ts → types--Ysz5ZMd.d.cts} +12 -1
- package/dist/types--Ysz5ZMd.d.cts.map +1 -0
- package/dist/{types-DpmAC3S8.d.cts → types-BlGRNCea.d.ts} +12 -1
- package/dist/types-BlGRNCea.d.ts.map +1 -0
- package/dist/{usage-DD58xBe3.cjs → usage-D9Tpyb5N.cjs} +15 -5
- package/dist/usage-D9Tpyb5N.cjs.map +1 -0
- package/dist/{usage-BzYvqaru.js → usage-DR57Krum.js} +15 -5
- package/dist/usage-DR57Krum.js.map +1 -0
- package/package.json +6 -6
- package/dist/config-rZ982IEm.cjs +0 -7
- package/dist/parse-46t_fITC.js.map +0 -1
- package/dist/parse-BjIH83SX.cjs.map +0 -1
- package/dist/resolve-CdTP9riu.cjs.map +0 -1
- package/dist/resolve-Cg3SH2zt.js.map +0 -1
- package/dist/types-D5f00mg9.d.ts.map +0 -1
- package/dist/types-DpmAC3S8.d.cts.map +0 -1
- package/dist/usage-BzYvqaru.js.map +0 -1
- package/dist/usage-DD58xBe3.cjs.map +0 -1
|
@@ -10,6 +10,9 @@ function parseArgv(argv) {
|
|
|
10
10
|
"sentry-dsn": { type: "string" },
|
|
11
11
|
"openai-base-url": { type: "string" },
|
|
12
12
|
"openai-model": { type: "string" },
|
|
13
|
+
"anthropic-base-url": { type: "string" },
|
|
14
|
+
"anthropic-model": { type: "string" },
|
|
15
|
+
"agent-provider": { type: "string" },
|
|
13
16
|
"organization-slug": { type: "string" },
|
|
14
17
|
"project-slug": { type: "string" },
|
|
15
18
|
skills: { type: "string" },
|
|
@@ -45,6 +48,9 @@ function parseArgv(argv) {
|
|
|
45
48
|
sentryDsn: values["sentry-dsn"],
|
|
46
49
|
openaiBaseUrl: values["openai-base-url"],
|
|
47
50
|
openaiModel: values["openai-model"],
|
|
51
|
+
anthropicBaseUrl: values["anthropic-base-url"],
|
|
52
|
+
anthropicModel: values["anthropic-model"],
|
|
53
|
+
agentProvider: values["agent-provider"],
|
|
48
54
|
organizationSlug: values["organization-slug"],
|
|
49
55
|
projectSlug: values["project-slug"],
|
|
50
56
|
skills: values.skills,
|
|
@@ -62,6 +68,8 @@ function parseEnv(env) {
|
|
|
62
68
|
if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;
|
|
63
69
|
if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN) fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;
|
|
64
70
|
if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;
|
|
71
|
+
if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;
|
|
72
|
+
if (env.EMBEDDED_AGENT_PROVIDER) fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;
|
|
65
73
|
if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;
|
|
66
74
|
return fromEnv;
|
|
67
75
|
}
|
|
@@ -74,6 +82,9 @@ function merge(cli, env) {
|
|
|
74
82
|
sentryDsn: cli.sentryDsn ?? env.sentryDsn,
|
|
75
83
|
openaiBaseUrl: cli.openaiBaseUrl,
|
|
76
84
|
openaiModel: cli.openaiModel ?? env.openaiModel,
|
|
85
|
+
anthropicBaseUrl: cli.anthropicBaseUrl,
|
|
86
|
+
anthropicModel: cli.anthropicModel ?? env.anthropicModel,
|
|
87
|
+
agentProvider: cli.agentProvider ?? env.agentProvider,
|
|
77
88
|
skills: cli.skills ?? env.skills,
|
|
78
89
|
agent: cli.agent === true,
|
|
79
90
|
organizationSlug: cli.organizationSlug,
|
|
@@ -86,4 +97,4 @@ function merge(cli, env) {
|
|
|
86
97
|
|
|
87
98
|
//#endregion
|
|
88
99
|
export { merge, parseArgv, parseEnv };
|
|
89
|
-
//# sourceMappingURL=parse-
|
|
100
|
+
//# sourceMappingURL=parse-B9o4fVyT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-B9o4fVyT.js","names":["argv: string[]","unknownArgs: string[]","env: NodeJS.ProcessEnv","fromEnv: EnvArgs","cli: CliArgs","env: EnvArgs"],"sources":["../src/cli/parse.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport type { CliArgs, EnvArgs, MergedArgs } from \"./types\";\n\nexport function parseArgv(argv: string[]): CliArgs {\n const options = {\n \"access-token\": { type: \"string\" as const },\n host: { type: \"string\" as const },\n url: { type: \"string\" as const },\n \"mcp-url\": { type: \"string\" as const },\n \"sentry-dsn\": { type: \"string\" as const },\n \"openai-base-url\": { type: \"string\" as const },\n \"openai-model\": { type: \"string\" as const },\n \"anthropic-base-url\": { type: \"string\" as const },\n \"anthropic-model\": { type: \"string\" as const },\n \"agent-provider\": { type: \"string\" as const },\n \"organization-slug\": { type: \"string\" as const },\n \"project-slug\": { type: \"string\" as const },\n skills: { type: \"string\" as const },\n agent: { type: \"boolean\" as const },\n help: { type: \"boolean\" as const, short: \"h\" as const },\n version: { type: \"boolean\" as const, short: \"v\" as const },\n };\n\n const { values, positionals, tokens } = parseArgs({\n args: argv,\n options,\n allowPositionals: false,\n strict: false,\n tokens: true,\n });\n\n const knownLong = new Set(Object.keys(options));\n const knownShort = new Set([\n ...(Object.values(options)\n .map((o) => (\"short\" in o ? (o.short as string | undefined) : undefined))\n .filter(Boolean) as string[]),\n ]);\n\n const unknownArgs: string[] = [];\n for (const t of (tokens as any[]) || []) {\n if (t.kind === \"option\") {\n const name = t.name as string | undefined;\n if (name && !(knownLong.has(name) || knownShort.has(name))) {\n unknownArgs.push((t.raw as string) ?? `--${name}`);\n }\n } else if (t.kind === \"positional\") {\n unknownArgs.push((t.raw as string) ?? String(t.value ?? \"\"));\n }\n }\n\n return {\n accessToken: values[\"access-token\"] as string | undefined,\n host: values.host as string | undefined,\n url: values.url as string | undefined,\n mcpUrl: values[\"mcp-url\"] as string | undefined,\n sentryDsn: values[\"sentry-dsn\"] as string | undefined,\n openaiBaseUrl: values[\"openai-base-url\"] as string | undefined,\n openaiModel: values[\"openai-model\"] as string | undefined,\n anthropicBaseUrl: values[\"anthropic-base-url\"] as string | undefined,\n anthropicModel: values[\"anthropic-model\"] as string | undefined,\n agentProvider: values[\"agent-provider\"] as string | undefined,\n organizationSlug: values[\"organization-slug\"] as string | undefined,\n projectSlug: values[\"project-slug\"] as string | undefined,\n skills: values.skills as string | undefined,\n agent: (values.agent as boolean | undefined) === true,\n help: (values.help as boolean | undefined) === true,\n version: (values.version as boolean | undefined) === true,\n unknownArgs:\n unknownArgs.length > 0 ? unknownArgs : (positionals as string[]) || [],\n };\n}\n\nexport function parseEnv(env: NodeJS.ProcessEnv): EnvArgs {\n const fromEnv: EnvArgs = {};\n if (env.SENTRY_ACCESS_TOKEN) fromEnv.accessToken = env.SENTRY_ACCESS_TOKEN;\n if (env.SENTRY_URL) fromEnv.url = env.SENTRY_URL;\n if (env.SENTRY_HOST) fromEnv.host = env.SENTRY_HOST;\n if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;\n if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN)\n fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;\n\n if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;\n if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;\n if (env.EMBEDDED_AGENT_PROVIDER)\n fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;\n if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;\n return fromEnv;\n}\n\nexport function merge(cli: CliArgs, env: EnvArgs): MergedArgs {\n // CLI wins over env\n return {\n accessToken: cli.accessToken ?? env.accessToken,\n // If CLI provided url/host, prefer those; else fall back to env\n url: cli.url ?? env.url,\n host: cli.host ?? env.host,\n mcpUrl: cli.mcpUrl ?? env.mcpUrl,\n sentryDsn: cli.sentryDsn ?? env.sentryDsn,\n openaiBaseUrl: cli.openaiBaseUrl,\n openaiModel: cli.openaiModel ?? env.openaiModel,\n anthropicBaseUrl: cli.anthropicBaseUrl,\n anthropicModel: cli.anthropicModel ?? env.anthropicModel,\n agentProvider: cli.agentProvider ?? env.agentProvider,\n // Skills precedence: CLI skills override env\n skills: cli.skills ?? env.skills,\n agent: cli.agent === true,\n organizationSlug: cli.organizationSlug,\n projectSlug: cli.projectSlug,\n help: cli.help === true,\n version: cli.version === true,\n unknownArgs: cli.unknownArgs,\n };\n}\n"],"mappings":";;;AAGA,SAAgB,UAAUA,MAAyB;CACjD,MAAM,UAAU;EACd,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,MAAM,EAAE,MAAM,SAAmB;EACjC,KAAK,EAAE,MAAM,SAAmB;EAChC,WAAW,EAAE,MAAM,SAAmB;EACtC,cAAc,EAAE,MAAM,SAAmB;EACzC,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,sBAAsB,EAAE,MAAM,SAAmB;EACjD,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,qBAAqB,EAAE,MAAM,SAAmB;EAChD,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,QAAQ,EAAE,MAAM,SAAmB;EACnC,OAAO,EAAE,MAAM,UAAoB;EACnC,MAAM;GAAE,MAAM;GAAoB,OAAO;EAAc;EACvD,SAAS;GAAE,MAAM;GAAoB,OAAO;EAAc;CAC3D;CAED,MAAM,EAAE,QAAQ,aAAa,QAAQ,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YAAY,IAAI,cAAc,IAAI;AAE5C,KAAI,IAAI,aAAc,SAAQ,cAAc,IAAI;AAChD,KAAI,IAAI,gBAAiB,SAAQ,iBAAiB,IAAI;AACtD,KAAI,IAAI,wBACN,SAAQ,gBAAgB,IAAI;AAC9B,KAAI,IAAI,WAAY,SAAQ,SAAS,IAAI;AACzC,QAAO;AACR;AAED,SAAgB,MAAMC,KAAcC,KAA0B;AAE5D,QAAO;EACL,aAAa,IAAI,eAAe,IAAI;EAEpC,KAAK,IAAI,OAAO,IAAI;EACpB,MAAM,IAAI,QAAQ,IAAI;EACtB,QAAQ,IAAI,UAAU,IAAI;EAC1B,WAAW,IAAI,aAAa,IAAI;EAChC,eAAe,IAAI;EACnB,aAAa,IAAI,eAAe,IAAI;EACpC,kBAAkB,IAAI;EACtB,gBAAgB,IAAI,kBAAkB,IAAI;EAC1C,eAAe,IAAI,iBAAiB,IAAI;EAExC,QAAQ,IAAI,UAAU,IAAI;EAC1B,OAAO,IAAI,UAAU;EACrB,kBAAkB,IAAI;EACtB,aAAa,IAAI;EACjB,MAAM,IAAI,SAAS;EACnB,SAAS,IAAI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
|
|
@@ -11,6 +11,9 @@ function parseArgv(argv) {
|
|
|
11
11
|
"sentry-dsn": { type: "string" },
|
|
12
12
|
"openai-base-url": { type: "string" },
|
|
13
13
|
"openai-model": { type: "string" },
|
|
14
|
+
"anthropic-base-url": { type: "string" },
|
|
15
|
+
"anthropic-model": { type: "string" },
|
|
16
|
+
"agent-provider": { type: "string" },
|
|
14
17
|
"organization-slug": { type: "string" },
|
|
15
18
|
"project-slug": { type: "string" },
|
|
16
19
|
skills: { type: "string" },
|
|
@@ -46,6 +49,9 @@ function parseArgv(argv) {
|
|
|
46
49
|
sentryDsn: values["sentry-dsn"],
|
|
47
50
|
openaiBaseUrl: values["openai-base-url"],
|
|
48
51
|
openaiModel: values["openai-model"],
|
|
52
|
+
anthropicBaseUrl: values["anthropic-base-url"],
|
|
53
|
+
anthropicModel: values["anthropic-model"],
|
|
54
|
+
agentProvider: values["agent-provider"],
|
|
49
55
|
organizationSlug: values["organization-slug"],
|
|
50
56
|
projectSlug: values["project-slug"],
|
|
51
57
|
skills: values.skills,
|
|
@@ -63,6 +69,8 @@ function parseEnv(env) {
|
|
|
63
69
|
if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;
|
|
64
70
|
if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN) fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;
|
|
65
71
|
if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;
|
|
72
|
+
if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;
|
|
73
|
+
if (env.EMBEDDED_AGENT_PROVIDER) fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;
|
|
66
74
|
if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;
|
|
67
75
|
return fromEnv;
|
|
68
76
|
}
|
|
@@ -75,6 +83,9 @@ function merge(cli, env) {
|
|
|
75
83
|
sentryDsn: cli.sentryDsn ?? env.sentryDsn,
|
|
76
84
|
openaiBaseUrl: cli.openaiBaseUrl,
|
|
77
85
|
openaiModel: cli.openaiModel ?? env.openaiModel,
|
|
86
|
+
anthropicBaseUrl: cli.anthropicBaseUrl,
|
|
87
|
+
anthropicModel: cli.anthropicModel ?? env.anthropicModel,
|
|
88
|
+
agentProvider: cli.agentProvider ?? env.agentProvider,
|
|
78
89
|
skills: cli.skills ?? env.skills,
|
|
79
90
|
agent: cli.agent === true,
|
|
80
91
|
organizationSlug: cli.organizationSlug,
|
|
@@ -104,4 +115,4 @@ Object.defineProperty(exports, 'parseEnv', {
|
|
|
104
115
|
return parseEnv;
|
|
105
116
|
}
|
|
106
117
|
});
|
|
107
|
-
//# sourceMappingURL=parse-
|
|
118
|
+
//# sourceMappingURL=parse-c_3eNB2Z.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-c_3eNB2Z.cjs","names":["argv: string[]","unknownArgs: string[]","env: NodeJS.ProcessEnv","fromEnv: EnvArgs","cli: CliArgs","env: EnvArgs"],"sources":["../src/cli/parse.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport type { CliArgs, EnvArgs, MergedArgs } from \"./types\";\n\nexport function parseArgv(argv: string[]): CliArgs {\n const options = {\n \"access-token\": { type: \"string\" as const },\n host: { type: \"string\" as const },\n url: { type: \"string\" as const },\n \"mcp-url\": { type: \"string\" as const },\n \"sentry-dsn\": { type: \"string\" as const },\n \"openai-base-url\": { type: \"string\" as const },\n \"openai-model\": { type: \"string\" as const },\n \"anthropic-base-url\": { type: \"string\" as const },\n \"anthropic-model\": { type: \"string\" as const },\n \"agent-provider\": { type: \"string\" as const },\n \"organization-slug\": { type: \"string\" as const },\n \"project-slug\": { type: \"string\" as const },\n skills: { type: \"string\" as const },\n agent: { type: \"boolean\" as const },\n help: { type: \"boolean\" as const, short: \"h\" as const },\n version: { type: \"boolean\" as const, short: \"v\" as const },\n };\n\n const { values, positionals, tokens } = parseArgs({\n args: argv,\n options,\n allowPositionals: false,\n strict: false,\n tokens: true,\n });\n\n const knownLong = new Set(Object.keys(options));\n const knownShort = new Set([\n ...(Object.values(options)\n .map((o) => (\"short\" in o ? (o.short as string | undefined) : undefined))\n .filter(Boolean) as string[]),\n ]);\n\n const unknownArgs: string[] = [];\n for (const t of (tokens as any[]) || []) {\n if (t.kind === \"option\") {\n const name = t.name as string | undefined;\n if (name && !(knownLong.has(name) || knownShort.has(name))) {\n unknownArgs.push((t.raw as string) ?? `--${name}`);\n }\n } else if (t.kind === \"positional\") {\n unknownArgs.push((t.raw as string) ?? String(t.value ?? \"\"));\n }\n }\n\n return {\n accessToken: values[\"access-token\"] as string | undefined,\n host: values.host as string | undefined,\n url: values.url as string | undefined,\n mcpUrl: values[\"mcp-url\"] as string | undefined,\n sentryDsn: values[\"sentry-dsn\"] as string | undefined,\n openaiBaseUrl: values[\"openai-base-url\"] as string | undefined,\n openaiModel: values[\"openai-model\"] as string | undefined,\n anthropicBaseUrl: values[\"anthropic-base-url\"] as string | undefined,\n anthropicModel: values[\"anthropic-model\"] as string | undefined,\n agentProvider: values[\"agent-provider\"] as string | undefined,\n organizationSlug: values[\"organization-slug\"] as string | undefined,\n projectSlug: values[\"project-slug\"] as string | undefined,\n skills: values.skills as string | undefined,\n agent: (values.agent as boolean | undefined) === true,\n help: (values.help as boolean | undefined) === true,\n version: (values.version as boolean | undefined) === true,\n unknownArgs:\n unknownArgs.length > 0 ? unknownArgs : (positionals as string[]) || [],\n };\n}\n\nexport function parseEnv(env: NodeJS.ProcessEnv): EnvArgs {\n const fromEnv: EnvArgs = {};\n if (env.SENTRY_ACCESS_TOKEN) fromEnv.accessToken = env.SENTRY_ACCESS_TOKEN;\n if (env.SENTRY_URL) fromEnv.url = env.SENTRY_URL;\n if (env.SENTRY_HOST) fromEnv.host = env.SENTRY_HOST;\n if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;\n if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN)\n fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;\n\n if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;\n if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;\n if (env.EMBEDDED_AGENT_PROVIDER)\n fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;\n if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;\n return fromEnv;\n}\n\nexport function merge(cli: CliArgs, env: EnvArgs): MergedArgs {\n // CLI wins over env\n return {\n accessToken: cli.accessToken ?? env.accessToken,\n // If CLI provided url/host, prefer those; else fall back to env\n url: cli.url ?? env.url,\n host: cli.host ?? env.host,\n mcpUrl: cli.mcpUrl ?? env.mcpUrl,\n sentryDsn: cli.sentryDsn ?? env.sentryDsn,\n openaiBaseUrl: cli.openaiBaseUrl,\n openaiModel: cli.openaiModel ?? env.openaiModel,\n anthropicBaseUrl: cli.anthropicBaseUrl,\n anthropicModel: cli.anthropicModel ?? env.anthropicModel,\n agentProvider: cli.agentProvider ?? env.agentProvider,\n // Skills precedence: CLI skills override env\n skills: cli.skills ?? env.skills,\n agent: cli.agent === true,\n organizationSlug: cli.organizationSlug,\n projectSlug: cli.projectSlug,\n help: cli.help === true,\n version: cli.version === true,\n unknownArgs: cli.unknownArgs,\n };\n}\n"],"mappings":";;;;AAGA,SAAgB,UAAUA,MAAyB;CACjD,MAAM,UAAU;EACd,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,MAAM,EAAE,MAAM,SAAmB;EACjC,KAAK,EAAE,MAAM,SAAmB;EAChC,WAAW,EAAE,MAAM,SAAmB;EACtC,cAAc,EAAE,MAAM,SAAmB;EACzC,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,sBAAsB,EAAE,MAAM,SAAmB;EACjD,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,qBAAqB,EAAE,MAAM,SAAmB;EAChD,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,QAAQ,EAAE,MAAM,SAAmB;EACnC,OAAO,EAAE,MAAM,UAAoB;EACnC,MAAM;GAAE,MAAM;GAAoB,OAAO;EAAc;EACvD,SAAS;GAAE,MAAM;GAAoB,OAAO;EAAc;CAC3D;CAED,MAAM,EAAE,QAAQ,aAAa,QAAQ,GAAG,yBAAU;EAChD,MAAM;EACN;EACA,kBAAkB;EAClB,QAAQ;EACR,QAAQ;CACT,EAAC;CAEF,MAAM,YAAY,IAAI,IAAI,OAAO,KAAK,QAAQ;CAC9C,MAAM,aAAa,IAAI,IAAI,CACzB,GAAI,OAAO,OAAO,QAAQ,CACvB,IAAI,CAAC,MAAO,WAAW,IAAK,EAAE,eA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,MAAMC,KAAcC,KAA0B;AAE5D,QAAO;EACL,aAAa,IAAI,eAAe,IAAI;EAEpC,KAAK,IAAI,OAAO,IAAI;EACpB,MAAM,IAAI,QAAQ,IAAI;EACtB,QAAQ,IAAI,UAAU,IAAI;EAC1B,WAAW,IAAI,aAAa,IAAI;EAChC,eAAe,IAAI;EACnB,aAAa,IAAI,eAAe,IAAI;EACpC,kBAAkB,IAAI;EACtB,gBAAgB,IAAI,kBAAkB,IAAI;EAC1C,eAAe,IAAI,iBAAiB,IAAI;EAExC,QAAQ,IAAI,UAAU,IAAI;EAC1B,OAAO,IAAI,UAAU;EACrB,kBAAkB,IAAI;EACtB,aAAa,IAAI;EACjB,MAAM,IAAI,SAAS;EACnB,SAAS,IAAI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
|
|
@@ -215,6 +215,13 @@ function finalize(input) {
|
|
|
215
215
|
finalSkills = new Set(allSkills);
|
|
216
216
|
}
|
|
217
217
|
const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
|
|
218
|
+
const resolvedAnthropicBaseUrl = input.anthropicBaseUrl ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl) : void 0;
|
|
219
|
+
let agentProvider = void 0;
|
|
220
|
+
if (input.agentProvider) {
|
|
221
|
+
const provider = input.agentProvider.toLowerCase();
|
|
222
|
+
if (provider !== "openai" && provider !== "anthropic") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai" or "anthropic".`);
|
|
223
|
+
agentProvider = provider;
|
|
224
|
+
}
|
|
218
225
|
return {
|
|
219
226
|
accessToken: input.accessToken,
|
|
220
227
|
sentryHost,
|
|
@@ -222,6 +229,9 @@ function finalize(input) {
|
|
|
222
229
|
sentryDsn: input.sentryDsn,
|
|
223
230
|
openaiBaseUrl: resolvedOpenAiBaseUrl,
|
|
224
231
|
openaiModel: input.openaiModel,
|
|
232
|
+
anthropicBaseUrl: resolvedAnthropicBaseUrl,
|
|
233
|
+
anthropicModel: input.anthropicModel,
|
|
234
|
+
agentProvider,
|
|
225
235
|
finalSkills,
|
|
226
236
|
organizationSlug: input.organizationSlug,
|
|
227
237
|
projectSlug: input.projectSlug
|
|
@@ -283,4 +293,4 @@ Object.defineProperty(exports, 'isSentryHost', {
|
|
|
283
293
|
return isSentryHost;
|
|
284
294
|
}
|
|
285
295
|
});
|
|
286
|
-
//# sourceMappingURL=resolve-
|
|
296
|
+
//# sourceMappingURL=resolve-DFUPLqHE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-DFUPLqHE.cjs","names":["invalid: string[]","envName?: string","input: MergedArgs","finalSkills: Set<Skill> | undefined","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 { 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 // 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,MAA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ACjB,OAAM,IAAI,MAAM;AAElB,gBAAc;CACf,OAAM;EAEL,MAAM,YAAY,OAAO,KAAK,OAAO;AACrC,gBAAc,IAAI,IAAW;CAC9B;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"}
|
|
@@ -214,6 +214,13 @@ function finalize(input) {
|
|
|
214
214
|
finalSkills = new Set(allSkills);
|
|
215
215
|
}
|
|
216
216
|
const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
|
|
217
|
+
const resolvedAnthropicBaseUrl = input.anthropicBaseUrl ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl) : void 0;
|
|
218
|
+
let agentProvider = void 0;
|
|
219
|
+
if (input.agentProvider) {
|
|
220
|
+
const provider = input.agentProvider.toLowerCase();
|
|
221
|
+
if (provider !== "openai" && provider !== "anthropic") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai" or "anthropic".`);
|
|
222
|
+
agentProvider = provider;
|
|
223
|
+
}
|
|
217
224
|
return {
|
|
218
225
|
accessToken: input.accessToken,
|
|
219
226
|
sentryHost,
|
|
@@ -221,6 +228,9 @@ function finalize(input) {
|
|
|
221
228
|
sentryDsn: input.sentryDsn,
|
|
222
229
|
openaiBaseUrl: resolvedOpenAiBaseUrl,
|
|
223
230
|
openaiModel: input.openaiModel,
|
|
231
|
+
anthropicBaseUrl: resolvedAnthropicBaseUrl,
|
|
232
|
+
anthropicModel: input.anthropicModel,
|
|
233
|
+
agentProvider,
|
|
224
234
|
finalSkills,
|
|
225
235
|
organizationSlug: input.organizationSlug,
|
|
226
236
|
projectSlug: input.projectSlug
|
|
@@ -229,4 +239,4 @@ function finalize(input) {
|
|
|
229
239
|
|
|
230
240
|
//#endregion
|
|
231
241
|
export { ALL_SKILLS, SKILLS, finalize, formatInvalidSkills, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isEnabledBySkills, isSentryHost };
|
|
232
|
-
//# sourceMappingURL=resolve-
|
|
242
|
+
//# sourceMappingURL=resolve-DpUhCbfh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-DpUhCbfh.js","names":["invalid: string[]","envName?: string","input: MergedArgs","finalSkills: Set<Skill> | undefined","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 { 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 // 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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Q;EAEhB,MAAM,EAAE,OAAO,SAAS,GAAG,YAAY,MAAM,OAAO;AACpD,MAAI,QAAQ,SAAS,EACnB,OAAM,IAAI,MAAM,oBAAoB,QAAQ;AAE9C,MAAI,MAAM,SAAS,EACjB,OAAM,IAAI,MAAM;AAElB,gBAAc;CACf,OAAM;EAEL,MAAM,YAAY,OAAO,KAAK,OAAO;AACrC,gBAAc,IAAI,IAAW;CAC9B;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,8 +1,8 @@
|
|
|
1
1
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
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-B1-t8k8M.js
|
|
5
|
+
const LIB_VERSION = typeof process !== "undefined" && "0.27.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-D7VKnapT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-
|
|
1
|
+
{"version":3,"file":"stdio-D7VKnapT.js","names":["server: McpServer","context: ServerContext"],"sources":["../../mcp-core/dist/version-B1-t8k8M.js","../src/transports/stdio.ts"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.27.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-B1-t8k8M.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"}
|
|
@@ -2,8 +2,8 @@ const require_chunk = require('./chunk-DoeelZqw.cjs');
|
|
|
2
2
|
const __modelcontextprotocol_sdk_server_stdio_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/stdio.js"));
|
|
3
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-B1-t8k8M.js
|
|
6
|
+
const LIB_VERSION = typeof process !== "undefined" && "0.27.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-Dv01oTty.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-
|
|
1
|
+
{"version":3,"file":"stdio-Dv01oTty.cjs","names":["server: McpServer","context: ServerContext","StdioServerTransport"],"sources":["../../mcp-core/dist/version-B1-t8k8M.js","../src/transports/stdio.ts"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.27.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-B1-t8k8M.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"}
|
package/dist/transports/stdio.js
CHANGED
|
@@ -9,6 +9,9 @@ type CliArgs = {
|
|
|
9
9
|
sentryDsn?: string;
|
|
10
10
|
openaiBaseUrl?: string;
|
|
11
11
|
openaiModel?: string;
|
|
12
|
+
anthropicBaseUrl?: string;
|
|
13
|
+
anthropicModel?: string;
|
|
14
|
+
agentProvider?: string;
|
|
12
15
|
skills?: string;
|
|
13
16
|
agent?: boolean;
|
|
14
17
|
organizationSlug?: string;
|
|
@@ -24,6 +27,8 @@ type EnvArgs = {
|
|
|
24
27
|
mcpUrl?: string;
|
|
25
28
|
sentryDsn?: string;
|
|
26
29
|
openaiModel?: string;
|
|
30
|
+
anthropicModel?: string;
|
|
31
|
+
agentProvider?: string;
|
|
27
32
|
skills?: string;
|
|
28
33
|
};
|
|
29
34
|
type MergedArgs = {
|
|
@@ -34,6 +39,9 @@ type MergedArgs = {
|
|
|
34
39
|
sentryDsn?: string;
|
|
35
40
|
openaiBaseUrl?: string;
|
|
36
41
|
openaiModel?: string;
|
|
42
|
+
anthropicBaseUrl?: string;
|
|
43
|
+
anthropicModel?: string;
|
|
44
|
+
agentProvider?: string;
|
|
37
45
|
skills?: string;
|
|
38
46
|
agent?: boolean;
|
|
39
47
|
organizationSlug?: string;
|
|
@@ -49,6 +57,9 @@ type ResolvedConfig = {
|
|
|
49
57
|
sentryDsn?: string;
|
|
50
58
|
openaiBaseUrl?: string;
|
|
51
59
|
openaiModel?: string;
|
|
60
|
+
anthropicBaseUrl?: string;
|
|
61
|
+
anthropicModel?: string;
|
|
62
|
+
agentProvider?: "openai" | "anthropic";
|
|
52
63
|
/** Primary authorization method */
|
|
53
64
|
finalSkills?: Set<Skill>;
|
|
54
65
|
organizationSlug?: string;
|
|
@@ -57,4 +68,4 @@ type ResolvedConfig = {
|
|
|
57
68
|
//# sourceMappingURL=types.d.ts.map
|
|
58
69
|
//#endregion
|
|
59
70
|
export { CliArgs, EnvArgs, MergedArgs, ResolvedConfig };
|
|
60
|
-
//# sourceMappingURL=types
|
|
71
|
+
//# sourceMappingURL=types--Ysz5ZMd.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types--Ysz5ZMd.d.cts","names":[],"sources":["../src/cli/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,OAAA;;EAAA,IAAA,CAAA,EAAA,MAAO;EAoBP,GAAA,CAAA,EAAA,MAAO;EAYP,MAAA,CAAA,EAAA,MAAU;EAoBV,SAAA,CAAA,EAAA,MAAc;EAAA,aAAA,CAAA,EAAA,MAAA;EAAA,WAWN,CAAA,EAAA,MAAA;EAAK,gBAAT,CAAA,EAAA,MAAA;EAAG,cAAA,CAAA,EAAA,MAAA;;;;;;;;;;KA3CP,OAAA;;;;;;;;;;;KAYA,UAAA;;;;;;;;;;;;;;;;;;;KAoBA,cAAA;;;;;;;;;;;gBAWI,IAAI"}
|
|
@@ -9,6 +9,9 @@ type CliArgs = {
|
|
|
9
9
|
sentryDsn?: string;
|
|
10
10
|
openaiBaseUrl?: string;
|
|
11
11
|
openaiModel?: string;
|
|
12
|
+
anthropicBaseUrl?: string;
|
|
13
|
+
anthropicModel?: string;
|
|
14
|
+
agentProvider?: string;
|
|
12
15
|
skills?: string;
|
|
13
16
|
agent?: boolean;
|
|
14
17
|
organizationSlug?: string;
|
|
@@ -24,6 +27,8 @@ type EnvArgs = {
|
|
|
24
27
|
mcpUrl?: string;
|
|
25
28
|
sentryDsn?: string;
|
|
26
29
|
openaiModel?: string;
|
|
30
|
+
anthropicModel?: string;
|
|
31
|
+
agentProvider?: string;
|
|
27
32
|
skills?: string;
|
|
28
33
|
};
|
|
29
34
|
type MergedArgs = {
|
|
@@ -34,6 +39,9 @@ type MergedArgs = {
|
|
|
34
39
|
sentryDsn?: string;
|
|
35
40
|
openaiBaseUrl?: string;
|
|
36
41
|
openaiModel?: string;
|
|
42
|
+
anthropicBaseUrl?: string;
|
|
43
|
+
anthropicModel?: string;
|
|
44
|
+
agentProvider?: string;
|
|
37
45
|
skills?: string;
|
|
38
46
|
agent?: boolean;
|
|
39
47
|
organizationSlug?: string;
|
|
@@ -49,6 +57,9 @@ type ResolvedConfig = {
|
|
|
49
57
|
sentryDsn?: string;
|
|
50
58
|
openaiBaseUrl?: string;
|
|
51
59
|
openaiModel?: string;
|
|
60
|
+
anthropicBaseUrl?: string;
|
|
61
|
+
anthropicModel?: string;
|
|
62
|
+
agentProvider?: "openai" | "anthropic";
|
|
52
63
|
/** Primary authorization method */
|
|
53
64
|
finalSkills?: Set<Skill>;
|
|
54
65
|
organizationSlug?: string;
|
|
@@ -57,4 +68,4 @@ type ResolvedConfig = {
|
|
|
57
68
|
//# sourceMappingURL=types.d.ts.map
|
|
58
69
|
//#endregion
|
|
59
70
|
export { CliArgs, EnvArgs, MergedArgs, ResolvedConfig };
|
|
60
|
-
//# sourceMappingURL=types-
|
|
71
|
+
//# sourceMappingURL=types-BlGRNCea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BlGRNCea.d.ts","names":[],"sources":["../src/cli/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,OAAA;;EAAA,IAAA,CAAA,EAAA,MAAO;EAoBP,GAAA,CAAA,EAAA,MAAO;EAYP,MAAA,CAAA,EAAA,MAAU;EAoBV,SAAA,CAAA,EAAA,MAAc;EAAA,aAAA,CAAA,EAAA,MAAA;EAAA,WAWN,CAAA,EAAA,MAAA;EAAK,gBAAT,CAAA,EAAA,MAAA;EAAG,cAAA,CAAA,EAAA,MAAA;;;;;;;;;;KA3CP,OAAA;;;;;;;;;;;KAYA,UAAA;;;;;;;;;;;;;;;;;;;KAoBA,cAAA;;;;;;;;;;;gBAWI,IAAI"}
|
|
@@ -9,10 +9,15 @@ Required:
|
|
|
9
9
|
Common optional flags:
|
|
10
10
|
--host <host> Change Sentry host (self-hosted)
|
|
11
11
|
--sentry-dsn <dsn> Override DSN used for telemetry reporting
|
|
12
|
-
--openai-base-url <url> Override OpenAI API base URL for embedded agents
|
|
13
|
-
--openai-model <model> Override OpenAI model (default: gpt-5, reasoning effort: low)
|
|
14
12
|
--agent Agent mode: only expose use_sentry tool (for AI agents)
|
|
15
13
|
|
|
14
|
+
Embedded agent configuration:
|
|
15
|
+
--agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)
|
|
16
|
+
--openai-base-url <url> Override OpenAI API base URL
|
|
17
|
+
--openai-model <model> Override OpenAI model (default: gpt-5)
|
|
18
|
+
--anthropic-base-url <url> Override Anthropic API base URL
|
|
19
|
+
--anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)
|
|
20
|
+
|
|
16
21
|
Session constraints:
|
|
17
22
|
--organization-slug <slug> Force all calls to an organization
|
|
18
23
|
--project-slug <slug> Optional project constraint
|
|
@@ -22,12 +27,17 @@ Skill controls:
|
|
|
22
27
|
|
|
23
28
|
All skills: ${allSkills.join(", ")}
|
|
24
29
|
|
|
30
|
+
Environment variables:
|
|
31
|
+
SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)
|
|
32
|
+
OPENAI_API_KEY OpenAI API key for AI-powered search tools
|
|
33
|
+
ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools
|
|
34
|
+
EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic
|
|
35
|
+
|
|
25
36
|
Examples:
|
|
26
37
|
${packageName} --access-token=TOKEN
|
|
27
38
|
${packageName} --access-token=TOKEN --skills=inspect,triage
|
|
28
39
|
${packageName} --access-token=TOKEN --host=sentry.example.com
|
|
29
|
-
${packageName} --access-token=TOKEN --
|
|
30
|
-
${packageName} --access-token=TOKEN --openai-base-url=https://proxy.example.com/v1`;
|
|
40
|
+
${packageName} --access-token=TOKEN --agent-provider=anthropic`;
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
//#endregion
|
|
@@ -37,4 +47,4 @@ Object.defineProperty(exports, 'buildUsage', {
|
|
|
37
47
|
return buildUsage;
|
|
38
48
|
}
|
|
39
49
|
});
|
|
40
|
-
//# sourceMappingURL=usage-
|
|
50
|
+
//# sourceMappingURL=usage-D9Tpyb5N.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-D9Tpyb5N.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\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\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\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 --agent-provider=anthropic`;\n}\n"],"mappings":";;AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;;;;;;;;;;;;;;;;;;;;;;;;cAwBjB,UAAU,KAAK,KAAK,CAAC;;;;;;;;;IAS/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
|
|
@@ -8,10 +8,15 @@ Required:
|
|
|
8
8
|
Common optional flags:
|
|
9
9
|
--host <host> Change Sentry host (self-hosted)
|
|
10
10
|
--sentry-dsn <dsn> Override DSN used for telemetry reporting
|
|
11
|
-
--openai-base-url <url> Override OpenAI API base URL for embedded agents
|
|
12
|
-
--openai-model <model> Override OpenAI model (default: gpt-5, reasoning effort: low)
|
|
13
11
|
--agent Agent mode: only expose use_sentry tool (for AI agents)
|
|
14
12
|
|
|
13
|
+
Embedded agent configuration:
|
|
14
|
+
--agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)
|
|
15
|
+
--openai-base-url <url> Override OpenAI API base URL
|
|
16
|
+
--openai-model <model> Override OpenAI model (default: gpt-5)
|
|
17
|
+
--anthropic-base-url <url> Override Anthropic API base URL
|
|
18
|
+
--anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)
|
|
19
|
+
|
|
15
20
|
Session constraints:
|
|
16
21
|
--organization-slug <slug> Force all calls to an organization
|
|
17
22
|
--project-slug <slug> Optional project constraint
|
|
@@ -21,14 +26,19 @@ Skill controls:
|
|
|
21
26
|
|
|
22
27
|
All skills: ${allSkills.join(", ")}
|
|
23
28
|
|
|
29
|
+
Environment variables:
|
|
30
|
+
SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)
|
|
31
|
+
OPENAI_API_KEY OpenAI API key for AI-powered search tools
|
|
32
|
+
ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools
|
|
33
|
+
EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic
|
|
34
|
+
|
|
24
35
|
Examples:
|
|
25
36
|
${packageName} --access-token=TOKEN
|
|
26
37
|
${packageName} --access-token=TOKEN --skills=inspect,triage
|
|
27
38
|
${packageName} --access-token=TOKEN --host=sentry.example.com
|
|
28
|
-
${packageName} --access-token=TOKEN --
|
|
29
|
-
${packageName} --access-token=TOKEN --openai-base-url=https://proxy.example.com/v1`;
|
|
39
|
+
${packageName} --access-token=TOKEN --agent-provider=anthropic`;
|
|
30
40
|
}
|
|
31
41
|
|
|
32
42
|
//#endregion
|
|
33
43
|
export { buildUsage };
|
|
34
|
-
//# sourceMappingURL=usage-
|
|
44
|
+
//# sourceMappingURL=usage-DR57Krum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-DR57Krum.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\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\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\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 --agent-provider=anthropic`;\n}\n"],"mappings":";AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;;;;;;;;;;;;;;;;;;;;;;;;cAwBjB,UAAU,KAAK,KAAK,CAAC;;;;;;;;;IAS/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
|
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.
|
|
4
|
+
"version": "0.27.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20"
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@modelcontextprotocol/sdk": "^1.21.0",
|
|
45
|
-
"@sentry/node": "10.
|
|
46
|
-
"@sentry/core": "10.
|
|
45
|
+
"@sentry/node": "10.35.0",
|
|
46
|
+
"@sentry/core": "10.35.0",
|
|
47
47
|
"dotenv": "^16.6.1",
|
|
48
48
|
"zod": "^3.25.67"
|
|
49
49
|
},
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"tsx": "^4.20.3",
|
|
54
54
|
"typescript": "^5.8.3",
|
|
55
55
|
"vitest": "^3.2.4",
|
|
56
|
-
"@sentry/mcp-core": "0.
|
|
57
|
-
"@sentry/mcp-server-mocks": "0.
|
|
58
|
-
"@sentry/mcp-server-tsconfig": "0.
|
|
56
|
+
"@sentry/mcp-core": "0.27.0",
|
|
57
|
+
"@sentry/mcp-server-mocks": "0.27.0",
|
|
58
|
+
"@sentry/mcp-server-tsconfig": "0.27.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsdown",
|
package/dist/config-rZ982IEm.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const require_config_BoFBjXRq = require('./config-BoFBjXRq-CGHqlnJ9.cjs');
|
|
2
|
-
|
|
3
|
-
exports.BASE_COMMON_FIELDS = require_config_BoFBjXRq.BASE_COMMON_FIELDS;
|
|
4
|
-
exports.DATASET_EXAMPLES = require_config_BoFBjXRq.DATASET_EXAMPLES;
|
|
5
|
-
exports.DATASET_FIELDS = require_config_BoFBjXRq.DATASET_FIELDS;
|
|
6
|
-
exports.NUMERIC_FIELDS = require_config_BoFBjXRq.NUMERIC_FIELDS;
|
|
7
|
-
exports.RECOMMENDED_FIELDS = require_config_BoFBjXRq.RECOMMENDED_FIELDS;
|