@sentry/mcp-server 0.2.1 → 0.3.1
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/README.md +1 -1
- package/dist/api-client/client.cjs +2 -2
- package/dist/api-client/client.d.cts +3 -4
- package/dist/api-client/client.d.ts +3 -4
- package/dist/api-client/client.js +2 -2
- package/dist/api-client/client.test.cjs +4 -4
- package/dist/api-client/client.test.js +4 -4
- package/dist/api-client/index.cjs +2 -2
- package/dist/api-client/index.d.cts +3 -4
- package/dist/api-client/index.d.ts +4 -5
- package/dist/api-client/index.js +2 -2
- package/dist/api-client/schema.cjs +1 -1
- package/dist/api-client/schema.d.cts +1 -2
- package/dist/api-client/schema.d.ts +1 -2
- package/dist/api-client/schema.js +1 -1
- package/dist/api-client/types.d.cts +2 -3
- package/dist/api-client/types.d.ts +2 -3
- package/dist/{client-BlG0jPGS.cjs → client-CRNnZ1r9.cjs} +11 -4
- package/dist/client-CRNnZ1r9.cjs.map +1 -0
- package/dist/{client-D1XjYhij.js → client-g5hAsyeE.js} +11 -4
- package/dist/client-g5hAsyeE.js.map +1 -0
- package/dist/client.d-BAXIPpq-.d.ts +164 -0
- package/dist/client.d-BAXIPpq-.d.ts.map +1 -0
- package/dist/client.d-CQuzKzqF.d.cts +164 -0
- package/dist/client.d-CQuzKzqF.d.cts.map +1 -0
- package/dist/{dist-B914BQU9.cjs → dist-3oa5SxPp.cjs} +1 -1
- package/dist/{dist-B914BQU9.cjs.map → dist-3oa5SxPp.cjs.map} +1 -1
- package/dist/{dist-DJoL0rVQ.js → dist-Bewd5-7a.js} +1 -1
- package/dist/{dist-DJoL0rVQ.js.map → dist-Bewd5-7a.js.map} +1 -1
- package/dist/index.cjs +33 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -15
- package/dist/index.js.map +1 -1
- package/dist/internal/formatting.d.cts +5 -3
- package/dist/internal/formatting.d.cts.map +1 -0
- package/dist/internal/formatting.d.ts +6 -4
- package/dist/internal/formatting.d.ts.map +1 -1
- package/dist/internal/issue-helpers.d.cts +10 -11
- package/dist/internal/issue-helpers.d.cts.map +1 -0
- package/dist/internal/issue-helpers.d.ts +10 -11
- package/dist/internal/issue-helpers.d.ts.map +1 -1
- package/dist/internal/issue-helpers.test.cjs +2 -2
- package/dist/internal/issue-helpers.test.js +2 -2
- package/dist/logging.d.cts +2 -0
- package/dist/logging.d.cts.map +1 -0
- package/dist/logging.d.ts +2 -0
- package/dist/logging.d.ts.map +1 -1
- package/dist/{magic-string.es-qySpjS4V.js → magic-string.es-DY8GVHw9.js} +1 -1
- package/dist/{magic-string.es-qySpjS4V.js.map → magic-string.es-DY8GVHw9.js.map} +1 -1
- package/dist/{magic-string.es-COkPNEcb.cjs → magic-string.es-m-ldRjOa.cjs} +1 -1
- package/dist/{magic-string.es-COkPNEcb.cjs.map → magic-string.es-m-ldRjOa.cjs.map} +1 -1
- package/dist/promptDefinitions.d-ByaZdRYv.d.cts +15 -0
- package/dist/promptDefinitions.d-ByaZdRYv.d.cts.map +1 -0
- package/dist/promptDefinitions.d-DyHOzL57.d.ts +15 -0
- package/dist/promptDefinitions.d-DyHOzL57.d.ts.map +1 -0
- package/dist/promptDefinitions.d.cts +1 -2
- package/dist/promptDefinitions.d.ts +1 -2
- package/dist/prompts.d.cts +17 -14
- package/dist/prompts.d.cts.map +1 -0
- package/dist/prompts.d.ts +17 -14
- package/dist/prompts.d.ts.map +1 -1
- package/dist/resources.d.cts +5 -5
- package/dist/resources.d.cts.map +1 -0
- package/dist/resources.d.ts +5 -5
- package/dist/resources.d.ts.map +1 -1
- package/dist/{schema-CyHM0GZH.cjs → schema-C5yrrdxi.cjs} +2 -5
- package/dist/schema-C5yrrdxi.cjs.map +1 -0
- package/dist/{schema-Bvva80Pn.js → schema-RGcdX0Wv.js} +2 -5
- package/dist/schema-RGcdX0Wv.js.map +1 -0
- package/dist/schema.d-BJRk-qn4.d.ts +4975 -0
- package/dist/schema.d-BJRk-qn4.d.ts.map +1 -0
- package/dist/schema.d-CBFo8C58.d.cts +4975 -0
- package/dist/schema.d-CBFo8C58.d.cts.map +1 -0
- package/dist/schema.d.cts +2 -0
- package/dist/schema.d.cts.map +1 -0
- package/dist/schema.d.ts +2 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/{server-DY8wjV9H.cjs → server-8IhYk2mv.cjs} +4 -4
- package/dist/{server-DY8wjV9H.cjs.map → server-8IhYk2mv.cjs.map} +1 -1
- package/dist/{server-DuRPgdH4.js → server-Dot7NeYs.js} +4 -4
- package/dist/{server-DuRPgdH4.js.map → server-Dot7NeYs.js.map} +1 -1
- package/dist/server.cjs +5 -5
- package/dist/server.d.cts +13 -7
- package/dist/server.d.cts.map +1 -0
- package/dist/server.d.ts +13 -7
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +5 -5
- package/dist/{stdio-Ce5DHKZ4.js → stdio-CXQ72BLj.js} +2 -2
- package/dist/{stdio-Ce5DHKZ4.js.map → stdio-CXQ72BLj.js.map} +1 -1
- package/dist/{stdio-CSJMThag.cjs → stdio-Co3Ot0bh.cjs} +2 -2
- package/dist/{stdio-CSJMThag.cjs.map → stdio-Co3Ot0bh.cjs.map} +1 -1
- package/dist/test-setup.cjs +37 -37
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +37 -37
- package/dist/test-setup.js.map +1 -1
- package/dist/{toolDefinitions-DS7wXdsP.cjs → toolDefinitions-BJ0cyDce.cjs} +6 -6
- package/dist/toolDefinitions-BJ0cyDce.cjs.map +1 -0
- package/dist/{toolDefinitions-CMNKyt4H.js → toolDefinitions-L20Lv3AW.js} +7 -7
- package/dist/{toolDefinitions-CMNKyt4H.js.map → toolDefinitions-L20Lv3AW.js.map} +1 -1
- package/dist/toolDefinitions.cjs +1 -1
- package/dist/toolDefinitions.d-C0zMvL9m.d.ts +252 -0
- package/dist/toolDefinitions.d-C0zMvL9m.d.ts.map +1 -0
- package/dist/toolDefinitions.d-Dx4q--0l.d.cts +252 -0
- package/dist/toolDefinitions.d-Dx4q--0l.d.cts.map +1 -0
- package/dist/toolDefinitions.d.cts +1 -2
- package/dist/toolDefinitions.d.ts +1 -2
- package/dist/toolDefinitions.js +1 -1
- package/dist/toolDefinitions.test.cjs +2 -2
- package/dist/toolDefinitions.test.js +2 -2
- package/dist/{tools-qkapmf3p.js → tools-BKGdG_hf.js} +5 -5
- package/dist/tools-BKGdG_hf.js.map +1 -0
- package/dist/{tools-BfTTqLNG.cjs → tools-OdomWt8t.cjs} +5 -5
- package/dist/tools-OdomWt8t.cjs.map +1 -0
- package/dist/tools.cjs +3 -3
- package/dist/tools.d.cts +259 -201
- package/dist/tools.d.cts.map +1 -0
- package/dist/tools.d.ts +259 -201
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +3 -3
- package/dist/tools.test.cjs +5 -5
- package/dist/tools.test.js +5 -5
- package/dist/transports/stdio.cjs +6 -6
- package/dist/transports/stdio.d.cts +5 -3
- package/dist/transports/stdio.d.cts.map +1 -0
- package/dist/transports/stdio.d.ts +5 -3
- package/dist/transports/stdio.d.ts.map +1 -1
- package/dist/transports/stdio.js +6 -6
- package/dist/{types.d-aQMIov7s.d.cts → types.d-BBSfGmvU.d.cts} +4 -2
- package/dist/types.d-BBSfGmvU.d.cts.map +1 -0
- package/dist/{types.d-8fZD-L6R.d.ts → types.d-BEMABWun.d.ts} +4 -2
- package/dist/types.d-BEMABWun.d.ts.map +1 -0
- package/dist/{types.d-Bj1fPi3b.d.ts → types.d-DHI7S0mb.d.ts} +14 -20
- package/dist/types.d-DHI7S0mb.d.ts.map +1 -0
- package/dist/{types.d-B8gSnrcY.d.cts → types.d-DQGXrBBW.d.cts} +14 -20
- package/dist/types.d-DQGXrBBW.d.cts.map +1 -0
- package/dist/types.d.cts +3 -4
- package/dist/types.d.ts +3 -4
- package/dist/version-BjQFPcxi.js +6 -0
- package/dist/version-BjQFPcxi.js.map +1 -0
- package/dist/version-w2qDmruK.cjs +13 -0
- package/dist/version-w2qDmruK.cjs.map +1 -0
- package/dist/version.cjs +3 -0
- package/dist/version.d.cts +8 -0
- package/dist/version.d.cts.map +1 -0
- package/dist/version.d.ts +8 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/{vi.ClIskdbk-BhK8y4UO.cjs → vi.ClIskdbk-Bn6W0wTE.cjs} +7 -7
- package/dist/{vi.ClIskdbk-BhK8y4UO.cjs.map → vi.ClIskdbk-Bn6W0wTE.cjs.map} +1 -1
- package/dist/{vi.ClIskdbk-CiLaali_.js → vi.ClIskdbk-Dd6dTM3O.js} +7 -7
- package/dist/{vi.ClIskdbk-CiLaali_.js.map → vi.ClIskdbk-Dd6dTM3O.js.map} +1 -1
- package/package.json +14 -4
- package/dist/client-BlG0jPGS.cjs.map +0 -1
- package/dist/client-D1XjYhij.js.map +0 -1
- package/dist/client.d-5v3p8aTc.d.cts +0 -108
- package/dist/client.d-Bn_APKcl.d.ts +0 -108
- package/dist/client.d-Bn_APKcl.d.ts.map +0 -1
- package/dist/promptDefinitions.d-X_QALSRc.d.cts +0 -15
- package/dist/promptDefinitions.d-qzT7TH_Z.d.ts +0 -15
- package/dist/promptDefinitions.d-qzT7TH_Z.d.ts.map +0 -1
- package/dist/schema-Bvva80Pn.js.map +0 -1
- package/dist/schema-CyHM0GZH.cjs.map +0 -1
- package/dist/schema.d-CmSYiCnk.d.cts +0 -4978
- package/dist/schema.d-CyRxxXr0.d.ts +0 -4978
- package/dist/schema.d-CyRxxXr0.d.ts.map +0 -1
- package/dist/toolDefinitions-DS7wXdsP.cjs.map +0 -1
- package/dist/toolDefinitions.d-CIXKiX81.d.cts +0 -252
- package/dist/toolDefinitions.d-DkYVHG7Y.d.ts +0 -252
- package/dist/toolDefinitions.d-DkYVHG7Y.d.ts.map +0 -1
- package/dist/tools-BfTTqLNG.cjs.map +0 -1
- package/dist/tools-qkapmf3p.js.map +0 -1
- package/dist/types.d-8fZD-L6R.d.ts.map +0 -1
- package/dist/types.d-Bj1fPi3b.d.ts.map +0 -1
- /package/dist/{index.d-Db2MND9s.d.ts → index.d-kYckfDWv.d.ts} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,42 +1,60 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
const require_chunk = require('./chunk-BtT13l48.cjs');
|
|
4
|
-
require('./schema-
|
|
5
|
-
require('./client-
|
|
4
|
+
require('./schema-C5yrrdxi.cjs');
|
|
5
|
+
require('./client-CRNnZ1r9.cjs');
|
|
6
6
|
require('./types-o3zWarRp.cjs');
|
|
7
7
|
require('./api-client-CEBuz3Zu.cjs');
|
|
8
8
|
require('./formatting-BTSvl7n7.cjs');
|
|
9
9
|
require('./issue-helpers-C0kEdXOE.cjs');
|
|
10
10
|
require('./logging-BEMgC5SA.cjs');
|
|
11
|
-
require('./tools-
|
|
11
|
+
require('./tools-OdomWt8t.cjs');
|
|
12
12
|
require('./schema-BvloqMHW.cjs');
|
|
13
|
-
require('./toolDefinitions-
|
|
13
|
+
require('./toolDefinitions-BJ0cyDce.cjs');
|
|
14
14
|
require('./resources-BAE7VVZZ.cjs');
|
|
15
15
|
require('./promptDefinitions-CVB4IyVf.cjs');
|
|
16
16
|
require('./prompts--QCiXmR2.cjs');
|
|
17
|
-
require('./server-
|
|
18
|
-
const require_stdio = require('./stdio-
|
|
17
|
+
require('./server-8IhYk2mv.cjs');
|
|
18
|
+
const require_stdio = require('./stdio-Co3Ot0bh.cjs');
|
|
19
|
+
const require_version = require('./version-w2qDmruK.cjs');
|
|
19
20
|
const __modelcontextprotocol_sdk_server_mcp_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/mcp.js"));
|
|
20
21
|
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
22
|
+
const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
|
|
21
23
|
|
|
22
24
|
//#region src/index.ts
|
|
23
25
|
let accessToken = process.env.SENTRY_AUTH_TOKEN;
|
|
24
26
|
let host = process.env.SENTRY_HOST;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
let sentryDsn = process.env.SENTRY_DSN || "https://7f7bbaad9504b727cdf8edc378c6d1de@o1.ingest.us.sentry.io/4509062593708032";
|
|
28
|
+
const packageName = "@sentry/mcp-server";
|
|
29
|
+
function getUsage() {
|
|
30
|
+
return `Usage: ${packageName} --access-token=<token> [--host=<host>] [--sentry-dsn=<dsn>]`;
|
|
31
|
+
}
|
|
32
|
+
for (const arg of process.argv.slice(2)) {
|
|
33
|
+
if (arg === "--version" || arg === "-v") {
|
|
34
|
+
console.log(`${packageName} ${require_version.LIB_VERSION}`);
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
if (arg.startsWith("--access-token=")) accessToken = arg.split("=")[1];
|
|
38
|
+
else if (arg.startsWith("--host=")) host = arg.split("=")[1];
|
|
39
|
+
else if (arg.startsWith("--sentry-dsn=")) sentryDsn = arg.split("=")[1];
|
|
40
|
+
else {
|
|
41
|
+
console.error("Error: Invalid argument:", arg);
|
|
42
|
+
console.error(getUsage());
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
31
45
|
}
|
|
32
46
|
if (!accessToken) {
|
|
33
|
-
console.error("
|
|
34
|
-
console.error(
|
|
47
|
+
console.error("Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_AUTH_TOKEN`.");
|
|
48
|
+
console.error(getUsage());
|
|
35
49
|
process.exit(1);
|
|
36
50
|
}
|
|
51
|
+
__sentry_node.init({
|
|
52
|
+
dsn: sentryDsn,
|
|
53
|
+
sendDefaultPii: true
|
|
54
|
+
});
|
|
37
55
|
const server = new __modelcontextprotocol_sdk_server_mcp_js.McpServer({
|
|
38
56
|
name: "Sentry MCP",
|
|
39
|
-
version:
|
|
57
|
+
version: require_version.LIB_VERSION
|
|
40
58
|
});
|
|
41
59
|
const instrumentedServer = (0, __sentry_core.wrapMcpServerWithSentry)(server);
|
|
42
60
|
require_stdio.startStdio(instrumentedServer, {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["accessToken: string | undefined","host: string | undefined","McpServer"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { startStdio } from \"./transports/stdio\";\nimport { wrapMcpServerWithSentry } from \"@sentry/core\";\
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["accessToken: string | undefined","host: string | undefined","sentryDsn: string | undefined","LIB_VERSION","McpServer"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { startStdio } from \"./transports/stdio\";\nimport { wrapMcpServerWithSentry } from \"@sentry/core\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"./version\";\nlet accessToken: string | undefined = process.env.SENTRY_AUTH_TOKEN;\nlet host: string | undefined = process.env.SENTRY_HOST;\nlet sentryDsn: string | undefined =\n process.env.SENTRY_DSN || process.env.DEFAULT_SENTRY_DSN;\n\nconst packageName = \"@sentry/mcp-server\";\nfunction getUsage() {\n return `Usage: ${packageName} --access-token=<token> [--host=<host>] [--sentry-dsn=<dsn>]`;\n}\n\nfor (const arg of process.argv.slice(2)) {\n if (arg === \"--version\" || arg === \"-v\") {\n console.log(`${packageName} ${LIB_VERSION}`);\n process.exit(0);\n }\n if (arg.startsWith(\"--access-token=\")) {\n accessToken = arg.split(\"=\")[1];\n } else if (arg.startsWith(\"--host=\")) {\n host = arg.split(\"=\")[1];\n } else if (arg.startsWith(\"--sentry-dsn=\")) {\n sentryDsn = arg.split(\"=\")[1];\n } else {\n console.error(\"Error: Invalid argument:\", arg);\n console.error(getUsage());\n process.exit(1);\n }\n}\n\nif (!accessToken) {\n console.error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_AUTH_TOKEN`.\",\n );\n console.error(getUsage());\n process.exit(1);\n}\n\nSentry.init({\n dsn: sentryDsn,\n sendDefaultPii: true,\n});\n\nconst server = new McpServer({\n name: \"Sentry MCP\",\n version: LIB_VERSION,\n});\n\nconst instrumentedServer = wrapMcpServerWithSentry(server);\n\n// XXX: we could do what we're doing in routes/auth.ts and pass the context\n// identically, but we don't really need userId and userName yet\nstartStdio(instrumentedServer, {\n accessToken,\n organizationSlug: null,\n host,\n}).catch((err) => {\n console.error(\"Server error:\", err);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAIA,cAAkC,QAAQ,IAAI;AAClD,IAAIC,OAA2B,QAAQ,IAAI;AAC3C,IAAIC,YACF,QAAQ,IAAI;AAEd,MAAM,cAAc;AACpB,SAAS,WAAW;AAClB,SAAQ,SAAS,YAAY;AAC9B;AAED,KAAK,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE,EAAE;AACvC,KAAI,QAAQ,eAAe,QAAQ,MAAM;AACvC,UAAQ,KAAK,EAAE,YAAY,GAAGC,4BAAY,EAAE;AAC5C,UAAQ,KAAK,EAAE;CAChB;AACD,KAAI,IAAI,WAAW,kBAAkB,CACnC,eAAc,IAAI,MAAM,IAAI,CAAC;UACpB,IAAI,WAAW,UAAU,CAClC,QAAO,IAAI,MAAM,IAAI,CAAC;UACb,IAAI,WAAW,gBAAgB,CACxC,aAAY,IAAI,MAAM,IAAI,CAAC;MACtB;AACL,UAAQ,MAAM,4BAA4B,IAAI;AAC9C,UAAQ,MAAM,UAAU,CAAC;AACzB,UAAQ,KAAK,EAAE;CAChB;AACF;AAED,KAAK,aAAa;AAChB,SAAQ,MACN,kGACD;AACD,SAAQ,MAAM,UAAU,CAAC;AACzB,SAAQ,KAAK,EAAE;AAChB;AAED,cAAO,KAAK;CACV,KAAK;CACL,gBAAgB;AACjB,EAAC;AAEF,MAAM,SAAS,IAAIC,mDAAU;CAC3B,MAAM;CACN,SAASD;AACV;AAED,MAAM,qBAAqB,2CAAwB,OAAO;AAI1D,yBAAW,oBAAoB;CAC7B;CACA,kBAAkB;CAClB;AACD,EAAC,CAAC,MAAM,CAAC,QAAQ;AAChB,SAAQ,MAAM,iBAAiB,IAAI;AACnC,SAAQ,KAAK,EAAE;AAChB,EAAC"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,58 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./schema-
|
|
3
|
-
import "./client-
|
|
2
|
+
import "./schema-RGcdX0Wv.js";
|
|
3
|
+
import "./client-g5hAsyeE.js";
|
|
4
4
|
import "./types-H-TSmRpm.js";
|
|
5
5
|
import "./api-client-9mzrj2HY.js";
|
|
6
6
|
import "./formatting-Bacfde0I.js";
|
|
7
7
|
import "./issue-helpers-DFde36Zu.js";
|
|
8
8
|
import "./logging-Cxm8lQvg.js";
|
|
9
|
-
import "./tools-
|
|
9
|
+
import "./tools-BKGdG_hf.js";
|
|
10
10
|
import "./schema-k04PdSCK.js";
|
|
11
|
-
import "./toolDefinitions-
|
|
11
|
+
import "./toolDefinitions-L20Lv3AW.js";
|
|
12
12
|
import "./resources-OM3EAnnj.js";
|
|
13
13
|
import "./promptDefinitions-CaRMCDPI.js";
|
|
14
14
|
import "./prompts-Tz-qECa0.js";
|
|
15
|
-
import "./server-
|
|
16
|
-
import { startStdio } from "./stdio-
|
|
15
|
+
import "./server-Dot7NeYs.js";
|
|
16
|
+
import { startStdio } from "./stdio-CXQ72BLj.js";
|
|
17
|
+
import { LIB_VERSION } from "./version-BjQFPcxi.js";
|
|
17
18
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
18
19
|
import { wrapMcpServerWithSentry } from "@sentry/core";
|
|
20
|
+
import * as Sentry from "@sentry/node";
|
|
19
21
|
|
|
20
22
|
//#region src/index.ts
|
|
21
23
|
let accessToken = process.env.SENTRY_AUTH_TOKEN;
|
|
22
24
|
let host = process.env.SENTRY_HOST;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
let sentryDsn = process.env.SENTRY_DSN || "https://7f7bbaad9504b727cdf8edc378c6d1de@o1.ingest.us.sentry.io/4509062593708032";
|
|
26
|
+
const packageName = "@sentry/mcp-server";
|
|
27
|
+
function getUsage() {
|
|
28
|
+
return `Usage: ${packageName} --access-token=<token> [--host=<host>] [--sentry-dsn=<dsn>]`;
|
|
29
|
+
}
|
|
30
|
+
for (const arg of process.argv.slice(2)) {
|
|
31
|
+
if (arg === "--version" || arg === "-v") {
|
|
32
|
+
console.log(`${packageName} ${LIB_VERSION}`);
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
if (arg.startsWith("--access-token=")) accessToken = arg.split("=")[1];
|
|
36
|
+
else if (arg.startsWith("--host=")) host = arg.split("=")[1];
|
|
37
|
+
else if (arg.startsWith("--sentry-dsn=")) sentryDsn = arg.split("=")[1];
|
|
38
|
+
else {
|
|
39
|
+
console.error("Error: Invalid argument:", arg);
|
|
40
|
+
console.error(getUsage());
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
29
43
|
}
|
|
30
44
|
if (!accessToken) {
|
|
31
|
-
console.error("
|
|
32
|
-
console.error(
|
|
45
|
+
console.error("Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_AUTH_TOKEN`.");
|
|
46
|
+
console.error(getUsage());
|
|
33
47
|
process.exit(1);
|
|
34
48
|
}
|
|
49
|
+
Sentry.init({
|
|
50
|
+
dsn: sentryDsn,
|
|
51
|
+
sendDefaultPii: true
|
|
52
|
+
});
|
|
35
53
|
const server = new McpServer({
|
|
36
54
|
name: "Sentry MCP",
|
|
37
|
-
version:
|
|
55
|
+
version: LIB_VERSION
|
|
38
56
|
});
|
|
39
57
|
const instrumentedServer = wrapMcpServerWithSentry(server);
|
|
40
58
|
startStdio(instrumentedServer, {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["accessToken: string | undefined","host: string | undefined"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { startStdio } from \"./transports/stdio\";\nimport { wrapMcpServerWithSentry } from \"@sentry/core\";\
|
|
1
|
+
{"version":3,"file":"index.js","names":["accessToken: string | undefined","host: string | undefined","sentryDsn: string | undefined"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { startStdio } from \"./transports/stdio\";\nimport { wrapMcpServerWithSentry } from \"@sentry/core\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"./version\";\nlet accessToken: string | undefined = process.env.SENTRY_AUTH_TOKEN;\nlet host: string | undefined = process.env.SENTRY_HOST;\nlet sentryDsn: string | undefined =\n process.env.SENTRY_DSN || process.env.DEFAULT_SENTRY_DSN;\n\nconst packageName = \"@sentry/mcp-server\";\nfunction getUsage() {\n return `Usage: ${packageName} --access-token=<token> [--host=<host>] [--sentry-dsn=<dsn>]`;\n}\n\nfor (const arg of process.argv.slice(2)) {\n if (arg === \"--version\" || arg === \"-v\") {\n console.log(`${packageName} ${LIB_VERSION}`);\n process.exit(0);\n }\n if (arg.startsWith(\"--access-token=\")) {\n accessToken = arg.split(\"=\")[1];\n } else if (arg.startsWith(\"--host=\")) {\n host = arg.split(\"=\")[1];\n } else if (arg.startsWith(\"--sentry-dsn=\")) {\n sentryDsn = arg.split(\"=\")[1];\n } else {\n console.error(\"Error: Invalid argument:\", arg);\n console.error(getUsage());\n process.exit(1);\n }\n}\n\nif (!accessToken) {\n console.error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_AUTH_TOKEN`.\",\n );\n console.error(getUsage());\n process.exit(1);\n}\n\nSentry.init({\n dsn: sentryDsn,\n sendDefaultPii: true,\n});\n\nconst server = new McpServer({\n name: \"Sentry MCP\",\n version: LIB_VERSION,\n});\n\nconst instrumentedServer = wrapMcpServerWithSentry(server);\n\n// XXX: we could do what we're doing in routes/auth.ts and pass the context\n// identically, but we don't really need userId and userName yet\nstartStdio(instrumentedServer, {\n accessToken,\n organizationSlug: null,\n host,\n}).catch((err) => {\n console.error(\"Server error:\", err);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA,IAAIA,cAAkC,QAAQ,IAAI;AAClD,IAAIC,OAA2B,QAAQ,IAAI;AAC3C,IAAIC,YACF,QAAQ,IAAI;AAEd,MAAM,cAAc;AACpB,SAAS,WAAW;AAClB,SAAQ,SAAS,YAAY;AAC9B;AAED,KAAK,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE,EAAE;AACvC,KAAI,QAAQ,eAAe,QAAQ,MAAM;AACvC,UAAQ,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE;AAC5C,UAAQ,KAAK,EAAE;CAChB;AACD,KAAI,IAAI,WAAW,kBAAkB,CACnC,eAAc,IAAI,MAAM,IAAI,CAAC;UACpB,IAAI,WAAW,UAAU,CAClC,QAAO,IAAI,MAAM,IAAI,CAAC;UACb,IAAI,WAAW,gBAAgB,CACxC,aAAY,IAAI,MAAM,IAAI,CAAC;MACtB;AACL,UAAQ,MAAM,4BAA4B,IAAI;AAC9C,UAAQ,MAAM,UAAU,CAAC;AACzB,UAAQ,KAAK,EAAE;CAChB;AACF;AAED,KAAK,aAAa;AAChB,SAAQ,MACN,kGACD;AACD,SAAQ,MAAM,UAAU,CAAC;AACzB,SAAQ,KAAK,EAAE;AAChB;AAED,OAAO,KAAK;CACV,KAAK;CACL,gBAAgB;AACjB,EAAC;AAEF,MAAM,SAAS,IAAI,UAAU;CAC3B,MAAM;CACN,SAAS;AACV;AAED,MAAM,qBAAqB,wBAAwB,OAAO;AAI1D,WAAW,oBAAoB;CAC7B;CACA,kBAAkB;CAClB;AACD,EAAC,CAAC,MAAM,CAAC,QAAQ;AAChB,SAAQ,MAAM,iBAAiB,IAAI;AACnC,SAAQ,KAAK,EAAE;AAChB,EAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FrameInterface } from "../schema.d-
|
|
2
|
-
import { Event } from "../types.d-
|
|
3
|
-
import "../client.d-
|
|
1
|
+
import { FrameInterface } from "../schema.d-CBFo8C58.cjs";
|
|
2
|
+
import { Event } from "../types.d-BBSfGmvU.cjs";
|
|
3
|
+
import "../client.d-CQuzKzqF.cjs";
|
|
4
4
|
import "../index.d-Cb-lHGvn.cjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -9,5 +9,7 @@ declare function formatFrameHeader(frame: z.infer<typeof FrameInterface>, platfo
|
|
|
9
9
|
declare function formatEventOutput(event: Event): string;
|
|
10
10
|
|
|
11
11
|
//#endregion
|
|
12
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
13
|
+
|
|
12
14
|
export { formatEventOutput, formatFrameHeader };
|
|
13
15
|
//# sourceMappingURL=formatting.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.d.cts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":null,"mappings":";;;;;;;iBAIgB,iBAAA,QACP,CAAA,CAAE,aAAa;iBAeR,iBAAA,QAAyB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FrameInterface$1 as FrameInterface } from "../schema.d-
|
|
2
|
-
import { Event } from "../types.d-
|
|
3
|
-
import "../client.d-
|
|
4
|
-
import "../index.d-
|
|
1
|
+
import { FrameInterface$1 as FrameInterface } from "../schema.d-BJRk-qn4.js";
|
|
2
|
+
import { Event } from "../types.d-BEMABWun.js";
|
|
3
|
+
import "../client.d-BAXIPpq-.js";
|
|
4
|
+
import "../index.d-kYckfDWv.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/internal/formatting.d.ts
|
|
@@ -9,5 +9,7 @@ declare function formatFrameHeader(frame: z.infer<typeof FrameInterface>, platfo
|
|
|
9
9
|
declare function formatEventOutput(event: Event): string;
|
|
10
10
|
|
|
11
11
|
//#endregion
|
|
12
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
13
|
+
|
|
12
14
|
export { formatEventOutput, formatFrameHeader };
|
|
13
15
|
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","names":[],"sources":["../../src/internal/formatting.
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":null,"mappings":";;;;;;;iBAIgB,iBAAA,QACP,CAAA,CAAE,aAAa;iBAeR,iBAAA,QAAyB"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
//#region src/internal/issue-helpers.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
4
|
-
*
|
|
5
|
-
* @param url - A full Sentry issue URL
|
|
6
|
-
* @returns Object containing the numeric issue ID and organization slug (if found)
|
|
7
|
-
* @throws Error if the input is invalid
|
|
8
|
-
*/
|
|
3
|
+
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
4
|
+
*
|
|
5
|
+
* @param url - A full Sentry issue URL
|
|
6
|
+
* @returns Object containing the numeric issue ID and organization slug (if found)
|
|
7
|
+
* @throws Error if the input is invalid
|
|
8
|
+
*/
|
|
9
9
|
declare function extractIssueId(url: string): {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
10
|
+
issueId: string;
|
|
11
|
+
organizationSlug: string;
|
|
12
|
+
}; //#endregion
|
|
13
|
+
//# sourceMappingURL=issue-helpers.d.ts.map
|
|
15
14
|
export { extractIssueId };
|
|
16
15
|
//# sourceMappingURL=issue-helpers.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-helpers.d.cts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":null,"mappings":";;;;;;;;iBAOgB,cAAA;EAAA,OAAA,EAAA,MAAA"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
//#region src/internal/issue-helpers.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
4
|
-
*
|
|
5
|
-
* @param url - A full Sentry issue URL
|
|
6
|
-
* @returns Object containing the numeric issue ID and organization slug (if found)
|
|
7
|
-
* @throws Error if the input is invalid
|
|
8
|
-
*/
|
|
3
|
+
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
4
|
+
*
|
|
5
|
+
* @param url - A full Sentry issue URL
|
|
6
|
+
* @returns Object containing the numeric issue ID and organization slug (if found)
|
|
7
|
+
* @throws Error if the input is invalid
|
|
8
|
+
*/
|
|
9
9
|
declare function extractIssueId(url: string): {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
10
|
+
issueId: string;
|
|
11
|
+
organizationSlug: string;
|
|
12
|
+
}; //#endregion
|
|
13
|
+
//# sourceMappingURL=issue-helpers.d.ts.map
|
|
15
14
|
export { extractIssueId };
|
|
16
15
|
//# sourceMappingURL=issue-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.d.ts","names":[],"sources":["../../src/internal/issue-helpers.
|
|
1
|
+
{"version":3,"file":"issue-helpers.d.ts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":null,"mappings":";;;;;;;;iBAOgB,cAAA;EAAA,OAAA,EAAA,MAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_issue_helpers = require('../issue-helpers-C0kEdXOE.cjs');
|
|
3
|
-
const require_dist = require('../dist-
|
|
4
|
-
const require_vi_ClIskdbk = require('../vi.ClIskdbk-
|
|
3
|
+
const require_dist = require('../dist-3oa5SxPp.cjs');
|
|
4
|
+
const require_vi_ClIskdbk = require('../vi.ClIskdbk-Bn6W0wTE.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/internal/issue-helpers.test.ts
|
|
7
7
|
require_dist.describe("extractIssueId", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extractIssueId } from "../issue-helpers-DFde36Zu.js";
|
|
2
|
-
import { describe, it } from "../dist-
|
|
3
|
-
import { globalExpect } from "../vi.ClIskdbk-
|
|
2
|
+
import { describe, it } from "../dist-Bewd5-7a.js";
|
|
3
|
+
import { globalExpect } from "../vi.ClIskdbk-Dd6dTM3O.js";
|
|
4
4
|
|
|
5
5
|
//#region src/internal/issue-helpers.test.ts
|
|
6
6
|
describe("extractIssueId", () => {
|
package/dist/logging.d.cts
CHANGED
|
@@ -3,5 +3,7 @@ declare function logError(error: Error | unknown, contexts?: Record<string, Reco
|
|
|
3
3
|
declare function logError(message: string, contexts?: Record<string, Record<string, any>>, attachments?: Record<string, string | Uint8Array>): string | undefined;
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
|
+
//# sourceMappingURL=logging.d.ts.map
|
|
7
|
+
|
|
6
8
|
export { logError };
|
|
7
9
|
//# sourceMappingURL=logging.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.d.cts","names":[],"sources":["../src/logging.ts"],"sourcesContent":null,"mappings":";iBAEgB,QAAA,QACP,4BACI,eAAe,oCACZ,wBAAwB;AAHxB,iBAKA,QAAA,CALQ,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAOX,MAPW,CAAA,MAAA,EAOI,MAPJ,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,EAAA,WAAA,CAAA,EAQR,MARQ,CAAA,MAAA,EAAA,MAAA,GAQgB,UARhB,CAAA,CAAA,EAAA,MAAA,GAAA,SAAA"}
|
package/dist/logging.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ declare function logError(error: Error | unknown, contexts?: Record<string, Reco
|
|
|
3
3
|
declare function logError(message: string, contexts?: Record<string, Record<string, any>>, attachments?: Record<string, string | Uint8Array>): string | undefined;
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
|
+
//# sourceMappingURL=logging.d.ts.map
|
|
7
|
+
|
|
6
8
|
export { logError };
|
|
7
9
|
//# sourceMappingURL=logging.d.ts.map
|
package/dist/logging.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","names":[],"sources":["../src/logging.
|
|
1
|
+
{"version":3,"file":"logging.d.ts","names":[],"sources":["../src/logging.ts"],"sourcesContent":null,"mappings":";iBAEgB,QAAA,QACP,4BACI,eAAe,oCACZ,wBAAwB;AAHxB,iBAKA,QAAA,CALQ,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAOX,MAPW,CAAA,MAAA,EAOI,MAPJ,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,EAAA,WAAA,CAAA,EAQR,MARQ,CAAA,MAAA,EAAA,MAAA,GAQgB,UARhB,CAAA,CAAA,EAAA,MAAA,GAAA,SAAA"}
|