@greensecurity/javascript-sdk 0.10.2 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +67 -11
  2. package/bin/mcp-server.js +39384 -0
  3. package/bin/mcp-server.js.map +301 -0
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +5 -5
  6. package/lib/config.d.ts.map +1 -1
  7. package/lib/config.js +3 -3
  8. package/lib/files.js.map +1 -1
  9. package/mcp-server/build.d.mts.map +1 -0
  10. package/mcp-server/build.mjs +14 -0
  11. package/mcp-server/build.mjs.map +1 -0
  12. package/mcp-server/cli/start/command.d.ts +2 -0
  13. package/mcp-server/cli/start/command.d.ts.map +1 -0
  14. package/mcp-server/cli/start/command.js +99 -0
  15. package/mcp-server/cli/start/command.js.map +1 -0
  16. package/mcp-server/cli/start/impl.d.ts +15 -0
  17. package/mcp-server/cli/start/impl.d.ts.map +1 -0
  18. package/mcp-server/cli/start/impl.js +97 -0
  19. package/mcp-server/cli/start/impl.js.map +1 -0
  20. package/mcp-server/cli.d.ts +6 -0
  21. package/mcp-server/cli.d.ts.map +1 -0
  22. package/mcp-server/cli.js +10 -0
  23. package/mcp-server/cli.js.map +1 -0
  24. package/mcp-server/console-logger.d.ts +7 -0
  25. package/mcp-server/console-logger.d.ts.map +1 -0
  26. package/mcp-server/console-logger.js +59 -0
  27. package/mcp-server/console-logger.js.map +1 -0
  28. package/mcp-server/mcp-server.d.ts +2 -0
  29. package/mcp-server/mcp-server.d.ts.map +1 -0
  30. package/mcp-server/mcp-server.js +29 -0
  31. package/mcp-server/mcp-server.js.map +1 -0
  32. package/mcp-server/resources.d.ts +27 -0
  33. package/mcp-server/resources.d.ts.map +1 -0
  34. package/mcp-server/resources.js +51 -0
  35. package/mcp-server/resources.js.map +1 -0
  36. package/mcp-server/scopes.d.ts +3 -0
  37. package/mcp-server/scopes.d.ts.map +1 -0
  38. package/mcp-server/scopes.js +8 -0
  39. package/mcp-server/scopes.js.map +1 -0
  40. package/mcp-server/server.d.ts +11 -0
  41. package/mcp-server/server.d.ts.map +1 -0
  42. package/mcp-server/server.js +44 -0
  43. package/mcp-server/server.js.map +1 -0
  44. package/mcp-server/shared.d.ts +7 -0
  45. package/mcp-server/shared.d.ts.map +1 -0
  46. package/mcp-server/shared.js +98 -0
  47. package/mcp-server/shared.js.map +1 -0
  48. package/mcp-server/tools/organizationsGetFacility.d.ts +8 -0
  49. package/mcp-server/tools/organizationsGetFacility.d.ts.map +1 -0
  50. package/mcp-server/tools/organizationsGetFacility.js +64 -0
  51. package/mcp-server/tools/organizationsGetFacility.js.map +1 -0
  52. package/mcp-server/tools/organizationsListOrSearchFacilities.d.ts +8 -0
  53. package/mcp-server/tools/organizationsListOrSearchFacilities.d.ts.map +1 -0
  54. package/mcp-server/tools/organizationsListOrSearchFacilities.js +77 -0
  55. package/mcp-server/tools/organizationsListOrSearchFacilities.js.map +1 -0
  56. package/mcp-server/tools/userGetCurrentUser.d.ts +3 -0
  57. package/mcp-server/tools/userGetCurrentUser.d.ts.map +1 -0
  58. package/mcp-server/tools/userGetCurrentUser.js +26 -0
  59. package/mcp-server/tools/userGetCurrentUser.js.map +1 -0
  60. package/mcp-server/tools/userGetUserById.d.ts +8 -0
  61. package/mcp-server/tools/userGetUserById.d.ts.map +1 -0
  62. package/mcp-server/tools/userGetUserById.js +64 -0
  63. package/mcp-server/tools/userGetUserById.js.map +1 -0
  64. package/mcp-server/tools/userLogsUserIntoTheSystem.d.ts +8 -0
  65. package/mcp-server/tools/userLogsUserIntoTheSystem.d.ts.map +1 -0
  66. package/mcp-server/tools/userLogsUserIntoTheSystem.js +94 -0
  67. package/mcp-server/tools/userLogsUserIntoTheSystem.js.map +1 -0
  68. package/mcp-server/tools/userMagiclink.d.ts +8 -0
  69. package/mcp-server/tools/userMagiclink.d.ts.map +1 -0
  70. package/mcp-server/tools/userMagiclink.js +64 -0
  71. package/mcp-server/tools/userMagiclink.js.map +1 -0
  72. package/mcp-server/tools/userPassword.d.ts +8 -0
  73. package/mcp-server/tools/userPassword.d.ts.map +1 -0
  74. package/mcp-server/tools/userPassword.js +65 -0
  75. package/mcp-server/tools/userPassword.js.map +1 -0
  76. package/mcp-server/tools/userPasswordResetRequest.d.ts +8 -0
  77. package/mcp-server/tools/userPasswordResetRequest.d.ts.map +1 -0
  78. package/mcp-server/tools/userPasswordResetRequest.js +64 -0
  79. package/mcp-server/tools/userPasswordResetRequest.js.map +1 -0
  80. package/mcp-server/tools/vendorsCreateVendorRegistration.d.ts +8 -0
  81. package/mcp-server/tools/vendorsCreateVendorRegistration.d.ts.map +1 -0
  82. package/mcp-server/tools/vendorsCreateVendorRegistration.js +64 -0
  83. package/mcp-server/tools/vendorsCreateVendorRegistration.js.map +1 -0
  84. package/mcp-server/tools/vendorsListVendorJobTitles.d.ts +8 -0
  85. package/mcp-server/tools/vendorsListVendorJobTitles.d.ts.map +1 -0
  86. package/mcp-server/tools/vendorsListVendorJobTitles.js +64 -0
  87. package/mcp-server/tools/vendorsListVendorJobTitles.js.map +1 -0
  88. package/mcp-server/tools.d.ts +25 -0
  89. package/mcp-server/tools.d.ts.map +1 -0
  90. package/mcp-server/tools.js +74 -0
  91. package/mcp-server/tools.js.map +1 -0
  92. package/models/operations/password.d.ts +2 -2
  93. package/models/operations/password.d.ts.map +1 -1
  94. package/models/operations/password.js +2 -2
  95. package/models/operations/password.js.map +1 -1
  96. package/package.json +14 -2
  97. package/src/lib/config.ts +5 -5
  98. package/src/lib/files.ts +1 -1
  99. package/src/mcp-server/cli/start/command.ts +67 -0
  100. package/src/mcp-server/cli/start/impl.ts +123 -0
  101. package/src/mcp-server/cli.ts +13 -0
  102. package/src/mcp-server/console-logger.ts +71 -0
  103. package/src/mcp-server/mcp-server.ts +26 -0
  104. package/src/mcp-server/resources.ts +96 -0
  105. package/src/mcp-server/scopes.ts +7 -0
  106. package/src/mcp-server/server.ts +52 -0
  107. package/src/mcp-server/shared.ts +75 -0
  108. package/src/mcp-server/tools/organizationsGetFacility.ts +37 -0
  109. package/src/mcp-server/tools/organizationsListOrSearchFacilities.ts +52 -0
  110. package/src/mcp-server/tools/userGetCurrentUser.ts +30 -0
  111. package/src/mcp-server/tools/userGetUserById.ts +37 -0
  112. package/src/mcp-server/tools/userLogsUserIntoTheSystem.ts +67 -0
  113. package/src/mcp-server/tools/userMagiclink.ts +37 -0
  114. package/src/mcp-server/tools/userPassword.ts +38 -0
  115. package/src/mcp-server/tools/userPasswordResetRequest.ts +37 -0
  116. package/src/mcp-server/tools/vendorsCreateVendorRegistration.ts +38 -0
  117. package/src/mcp-server/tools/vendorsListVendorJobTitles.ts +37 -0
  118. package/src/mcp-server/tools.ts +116 -0
  119. package/src/models/operations/password.ts +4 -4
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@greensecurity/javascript-sdk",
5
- "version": "0.10.2",
5
+ "version": "0.11.0",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/lib/config.d.ts CHANGED
@@ -15,11 +15,11 @@ export type SDKOptions = {
15
15
  /**
16
16
  * Allows overriding the default server used by the SDK
17
17
  */
18
- serverIdx?: number;
18
+ serverIdx?: number | undefined;
19
19
  /**
20
20
  * Allows overriding the default server URL used by the SDK
21
21
  */
22
- serverURL?: string;
22
+ serverURL?: string | undefined;
23
23
  /**
24
24
  * Allows overriding the default retry config used by the SDK
25
25
  */
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
31
31
  export declare const SDK_METADATA: {
32
32
  readonly language: "typescript";
33
33
  readonly openapiDocVersion: "0.0.3";
34
- readonly sdkVersion: "0.10.2";
35
- readonly genVersion: "2.517.3";
36
- readonly userAgent: "speakeasy-sdk/typescript 0.10.2 2.517.3 0.0.3 @greensecurity/javascript-sdk";
34
+ readonly sdkVersion: "0.11.0";
35
+ readonly genVersion: "2.518.1";
36
+ readonly userAgent: "speakeasy-sdk/typescript 0.11.0 2.518.1 0.0.3 @greensecurity/javascript-sdk";
37
37
  };
38
38
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C;;GAEG;AACH,eAAO,MAAM,UAAU,6HAab,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEtE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU,GAAG,GAAG,GAAG,IAAI,CAepE;AAED,eAAO,MAAM,YAAY;;;;;;CAOf,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C;;GAEG;AACH,eAAO,MAAM,UAAU,6HAab,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEtE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU,GAAG,GAAG,GAAG,IAAI,CAepE;AAED,eAAO,MAAM,YAAY;;;;;;CAOf,CAAC"}
package/lib/config.js CHANGED
@@ -39,8 +39,8 @@ function serverURLFromOptions(options) {
39
39
  exports.SDK_METADATA = {
40
40
  language: "typescript",
41
41
  openapiDocVersion: "0.0.3",
42
- sdkVersion: "0.10.2",
43
- genVersion: "2.517.3",
44
- userAgent: "speakeasy-sdk/typescript 0.10.2 2.517.3 0.0.3 @greensecurity/javascript-sdk",
42
+ sdkVersion: "0.11.0",
43
+ genVersion: "2.518.1",
44
+ userAgent: "speakeasy-sdk/typescript 0.11.0 2.518.1 0.0.3 @greensecurity/javascript-sdk",
45
45
  };
46
46
  //# sourceMappingURL=config.js.map
package/lib/files.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../src/lib/files.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAQH,kEA6BC;AAnCD;;;;;GAKG;AACI,KAAK,UAAU,2BAA2B,CAC/C,QAAoC;IAEpC,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;IACpC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;YAChB,IAAI,GAAG,IAAI,CAAC;QACd,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,WAAW,IAAI,KAAK,CAAC,MAAM,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,kBAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,OAAO,kBAAkB,CAAC,MAAqB,CAAC;AAClD,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.mts","sourceRoot":"","sources":["../src/mcp-server/build.mts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ /// <reference types="bun-types" />
2
+ import { build } from "bun";
3
+ const entrypoint = "./src/mcp-server/mcp-server.ts";
4
+ await build({
5
+ entrypoints: [entrypoint],
6
+ outdir: "./bin",
7
+ sourcemap: "linked",
8
+ target: "node",
9
+ format: "esm",
10
+ minify: false,
11
+ throw: true,
12
+ banner: "#!/usr/bin/env node",
13
+ });
14
+ //# sourceMappingURL=build.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.mjs","sourceRoot":"","sources":["../src/mcp-server/build.mts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAE5B,MAAM,UAAU,GAAG,gCAAgC,CAAC;AAEpD,MAAM,KAAK,CAAC;IACV,WAAW,EAAE,CAAC,UAAU,CAAC;IACzB,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,qBAAqB;CAC9B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const startCommand: import("@stricli/core").Command<import("../../cli.js").LocalContext>;
2
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/cli/start/command.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY,sEAwDvB,CAAC"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.startCommand = void 0;
40
+ const core_1 = require("@stricli/core");
41
+ const core_2 = require("@stricli/core");
42
+ const z = __importStar(require("zod"));
43
+ const console_logger_js_1 = require("../../console-logger.js");
44
+ const scopes_js_1 = require("../../scopes.js");
45
+ exports.startCommand = (0, core_1.buildCommand)({
46
+ loader: async () => {
47
+ const { main } = await import("./impl.js");
48
+ return main;
49
+ },
50
+ parameters: {
51
+ flags: {
52
+ "log-level": {
53
+ kind: "enum",
54
+ brief: "The log level to use for the server",
55
+ default: "info",
56
+ values: console_logger_js_1.consoleLoggerLevels,
57
+ },
58
+ transport: {
59
+ kind: "enum",
60
+ brief: "The transport to use for communicating with the server",
61
+ default: "stdio",
62
+ values: ["stdio", "sse"],
63
+ },
64
+ port: {
65
+ kind: "parsed",
66
+ brief: "The port to use when the SSE transport is enabled",
67
+ default: "2718",
68
+ parse: (val) => z.coerce.number().int().gte(0).lt(65536).parse(val),
69
+ },
70
+ ...(scopes_js_1.mcpScopes.length
71
+ ? {
72
+ scope: {
73
+ kind: "enum",
74
+ brief: "Mount tools/resources that match given scope (repeatable flag)",
75
+ values: scopes_js_1.mcpScopes,
76
+ variadic: true,
77
+ optional: true,
78
+ },
79
+ }
80
+ : {}),
81
+ "server-url": {
82
+ kind: "parsed",
83
+ brief: "Overrides the default server URL used by the SDK",
84
+ optional: true,
85
+ parse: (value) => new URL(value).toString(),
86
+ },
87
+ "server-index": {
88
+ kind: "parsed",
89
+ brief: "Selects a predefined server used by the SDK",
90
+ optional: true,
91
+ parse: core_2.numberParser,
92
+ },
93
+ },
94
+ },
95
+ docs: {
96
+ brief: "Run the Model Context Protocol server",
97
+ },
98
+ });
99
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/mcp-server/cli/start/command.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wCAA6C;AAC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EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;aAC5C;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,6CAA6C;gBACpD,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,mBAAY;aACpB;SACF;KACF;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,uCAAuC;KAC/C;CACF,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { SDKOptions } from "../../../lib/config.js";
2
+ import { LocalContext } from "../../cli.js";
3
+ import { ConsoleLoggerLevel } from "../../console-logger.js";
4
+ import { MCPScope } from "../../scopes.js";
5
+ interface StartCommandFlags {
6
+ readonly "log-level": ConsoleLoggerLevel;
7
+ readonly transport: "stdio" | "sse";
8
+ readonly port: number;
9
+ readonly scope?: MCPScope[];
10
+ readonly "server-url"?: string;
11
+ readonly "server-index"?: SDKOptions["serverIdx"];
12
+ }
13
+ export declare function main(this: LocalContext, flags: StartCommandFlags): Promise<void>;
14
+ export {};
15
+ //# sourceMappingURL=impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/cli/start/impl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,UAAU,iBAAiB;IACzB,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,KAAK,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACnD;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,iBAWtE"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.main = main;
10
+ const sse_js_1 = require("@modelcontextprotocol/sdk/server/sse.js");
11
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
12
+ const express_1 = __importDefault(require("express"));
13
+ const console_logger_js_1 = require("../../console-logger.js");
14
+ const server_js_1 = require("../../server.js");
15
+ async function main(flags) {
16
+ switch (flags.transport) {
17
+ case "stdio":
18
+ await startStdio(flags);
19
+ break;
20
+ case "sse":
21
+ await startSSE(flags);
22
+ break;
23
+ default:
24
+ throw new Error(`Invalid transport: ${flags.transport}`);
25
+ }
26
+ }
27
+ async function startStdio(flags) {
28
+ const logger = (0, console_logger_js_1.createConsoleLogger)(flags["log-level"]);
29
+ const transport = new stdio_js_1.StdioServerTransport();
30
+ const server = (0, server_js_1.createMCPServer)({
31
+ logger,
32
+ scopes: flags.scope,
33
+ serverURL: flags["server-url"],
34
+ serverIdx: flags["server-index"],
35
+ });
36
+ await server.connect(transport);
37
+ const abort = async () => {
38
+ await server.close();
39
+ process.exit(0);
40
+ };
41
+ process.on("SIGTERM", abort);
42
+ process.on("SIGINT", abort);
43
+ }
44
+ async function startSSE(flags) {
45
+ const logger = (0, console_logger_js_1.createConsoleLogger)(flags["log-level"]);
46
+ const app = (0, express_1.default)();
47
+ const mcpServer = (0, server_js_1.createMCPServer)({
48
+ logger,
49
+ scopes: flags.scope,
50
+ serverURL: flags["server-url"],
51
+ serverIdx: flags["server-index"],
52
+ });
53
+ let transport;
54
+ const controller = new AbortController();
55
+ app.get("/sse", async (_req, res) => {
56
+ transport = new sse_js_1.SSEServerTransport("/message", res);
57
+ await mcpServer.connect(transport);
58
+ mcpServer.server.onclose = async () => {
59
+ res.end();
60
+ };
61
+ });
62
+ app.post("/message", async (req, res) => {
63
+ if (!transport) {
64
+ throw new Error("Server transport not initialized");
65
+ }
66
+ await transport.handlePostMessage(req, res);
67
+ });
68
+ const httpServer = app.listen(flags.port, "0.0.0.0", () => {
69
+ const ha = httpServer.address();
70
+ const host = typeof ha === "string" ? ha : `${ha?.address}:${ha?.port}`;
71
+ logger.info("MCP HTTP server started", { host });
72
+ });
73
+ let closing = false;
74
+ controller.signal.addEventListener("abort", async () => {
75
+ if (closing) {
76
+ logger.info("Received second signal. Forcing shutdown.");
77
+ process.exit(1);
78
+ }
79
+ closing = true;
80
+ logger.info("Shutting down MCP server");
81
+ await mcpServer.close();
82
+ logger.info("Shutting down HTTP server");
83
+ const timer = setTimeout(() => {
84
+ logger.info("Forcing shutdown");
85
+ process.exit(1);
86
+ }, 5000);
87
+ httpServer.close(() => {
88
+ clearTimeout(timer);
89
+ logger.info("Graceful shutdown complete");
90
+ process.exit(0);
91
+ });
92
+ });
93
+ const abort = () => controller.abort();
94
+ process.on("SIGTERM", abort);
95
+ process.on("SIGINT", abort);
96
+ }
97
+ //# sourceMappingURL=impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl.js","sourceRoot":"","sources":["../../../src/mcp-server/cli/start/impl.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAuBH,oBAWC;AAhCD,oEAA6E;AAC7E,wEAAiF;AACjF,sDAA8B;AAG9B,+DAGiC;AAEjC,+CAAkD;AAW3C,KAAK,UAAU,IAAI,CAAqB,KAAwB;IACrE,QAAQ,KAAK,CAAC,SAAS,EAAE,CAAC;QACxB,KAAK,OAAO;YACV,MAAM,UAAU,CAAC,KAAK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,EAAE;QACrD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;YACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,GAAG,IAAI,CAAC;QAEf,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAExC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;QAExB,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAEzC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE;YACpB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;YAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { CommandContext, StricliProcess } from "@stricli/core";
2
+ export interface LocalContext extends CommandContext {
3
+ readonly process: StricliProcess;
4
+ }
5
+ export declare function buildContext(process: NodeJS.Process): LocalContext;
6
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/mcp-server/cli.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,YAAY,CAElE"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildContext = buildContext;
7
+ function buildContext(process) {
8
+ return { process: process };
9
+ }
10
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/mcp-server/cli.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAQH,oCAEC;AAFD,SAAgB,YAAY,CAAC,OAAuB;IAClD,OAAO,EAAE,OAAO,EAAE,OAAyB,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const consoleLoggerLevels: readonly ["debug", "warning", "info", "error"];
2
+ export type ConsoleLoggerLevel = (typeof consoleLoggerLevels)[number];
3
+ export type ConsoleLogger = {
4
+ [key in ConsoleLoggerLevel]: (message: string, data?: Record<string, unknown>) => void;
5
+ };
6
+ export declare function createConsoleLogger(level: ConsoleLoggerLevel): ConsoleLogger;
7
+ //# sourceMappingURL=console-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console-logger.d.ts","sourceRoot":"","sources":["../src/mcp-server/console-logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,gDAKtB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,kBAAkB,GAAG,CAC3B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,IAAI;CACV,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAoB5E"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.consoleLoggerLevels = void 0;
7
+ exports.createConsoleLogger = createConsoleLogger;
8
+ exports.consoleLoggerLevels = [
9
+ "debug",
10
+ "warning",
11
+ "info",
12
+ "error",
13
+ ];
14
+ function createConsoleLogger(level) {
15
+ const min = exports.consoleLoggerLevels.indexOf(level);
16
+ const noop = () => { };
17
+ const logger = {
18
+ debug: noop,
19
+ warning: noop,
20
+ info: noop,
21
+ error: noop,
22
+ };
23
+ return exports.consoleLoggerLevels.reduce((logger, level, i) => {
24
+ if (i < min) {
25
+ return logger;
26
+ }
27
+ logger[level] = log.bind(null, level);
28
+ return logger;
29
+ }, logger);
30
+ }
31
+ function log(level, message, data) {
32
+ let line = "";
33
+ const allData = [{ msg: message, l: level }, data];
34
+ for (const ctx of allData) {
35
+ for (const [key, value] of Object.entries(ctx || {})) {
36
+ if (value == null) {
37
+ line += ` ${key}=<${value}>`;
38
+ }
39
+ else if (typeof value === "function") {
40
+ line += ` ${key}=<function>`;
41
+ }
42
+ else if (typeof value === "symbol") {
43
+ line += ` ${key}=${value.toString()}`;
44
+ }
45
+ else if (typeof value === "string") {
46
+ const v = value.search(/\s/g) >= 0 ? JSON.stringify(value) : value;
47
+ line += ` ${key}=${v}`;
48
+ }
49
+ else if (typeof value !== "object") {
50
+ line += ` ${key}=${value}`;
51
+ }
52
+ else {
53
+ line += ` ${key}="${JSON.stringify(value)}"`;
54
+ }
55
+ }
56
+ }
57
+ console.error(line);
58
+ }
59
+ //# sourceMappingURL=console-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console-logger.js","sourceRo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AC;YAC/B,CAAC;iBAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;gBACvC,IAAI,IAAI,IAAI,GAAG,aAAa,CAAC;YAC/B,CAAC;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACrC,IAAI,IAAI,IAAI,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;YACxC,CAAC;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACrC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;gBACnE,IAAI,IAAI,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;YACzB,CAAC;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACrC,IAAI,IAAI,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACN,IAAI,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const app: import("@stricli/core").Application<import("./cli.js").LocalContext>;
2
+ //# sourceMappingURL=mcp-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server/mcp-server.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,GAAG,sEAKd,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.app = void 0;
10
+ const core_1 = require("@stricli/core");
11
+ const node_process_1 = __importDefault(require("node:process"));
12
+ const cli_js_1 = require("./cli.js");
13
+ const command_js_1 = require("./cli/start/command.js");
14
+ const routes = (0, core_1.buildRouteMap)({
15
+ routes: {
16
+ start: command_js_1.startCommand,
17
+ },
18
+ docs: {
19
+ brief: "MCP server CLI",
20
+ },
21
+ });
22
+ exports.app = (0, core_1.buildApplication)(routes, {
23
+ name: "mcp",
24
+ versionInfo: {
25
+ currentVersion: "0.11.0",
26
+ },
27
+ });
28
+ (0, core_1.run)(exports.app, node_process_1.default.argv.slice(2), (0, cli_js_1.buildContext)(node_process_1.default));
29
+ //# sourceMappingURL=mcp-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server/mcp-server.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;AAEH,wCAAqE;AACrE,gEAAmC;AACnC,qCAAwC;AACxC,uDAAsD;AAEtD,MAAM,MAAM,GAAG,IAAA,oBAAa,EAAC;IAC3B,MAAM,EAAE;QACN,KAAK,EAAE,yBAAY;KACpB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,gBAAgB;KACxB;CACF,CAAC,CAAC;AAEU,QAAA,GAAG,GAAG,IAAA,uBAAgB,EAAC,MAAM,EAAE;IAC1C,IAAI,EAAE,KAAK;IACX,WAAW,EAAE;QACX,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC;AAEH,IAAA,UAAG,EAAC,WAAG,EAAE,sBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAA,qBAAY,EAAC,sBAAO,CAAC,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
3
+ import { Variables } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
4
+ import { ReadResourceResult } from "@modelcontextprotocol/sdk/types.js";
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { Result } from "../types/fp.js";
7
+ import { MCPScope } from "./scopes.js";
8
+ export type ReadResourceCallback = (client: GreenSecurityCore, uri: URL, extra: RequestHandlerExtra) => ReadResourceResult | Promise<ReadResourceResult>;
9
+ export type ResourceDefinition = {
10
+ name: string;
11
+ description: string;
12
+ scopes?: MCPScope[];
13
+ resource: string;
14
+ read: ReadResourceCallback;
15
+ };
16
+ export type ReadResourceTemplateCallback = (client: GreenSecurityCore, uri: URL, vars: Variables, extra: RequestHandlerExtra) => ReadResourceResult | Promise<ReadResourceResult>;
17
+ export type ResourceTemplateDefinition = {
18
+ name: string;
19
+ description: string;
20
+ scopes?: MCPScope[];
21
+ resource: ResourceTemplate;
22
+ read: ReadResourceTemplateCallback;
23
+ };
24
+ export declare function formatResult(result: Result<unknown, Error>, uri: URL, init: {
25
+ response?: Response | undefined;
26
+ }): Promise<ReadResourceResult>;
27
+ //# sourceMappingURL=resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/mcp-server/resources.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,MAAM,oBAAoB,GAAG,CACjC,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,mBAAmB,KACvB,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,oBAAoB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,CACzC,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,mBAAmB,KACvB,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEtD,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,IAAI,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAC9B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAE,GACxC,OAAO,CAAC,kBAAkB,CAAC,CAqC7B"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.formatResult = formatResult;
7
+ const shared_js_1 = require("./shared.js");
8
+ async function formatResult(result, uri, init) {
9
+ if (!result.ok) {
10
+ throw result.error;
11
+ }
12
+ const { value } = result;
13
+ if (typeof value === "undefined") {
14
+ return { contents: [] };
15
+ }
16
+ const { response } = init;
17
+ const mimeType = response?.headers.get("content-type") ?? "";
18
+ let contents = [];
19
+ if (mimeType.search(/\bjson\b/g)) {
20
+ contents = [{ uri: uri.toString(), mimeType, text: JSON.stringify(value) }];
21
+ }
22
+ else if (mimeType.startsWith("text/event-stream")
23
+ && (0, shared_js_1.isAsyncIterable)(value)) {
24
+ contents = [
25
+ {
26
+ uri: uri.toString(),
27
+ mimeType: "application/json",
28
+ text: await stringifySSEToJSON(value),
29
+ },
30
+ ];
31
+ }
32
+ else if (mimeType.startsWith("text/") && typeof value === "string") {
33
+ contents = [{ uri: uri.toString(), mimeType, text: value }];
34
+ }
35
+ else if ((0, shared_js_1.isBinaryData)(value)) {
36
+ const blob = await (0, shared_js_1.valueToBase64)(value);
37
+ contents = blob == null ? [] : [{ uri: uri.toString(), blob, mimeType }];
38
+ }
39
+ else {
40
+ throw new Error(`Unsupported content type: "${mimeType}"`);
41
+ }
42
+ return { contents };
43
+ }
44
+ async function stringifySSEToJSON(value) {
45
+ const payloads = [];
46
+ for await (const chunk of value) {
47
+ payloads.push(chunk);
48
+ }
49
+ return JSON.stringify(payloads);
50
+ }
51
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/mcp-server/resources.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAwCH,oCAyCC;AAxED,2CAA2E;AA+BpE,KAAK,UAAU,YAAY,CAChC,MAA8B,EAC9B,GAAQ,EACR,IAAyC;IAEzC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,MAAM,CAAC,KAAK,CAAC;IACrB,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IACzB,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC1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AG,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AACtB,CAAC;AAED,KAAK,UAAU,kBAAkB,CAC/B,KAA6B;IAE7B,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const mcpScopes: readonly [];
2
+ export type MCPScope = (typeof mcpScopes)[number];
3
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/mcp-server/scopes.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,aAAc,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.mcpScopes = void 0;
7
+ exports.mcpScopes = [];
8
+ //# sourceMappingURL=scopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.js","sourceRoot":"","sources":["../src/mcp-server/scopes.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEU,QAAA,SAAS,GAAG,EAAW,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { SDKOptions } from "../lib/config.js";
3
+ import type { ConsoleLogger } from "./console-logger.js";
4
+ import { MCPScope } from "./scopes.js";
5
+ export declare function createMCPServer(deps: {
6
+ logger: ConsoleLogger;
7
+ scopes?: MCPScope[] | undefined;
8
+ serverURL?: string | undefined;
9
+ serverIdx?: SDKOptions["serverIdx"];
10
+ }): McpServer;
11
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/mcp-server/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAa,MAAM,aAAa,CAAC;AAalD,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACrC,aAyBA"}