easy-mcp-nest 0.2.0 → 0.3.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 (98) hide show
  1. package/README.md +166 -8
  2. package/dist/adapters/express/express-adapter.d.ts +3 -0
  3. package/dist/adapters/express/express-adapter.js +125 -0
  4. package/dist/adapters/express/express-adapter.js.map +1 -0
  5. package/dist/adapters/express/http-gateway.service.d.ts +13 -0
  6. package/dist/adapters/express/http-gateway.service.js +102 -0
  7. package/dist/adapters/express/http-gateway.service.js.map +1 -0
  8. package/dist/adapters/express/index.d.ts +3 -0
  9. package/dist/adapters/express/index.js +8 -0
  10. package/dist/adapters/express/index.js.map +1 -0
  11. package/dist/adapters/express/types.d.ts +15 -0
  12. package/dist/adapters/express/types.js +3 -0
  13. package/dist/adapters/express/types.js.map +1 -0
  14. package/dist/app.module.js +2 -0
  15. package/dist/app.module.js.map +1 -1
  16. package/dist/auth/oauth/index.d.ts +3 -0
  17. package/dist/auth/oauth/index.js +8 -0
  18. package/dist/auth/oauth/index.js.map +1 -0
  19. package/dist/auth/oauth/oauth-config.interface.d.ts +12 -0
  20. package/dist/auth/oauth/oauth-config.interface.js +3 -0
  21. package/dist/auth/oauth/oauth-config.interface.js.map +1 -0
  22. package/dist/auth/oauth/oauth-middleware.d.ts +3 -0
  23. package/dist/auth/oauth/oauth-middleware.js +54 -0
  24. package/dist/auth/oauth/oauth-middleware.js.map +1 -0
  25. package/dist/auth/oauth/oauth-provider.service.d.ts +8 -0
  26. package/dist/auth/oauth/oauth-provider.service.js +63 -0
  27. package/dist/auth/oauth/oauth-provider.service.js.map +1 -0
  28. package/dist/config/mcp-config.interface.d.ts +1 -1
  29. package/dist/core/context/context-provider.service.d.ts +8 -0
  30. package/dist/core/context/context-provider.service.js +55 -0
  31. package/dist/core/context/context-provider.service.js.map +1 -0
  32. package/dist/core/context/mcp-context.interface.d.ts +12 -0
  33. package/dist/core/context/mcp-context.interface.js +3 -0
  34. package/dist/core/context/mcp-context.interface.js.map +1 -0
  35. package/dist/core/mcp-server/mcp-server.service.d.ts +3 -1
  36. package/dist/core/mcp-server/mcp-server.service.js +33 -16
  37. package/dist/core/mcp-server/mcp-server.service.js.map +1 -1
  38. package/dist/core/utils/sanitize.util.d.ts +1 -0
  39. package/dist/core/utils/sanitize.util.js +29 -0
  40. package/dist/core/utils/sanitize.util.js.map +1 -1
  41. package/dist/core/utils/tool-naming-validator.js +16 -0
  42. package/dist/core/utils/tool-naming-validator.js.map +1 -1
  43. package/dist/decorators/factory-provider.d.ts +2 -0
  44. package/dist/decorators/factory-provider.js +20 -0
  45. package/dist/decorators/factory-provider.js.map +1 -0
  46. package/dist/decorators/index.d.ts +4 -0
  47. package/dist/decorators/index.js +17 -0
  48. package/dist/decorators/index.js.map +1 -0
  49. package/dist/decorators/mcp-context.decorator.d.ts +3 -0
  50. package/dist/decorators/mcp-context.decorator.js +20 -0
  51. package/dist/decorators/mcp-context.decorator.js.map +1 -0
  52. package/dist/decorators/mcp-param.decorator.d.ts +10 -0
  53. package/dist/decorators/mcp-param.decorator.js +41 -0
  54. package/dist/decorators/mcp-param.decorator.js.map +1 -0
  55. package/dist/decorators/mcp-service.decorator.d.ts +6 -0
  56. package/dist/decorators/mcp-service.decorator.js +27 -0
  57. package/dist/decorators/mcp-service.decorator.js.map +1 -0
  58. package/dist/index.d.ts +12 -0
  59. package/dist/index.js +29 -1
  60. package/dist/index.js.map +1 -1
  61. package/dist/interface/jsonrpc.interface.d.ts +8 -0
  62. package/dist/interface/jsonrpc.interface.js.map +1 -1
  63. package/dist/standalone/core-services.d.ts +29 -0
  64. package/dist/standalone/core-services.js +94 -0
  65. package/dist/standalone/core-services.js.map +1 -0
  66. package/dist/standalone/index.d.ts +3 -0
  67. package/dist/standalone/index.js +11 -0
  68. package/dist/standalone/index.js.map +1 -0
  69. package/dist/standalone/standalone-server.d.ts +23 -0
  70. package/dist/standalone/standalone-server.js +366 -0
  71. package/dist/standalone/standalone-server.js.map +1 -0
  72. package/dist/standalone/types.d.ts +14 -0
  73. package/dist/standalone/types.js +3 -0
  74. package/dist/standalone/types.js.map +1 -0
  75. package/dist/testing/index.d.ts +3 -0
  76. package/dist/testing/index.js +14 -0
  77. package/dist/testing/index.js.map +1 -0
  78. package/dist/testing/mock-context.d.ts +2 -0
  79. package/dist/testing/mock-context.js +17 -0
  80. package/dist/testing/mock-context.js.map +1 -0
  81. package/dist/testing/test-app.factory.d.ts +15 -0
  82. package/dist/testing/test-app.factory.js +37 -0
  83. package/dist/testing/test-app.factory.js.map +1 -0
  84. package/dist/testing/test-helpers.d.ts +10 -0
  85. package/dist/testing/test-helpers.js +46 -0
  86. package/dist/testing/test-helpers.js.map +1 -0
  87. package/dist/tooling/tool-registry/tool-registry.service.d.ts +1 -1
  88. package/dist/tooling/tool-registry/tool-registry.service.js +2 -2
  89. package/dist/tooling/tool-registry/tool-registry.service.js.map +1 -1
  90. package/dist/tooling/tool.interface.d.ts +3 -2
  91. package/dist/tsconfig.build.tsbuildinfo +1 -1
  92. package/dist/validation/index.d.ts +1 -0
  93. package/dist/validation/index.js +8 -0
  94. package/dist/validation/index.js.map +1 -0
  95. package/dist/validation/zod-integration.d.ts +11 -0
  96. package/dist/validation/zod-integration.js +148 -0
  97. package/dist/validation/zod-integration.js.map +1 -0
  98. package/package.json +4 -2
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.McpContext = McpContext;
4
+ exports.getContextParameterIndices = getContextParameterIndices;
5
+ require("reflect-metadata");
6
+ const MCP_CONTEXT_METADATA_KEY = Symbol("mcp:context");
7
+ function McpContext() {
8
+ return (target, propertyKey, parameterIndex) => {
9
+ if (propertyKey === undefined) {
10
+ return;
11
+ }
12
+ const existingContextParams = Reflect.getMetadata(MCP_CONTEXT_METADATA_KEY, target, propertyKey) || [];
13
+ existingContextParams.push(parameterIndex);
14
+ Reflect.defineMetadata(MCP_CONTEXT_METADATA_KEY, existingContextParams, target, propertyKey);
15
+ };
16
+ }
17
+ function getContextParameterIndices(target, propertyKey) {
18
+ return Reflect.getMetadata(MCP_CONTEXT_METADATA_KEY, target, propertyKey) || [];
19
+ }
20
+ //# sourceMappingURL=mcp-context.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-context.decorator.js","sourceRoot":"","sources":["../../src/decorators/mcp-context.decorator.ts"],"names":[],"mappings":";;AAqBA,gCAaC;AAMD,gEAKC;AA7CD,4BAA0B;AAK1B,MAAM,wBAAwB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAgBvD,SAAgB,UAAU;IACxB,OAAO,CAAC,MAAW,EAAE,WAAwC,EAAE,cAAsB,EAAE,EAAE;QACvF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO;QACT,CAAC;QAGD,MAAM,qBAAqB,GACzB,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;QAE3E,qBAAqB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3C,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAC/F,CAAC,CAAC;AACJ,CAAC;AAMD,SAAgB,0BAA0B,CACxC,MAAW,EACX,WAA4B;IAE5B,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;AAClF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import "reflect-metadata";
2
+ import { z } from "zod";
3
+ export declare function McpParam<T extends z.ZodTypeAny>(schema: T): ParameterDecorator;
4
+ export declare function getParamSchema(target: any, propertyKey: string | symbol, parameterIndex: number): z.ZodTypeAny | undefined;
5
+ export declare function getAllParamSchemas(target: any, propertyKey: string | symbol): Map<number, z.ZodTypeAny>;
6
+ export declare function getParamSchemasAsJsonSchema(target: any, propertyKey: string | symbol): {
7
+ type: "object";
8
+ properties?: Record<string, any>;
9
+ required?: string[];
10
+ } | null;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.McpParam = McpParam;
4
+ exports.getParamSchema = getParamSchema;
5
+ exports.getAllParamSchemas = getAllParamSchemas;
6
+ exports.getParamSchemasAsJsonSchema = getParamSchemasAsJsonSchema;
7
+ require("reflect-metadata");
8
+ const zod_integration_1 = require("../validation/zod-integration");
9
+ const MCP_PARAM_SCHEMA_METADATA_KEY = Symbol("mcp:param:schema");
10
+ const MCP_PARAM_INDEX_METADATA_KEY = Symbol("mcp:param:index");
11
+ function McpParam(schema) {
12
+ return (target, propertyKey, parameterIndex) => {
13
+ if (propertyKey === undefined) {
14
+ return;
15
+ }
16
+ const existingSchemas = Reflect.getMetadata(MCP_PARAM_SCHEMA_METADATA_KEY, target, propertyKey) || new Map();
17
+ existingSchemas.set(parameterIndex, schema);
18
+ Reflect.defineMetadata(MCP_PARAM_SCHEMA_METADATA_KEY, existingSchemas, target, propertyKey);
19
+ const existingIndices = Reflect.getMetadata(MCP_PARAM_INDEX_METADATA_KEY, target, propertyKey) || [];
20
+ if (!existingIndices.includes(parameterIndex)) {
21
+ existingIndices.push(parameterIndex);
22
+ Reflect.defineMetadata(MCP_PARAM_INDEX_METADATA_KEY, existingIndices, target, propertyKey);
23
+ }
24
+ };
25
+ }
26
+ function getParamSchema(target, propertyKey, parameterIndex) {
27
+ const schemas = Reflect.getMetadata(MCP_PARAM_SCHEMA_METADATA_KEY, target, propertyKey) || new Map();
28
+ return schemas.get(parameterIndex);
29
+ }
30
+ function getAllParamSchemas(target, propertyKey) {
31
+ return Reflect.getMetadata(MCP_PARAM_SCHEMA_METADATA_KEY, target, propertyKey) || new Map();
32
+ }
33
+ function getParamSchemasAsJsonSchema(target, propertyKey) {
34
+ const schemas = getAllParamSchemas(target, propertyKey);
35
+ const paramsSchema = schemas.get(0);
36
+ if (!paramsSchema) {
37
+ return null;
38
+ }
39
+ return (0, zod_integration_1.zodToJsonSchema)(paramsSchema);
40
+ }
41
+ //# sourceMappingURL=mcp-param.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-param.decorator.js","sourceRoot":"","sources":["../../src/decorators/mcp-param.decorator.ts"],"names":[],"mappings":";;AA+BA,4BAsBC;AAMD,wCAQC;AAMD,gDAKC;AAMD,kEAgBC;AApGD,4BAA0B;AAE1B,mEAAgE;AAKhE,MAAM,6BAA6B,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACjE,MAAM,4BAA4B,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAuB/D,SAAgB,QAAQ,CAAyB,MAAS;IACxD,OAAO,CAAC,MAAW,EAAE,WAAwC,EAAE,cAAsB,EAAE,EAAE;QACvF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO;QACT,CAAC;QAGD,MAAM,eAAe,GACnB,OAAO,CAAC,WAAW,CAAC,6BAA6B,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;QAEvF,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC5C,OAAO,CAAC,cAAc,CAAC,6BAA6B,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAG5F,MAAM,eAAe,GACnB,OAAO,CAAC,WAAW,CAAC,4BAA4B,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;QAE/E,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YAC9C,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACrC,OAAO,CAAC,cAAc,CAAC,4BAA4B,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAMD,SAAgB,cAAc,CAC5B,MAAW,EACX,WAA4B,EAC5B,cAAsB;IAEtB,MAAM,OAAO,GACX,OAAO,CAAC,WAAW,CAAC,6BAA6B,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;IACvF,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACrC,CAAC;AAMD,SAAgB,kBAAkB,CAChC,MAAW,EACX,WAA4B;IAE5B,OAAO,OAAO,CAAC,WAAW,CAAC,6BAA6B,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;AAC9F,CAAC;AAMD,SAAgB,2BAA2B,CACzC,MAAW,EACX,WAA4B;IAE5B,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAIxD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,OAAO,IAAA,iCAAe,EAAC,YAAY,CAA8E,CAAC;AACpH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import "reflect-metadata";
2
+ export declare function McpService<T = any>(factory: () => T): ParameterDecorator;
3
+ export declare function getServiceFactories(target: any, propertyKey?: string | symbol): Array<{
4
+ index: number;
5
+ factory: () => any;
6
+ }>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.McpService = McpService;
4
+ exports.getServiceFactories = getServiceFactories;
5
+ require("reflect-metadata");
6
+ const MCP_SERVICE_FACTORY_METADATA_KEY = Symbol("mcp:service:factory");
7
+ function McpService(factory) {
8
+ return (target, propertyKey, parameterIndex) => {
9
+ if (propertyKey !== undefined) {
10
+ const existingFactories = Reflect.getMetadata(MCP_SERVICE_FACTORY_METADATA_KEY, target, propertyKey) || [];
11
+ existingFactories.push({ index: parameterIndex, factory });
12
+ Reflect.defineMetadata(MCP_SERVICE_FACTORY_METADATA_KEY, existingFactories, target, propertyKey);
13
+ }
14
+ else {
15
+ const existingFactories = Reflect.getMetadata(MCP_SERVICE_FACTORY_METADATA_KEY, target) || [];
16
+ existingFactories.push({ index: parameterIndex, factory });
17
+ Reflect.defineMetadata(MCP_SERVICE_FACTORY_METADATA_KEY, existingFactories, target);
18
+ }
19
+ };
20
+ }
21
+ function getServiceFactories(target, propertyKey) {
22
+ if (propertyKey !== undefined) {
23
+ return Reflect.getMetadata(MCP_SERVICE_FACTORY_METADATA_KEY, target, propertyKey) || [];
24
+ }
25
+ return Reflect.getMetadata(MCP_SERVICE_FACTORY_METADATA_KEY, target) || [];
26
+ }
27
+ //# sourceMappingURL=mcp-service.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-service.decorator.js","sourceRoot":"","sources":["../../src/decorators/mcp-service.decorator.ts"],"names":[],"mappings":";;AAuBA,gCAkBC;AAMD,kDAQC;AAvDD,4BAA0B;AAK1B,MAAM,gCAAgC,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAkBvE,SAAgB,UAAU,CAAU,OAAgB;IAClD,OAAO,CAAC,MAAW,EAAE,WAAwC,EAAE,cAAsB,EAAE,EAAE;QACvF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAE9B,MAAM,iBAAiB,GACrB,OAAO,CAAC,WAAW,CAAC,gCAAgC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;YAEnF,iBAAiB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;YAC3D,OAAO,CAAC,cAAc,CAAC,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACnG,CAAC;aAAM,CAAC;YAEN,MAAM,iBAAiB,GACrB,OAAO,CAAC,WAAW,CAAC,gCAAgC,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;YAEtE,iBAAiB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;YAC3D,OAAO,CAAC,cAAc,CAAC,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;QACtF,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAMD,SAAgB,mBAAmB,CACjC,MAAW,EACX,WAA6B;IAE7B,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,WAAW,CAAC,gCAAgC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;IAC1F,CAAC;IACD,OAAO,OAAO,CAAC,WAAW,CAAC,gCAAgC,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AAC7E,CAAC"}
package/dist/index.d.ts CHANGED
@@ -7,5 +7,17 @@ export type { InitializeParams, InitializeResult, ListToolsResult, McpTool, Call
7
7
  export { McpErrorCode } from './interface/mcp-protocol.interface';
8
8
  export type { ToolDefinition, ToolParameter, ToolFunction, } from './tooling/tool.interface';
9
9
  export { EasyMcpError, ConfigurationError, ToolExecutionError, ToolNotFoundError, } from './core/errors/easy-mcp-error';
10
+ export { ToolNamingValidator } from './core/utils/tool-naming-validator';
10
11
  export { INTERFACE_LAYER_TOKEN } from './config/constants';
11
12
  export { VERSION, PACKAGE_NAME, getVersion, getPackageName } from './config/version';
13
+ export type { McpContext } from './core/context/mcp-context.interface';
14
+ export { McpContext as McpContextDecorator, McpService, createFactoryProvider, McpParam } from './decorators';
15
+ export { zodToJsonSchema, validateWithZod, safeValidateWithZod } from './validation';
16
+ export { createMcpExpressRouter } from './adapters/express';
17
+ export type { CreateMcpExpressRouterOptions, McpAuthMiddleware } from './adapters/express';
18
+ export { OAuthProviderService, createOAuthMiddleware } from './auth/oauth';
19
+ export type { OAuthProviderConfig, OAuthConfig, OAuthTokenValidator, OAuthContextExtractor } from './auth/oauth';
20
+ export { createMcpServer, StandaloneMcpServer } from './standalone';
21
+ export type { CreateMcpServerOptions, StandaloneTransport, StandaloneAuthFunction } from './standalone';
22
+ export { createMcpTestApp, McpTestApp, mockMcpContext } from './testing';
23
+ export { createMockJsonRpcRequest, createMockTool, wait, createMockCancellationToken } from './testing';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPackageName = exports.getVersion = exports.PACKAGE_NAME = exports.VERSION = exports.INTERFACE_LAYER_TOKEN = exports.ToolNotFoundError = exports.ToolExecutionError = exports.ConfigurationError = exports.EasyMcpError = exports.McpErrorCode = exports.JsonRpcErrorCode = exports.EasyMCP = void 0;
3
+ exports.createMockCancellationToken = exports.wait = exports.createMockTool = exports.createMockJsonRpcRequest = exports.mockMcpContext = exports.McpTestApp = exports.createMcpTestApp = exports.StandaloneMcpServer = exports.createMcpServer = exports.createOAuthMiddleware = exports.OAuthProviderService = exports.createMcpExpressRouter = exports.safeValidateWithZod = exports.validateWithZod = exports.zodToJsonSchema = exports.McpParam = exports.createFactoryProvider = exports.McpService = exports.McpContextDecorator = exports.getPackageName = exports.getVersion = exports.PACKAGE_NAME = exports.VERSION = exports.INTERFACE_LAYER_TOKEN = exports.ToolNamingValidator = exports.ToolNotFoundError = exports.ToolExecutionError = exports.ConfigurationError = exports.EasyMcpError = exports.McpErrorCode = exports.JsonRpcErrorCode = exports.EasyMCP = void 0;
4
4
  var EasyMCP_1 = require("./EasyMCP");
5
5
  Object.defineProperty(exports, "EasyMCP", { enumerable: true, get: function () { return EasyMCP_1.EasyMCP; } });
6
6
  var jsonrpc_interface_1 = require("./interface/jsonrpc.interface");
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "EasyMcpError", { enumerable: true, get: function
12
12
  Object.defineProperty(exports, "ConfigurationError", { enumerable: true, get: function () { return easy_mcp_error_1.ConfigurationError; } });
13
13
  Object.defineProperty(exports, "ToolExecutionError", { enumerable: true, get: function () { return easy_mcp_error_1.ToolExecutionError; } });
14
14
  Object.defineProperty(exports, "ToolNotFoundError", { enumerable: true, get: function () { return easy_mcp_error_1.ToolNotFoundError; } });
15
+ var tool_naming_validator_1 = require("./core/utils/tool-naming-validator");
16
+ Object.defineProperty(exports, "ToolNamingValidator", { enumerable: true, get: function () { return tool_naming_validator_1.ToolNamingValidator; } });
15
17
  var constants_1 = require("./config/constants");
16
18
  Object.defineProperty(exports, "INTERFACE_LAYER_TOKEN", { enumerable: true, get: function () { return constants_1.INTERFACE_LAYER_TOKEN; } });
17
19
  var version_1 = require("./config/version");
@@ -19,4 +21,30 @@ Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () {
19
21
  Object.defineProperty(exports, "PACKAGE_NAME", { enumerable: true, get: function () { return version_1.PACKAGE_NAME; } });
20
22
  Object.defineProperty(exports, "getVersion", { enumerable: true, get: function () { return version_1.getVersion; } });
21
23
  Object.defineProperty(exports, "getPackageName", { enumerable: true, get: function () { return version_1.getPackageName; } });
24
+ var decorators_1 = require("./decorators");
25
+ Object.defineProperty(exports, "McpContextDecorator", { enumerable: true, get: function () { return decorators_1.McpContext; } });
26
+ Object.defineProperty(exports, "McpService", { enumerable: true, get: function () { return decorators_1.McpService; } });
27
+ Object.defineProperty(exports, "createFactoryProvider", { enumerable: true, get: function () { return decorators_1.createFactoryProvider; } });
28
+ Object.defineProperty(exports, "McpParam", { enumerable: true, get: function () { return decorators_1.McpParam; } });
29
+ var validation_1 = require("./validation");
30
+ Object.defineProperty(exports, "zodToJsonSchema", { enumerable: true, get: function () { return validation_1.zodToJsonSchema; } });
31
+ Object.defineProperty(exports, "validateWithZod", { enumerable: true, get: function () { return validation_1.validateWithZod; } });
32
+ Object.defineProperty(exports, "safeValidateWithZod", { enumerable: true, get: function () { return validation_1.safeValidateWithZod; } });
33
+ var express_1 = require("./adapters/express");
34
+ Object.defineProperty(exports, "createMcpExpressRouter", { enumerable: true, get: function () { return express_1.createMcpExpressRouter; } });
35
+ var oauth_1 = require("./auth/oauth");
36
+ Object.defineProperty(exports, "OAuthProviderService", { enumerable: true, get: function () { return oauth_1.OAuthProviderService; } });
37
+ Object.defineProperty(exports, "createOAuthMiddleware", { enumerable: true, get: function () { return oauth_1.createOAuthMiddleware; } });
38
+ var standalone_1 = require("./standalone");
39
+ Object.defineProperty(exports, "createMcpServer", { enumerable: true, get: function () { return standalone_1.createMcpServer; } });
40
+ Object.defineProperty(exports, "StandaloneMcpServer", { enumerable: true, get: function () { return standalone_1.StandaloneMcpServer; } });
41
+ var testing_1 = require("./testing");
42
+ Object.defineProperty(exports, "createMcpTestApp", { enumerable: true, get: function () { return testing_1.createMcpTestApp; } });
43
+ Object.defineProperty(exports, "McpTestApp", { enumerable: true, get: function () { return testing_1.McpTestApp; } });
44
+ Object.defineProperty(exports, "mockMcpContext", { enumerable: true, get: function () { return testing_1.mockMcpContext; } });
45
+ var testing_2 = require("./testing");
46
+ Object.defineProperty(exports, "createMockJsonRpcRequest", { enumerable: true, get: function () { return testing_2.createMockJsonRpcRequest; } });
47
+ Object.defineProperty(exports, "createMockTool", { enumerable: true, get: function () { return testing_2.createMockTool; } });
48
+ Object.defineProperty(exports, "wait", { enumerable: true, get: function () { return testing_2.wait; } });
49
+ Object.defineProperty(exports, "createMockCancellationToken", { enumerable: true, get: function () { return testing_2.createMockCancellationToken; } });
22
50
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAmBhB,mEAAiE;AAAxD,qHAAA,gBAAgB,OAAA;AAYzB,6EAAkE;AAAzD,sHAAA,YAAY,OAAA;AAUrB,+DAKsC;AAJpC,8GAAA,YAAY,OAAA;AACZ,oHAAA,kBAAkB,OAAA;AAClB,oHAAA,kBAAkB,OAAA;AAClB,mHAAA,iBAAiB,OAAA;AAInB,gDAA2D;AAAlD,kHAAA,qBAAqB,OAAA;AAG9B,4CAAqF;AAA5E,k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OAAA"}
@@ -3,6 +3,14 @@ export interface JsonRpcRequest {
3
3
  id: string | number | null;
4
4
  method: string;
5
5
  params?: any;
6
+ metadata?: {
7
+ userId?: string;
8
+ scopes?: string[];
9
+ buildingIds?: string[];
10
+ sessionId?: string;
11
+ metadata?: Record<string, any>;
12
+ [key: string]: any;
13
+ };
6
14
  }
7
15
  export interface JsonRpcResponse {
8
16
  jsonrpc: "2.0";
@@ -1 +1 @@
1
- {"version":3,"file":"jsonrpc.interface.js","sourceRoot":"","sources":["../../src/interface/jsonrpc.interface.ts"],"names":[],"mappings":";;;AA2CA,sDAUC;AAKD,oDASC;AAKD,gDAeC;AAvDD,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,wEAAmB,CAAA;IACnB,gFAAuB,CAAA;IACvB,gFAAuB,CAAA;IACvB,8EAAsB,CAAA;IACtB,8EAAsB,CAAA;AACxB,CAAC,EANW,gBAAgB,gCAAhB,gBAAgB,QAM3B;AAKD,SAAgB,qBAAqB,CAAC,GAAQ;IAC5C,OAAO,CACL,GAAG;QACH,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,CAAC,OAAO,KAAK,KAAK;QACrB,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ;QAC9B,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI;YACd,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ;YAC1B,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,CAAC,CAC9B,CAAC;AACJ,CAAC;AAKD,SAAgB,oBAAoB,CAClC,EAA0B,EAC1B,MAAW;IAEX,OAAO;QACL,OAAO,EAAE,KAAK;QACd,EAAE;QACF,MAAM;KACP,CAAC;AACJ,CAAC;AAKD,SAAgB,kBAAkB,CAChC,EAA0B,EAC1B,IAAY,EACZ,OAAe,EACf,IAAU;IAEV,OAAO;QACL,OAAO,EAAE,KAAK;QACd,EAAE;QACF,KAAK,EAAE;YACL,IAAI;YACJ,OAAO;YACP,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC;SACpC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"jsonrpc.interface.js","sourceRoot":"","sources":["../../src/interface/jsonrpc.interface.ts"],"names":[],"mappings":";;;AAoDA,sDAUC;AAKD,oDASC;AAKD,gDAeC;AAvDD,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,wEAAmB,CAAA;IACnB,gFAAuB,CAAA;IACvB,gFAAuB,CAAA;IACvB,8EAAsB,CAAA;IACtB,8EAAsB,CAAA;AACxB,CAAC,EANW,gBAAgB,gCAAhB,gBAAgB,QAM3B;AAKD,SAAgB,qBAAqB,CAAC,GAAQ;IAC5C,OAAO,CACL,GAAG;QACH,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,CAAC,OAAO,KAAK,KAAK;QACrB,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ;QAC9B,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI;YACd,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ;YAC1B,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,CAAC,CAC9B,CAAC;AACJ,CAAC;AAKD,SAAgB,oBAAoB,CAClC,EAA0B,EAC1B,MAAW;IAEX,OAAO;QACL,OAAO,EAAE,KAAK;QACd,EAAE;QACF,MAAM;KACP,CAAC;AACJ,CAAC;AAKD,SAAgB,kBAAkB,CAChC,EAA0B,EAC1B,IAAY,EACZ,OAAe,EACf,IAAU;IAEV,OAAO;QACL,OAAO,EAAE,KAAK;QACd,EAAE;QACF,KAAK,EAAE;YACL,IAAI;YACJ,OAAO;YACP,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC;SACpC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { ToolDefinition, CancellationToken } from "../tooling/tool.interface";
2
+ import { ToolRegistrationInput, ResourceRegistrationInput, PromptRegistrationInput } from "../config/mcp-config.interface";
3
+ import { McpContext } from "../core/context/mcp-context.interface";
4
+ export declare class StandaloneToolRegistry {
5
+ private readonly registry;
6
+ registerTool(toolInput: ToolRegistrationInput): void;
7
+ getTool(name: string): ToolDefinition | undefined;
8
+ executeTool(name: string, args: Record<string, any>, cancellationToken?: CancellationToken, context?: McpContext): Promise<any>;
9
+ getToolSchemasForLLM(): Array<{
10
+ type: "function";
11
+ function: {
12
+ name: string;
13
+ description: string;
14
+ parameters: any;
15
+ };
16
+ }>;
17
+ }
18
+ export declare class StandaloneResourceRegistry {
19
+ private readonly registry;
20
+ registerResource(resource: ResourceRegistrationInput): void;
21
+ getResource(uri: string): ResourceRegistrationInput | undefined;
22
+ getAllResources(): ResourceRegistrationInput[];
23
+ }
24
+ export declare class StandalonePromptRegistry {
25
+ private readonly registry;
26
+ registerPrompt(prompt: PromptRegistrationInput): void;
27
+ getPrompt(name: string): PromptRegistrationInput | undefined;
28
+ getAllPrompts(): PromptRegistrationInput[];
29
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StandalonePromptRegistry = exports.StandaloneResourceRegistry = exports.StandaloneToolRegistry = void 0;
4
+ const easy_mcp_error_1 = require("../core/errors/easy-mcp-error");
5
+ const schema_validator_1 = require("../core/utils/schema-validator");
6
+ const logger_util_1 = require("../core/utils/logger.util");
7
+ class StandaloneToolRegistry {
8
+ registry = new Map();
9
+ registerTool(toolInput) {
10
+ if (this.registry.has(toolInput.name)) {
11
+ throw new Error(`Tool name '${toolInput.name}' already registered.`);
12
+ }
13
+ if (toolInput.inputSchema.type !== "object") {
14
+ throw new Error(`Tool '${toolInput.name}': inputSchema.type must be "object" for tool definitions`);
15
+ }
16
+ const toolDefinition = {
17
+ name: toolInput.name,
18
+ description: toolInput.description,
19
+ execute: toolInput.function,
20
+ inputSchema: toolInput.inputSchema,
21
+ icon: toolInput.icon,
22
+ };
23
+ this.registry.set(toolInput.name, toolDefinition);
24
+ logger_util_1.logger.info("StandaloneToolRegistry", `Tool registered: ${toolInput.name}`, {
25
+ component: "Standalone",
26
+ toolName: toolInput.name,
27
+ });
28
+ }
29
+ getTool(name) {
30
+ return this.registry.get(name);
31
+ }
32
+ async executeTool(name, args, cancellationToken, context) {
33
+ const tool = this.getTool(name);
34
+ if (!tool) {
35
+ throw new easy_mcp_error_1.ToolNotFoundError(name);
36
+ }
37
+ const validationError = (0, schema_validator_1.validateToolArguments)(args, tool.inputSchema);
38
+ if (validationError) {
39
+ throw new easy_mcp_error_1.ToolExecutionError(`Tool '${name}' validation failed: ${validationError}`, name);
40
+ }
41
+ try {
42
+ const result = await tool.execute(args, cancellationToken, context);
43
+ return result;
44
+ }
45
+ catch (error) {
46
+ const errorMessage = error instanceof Error ? error.message : String(error);
47
+ throw new easy_mcp_error_1.ToolExecutionError(`Tool '${name}' execution failed: ${errorMessage}`, name, error instanceof Error ? error : undefined);
48
+ }
49
+ }
50
+ getToolSchemasForLLM() {
51
+ return Array.from(this.registry.values()).map((tool) => ({
52
+ type: "function",
53
+ function: {
54
+ name: tool.name,
55
+ description: tool.description,
56
+ parameters: tool.inputSchema,
57
+ },
58
+ }));
59
+ }
60
+ }
61
+ exports.StandaloneToolRegistry = StandaloneToolRegistry;
62
+ class StandaloneResourceRegistry {
63
+ registry = new Map();
64
+ registerResource(resource) {
65
+ if (this.registry.has(resource.uri)) {
66
+ throw new Error(`Resource URI '${resource.uri}' already registered.`);
67
+ }
68
+ this.registry.set(resource.uri, resource);
69
+ }
70
+ getResource(uri) {
71
+ return this.registry.get(uri);
72
+ }
73
+ getAllResources() {
74
+ return Array.from(this.registry.values());
75
+ }
76
+ }
77
+ exports.StandaloneResourceRegistry = StandaloneResourceRegistry;
78
+ class StandalonePromptRegistry {
79
+ registry = new Map();
80
+ registerPrompt(prompt) {
81
+ if (this.registry.has(prompt.name)) {
82
+ throw new Error(`Prompt name '${prompt.name}' already registered.`);
83
+ }
84
+ this.registry.set(prompt.name, prompt);
85
+ }
86
+ getPrompt(name) {
87
+ return this.registry.get(name);
88
+ }
89
+ getAllPrompts() {
90
+ return Array.from(this.registry.values());
91
+ }
92
+ }
93
+ exports.StandalonePromptRegistry = StandalonePromptRegistry;
94
+ //# sourceMappingURL=core-services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-services.js","sourceRoot":"","sources":["../../src/standalone/core-services.ts"],"names":[],"mappings":";;;AAEA,kEAAsF;AAEtF,qEAAuE;AACvE,2DAAmD;AAKnD,MAAa,sBAAsB;IAChB,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;IAK9D,YAAY,CAAC,SAAgC;QAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,CAAC,IAAI,uBAAuB,CAAC,CAAC;QACvE,CAAC;QAGD,IAAI,SAAS,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,SAAS,SAAS,CAAC,IAAI,2DAA2D,CAAC,CAAC;QACtG,CAAC;QAED,MAAM,cAAc,GAAmB;YACrC,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,WAAW,EAAE,SAAS,CAAC,WAAW;YAClC,OAAO,EAAE,SAAS,CAAC,QAAQ;YAC3B,WAAW,EAAE,SAAS,CAAC,WAKtB;YACD,IAAI,EAAE,SAAS,CAAC,IAAI;SACrB,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAClD,oBAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,SAAS,CAAC,IAAI,EAAE,EAAE;YAC1E,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,SAAS,CAAC,IAAI;SACzB,CAAC,CAAC;IACL,CAAC;IAKD,OAAO,CAAC,IAAY;QAClB,OAAO,IAAI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ACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AA1BD,4DA0BC"}
@@ -0,0 +1,3 @@
1
+ export { createMcpServer, StandaloneMcpServer } from "./standalone-server";
2
+ export type { CreateMcpServerOptions, StandaloneTransport, StandaloneAuthFunction } from "./types";
3
+ export { StandaloneToolRegistry, StandaloneResourceRegistry, StandalonePromptRegistry } from "./core-services";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StandalonePromptRegistry = exports.StandaloneResourceRegistry = exports.StandaloneToolRegistry = exports.StandaloneMcpServer = exports.createMcpServer = void 0;
4
+ var standalone_server_1 = require("./standalone-server");
5
+ Object.defineProperty(exports, "createMcpServer", { enumerable: true, get: function () { return standalone_server_1.createMcpServer; } });
6
+ Object.defineProperty(exports, "StandaloneMcpServer", { enumerable: true, get: function () { return standalone_server_1.StandaloneMcpServer; } });
7
+ var core_services_1 = require("./core-services");
8
+ Object.defineProperty(exports, "StandaloneToolRegistry", { enumerable: true, get: function () { return core_services_1.StandaloneToolRegistry; } });
9
+ Object.defineProperty(exports, "StandaloneResourceRegistry", { enumerable: true, get: function () { return core_services_1.StandaloneResourceRegistry; } });
10
+ Object.defineProperty(exports, "StandalonePromptRegistry", { enumerable: true, get: function () { return core_services_1.StandalonePromptRegistry; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/standalone/index.ts"],"names":[],"mappings":";;;AAAA,yDAA2E;AAAlE,oHAAA,eAAe,OAAA;AAAE,wHAAA,mBAAmB,OAAA;AAE7C,iDAA+G;AAAtG,uHAAA,sBAAsB,OAAA;AAAE,2HAAA,0BAA0B,OAAA;AAAE,yHAAA,wBAAwB,OAAA"}
@@ -0,0 +1,23 @@
1
+ import { CreateMcpServerOptions } from "./types";
2
+ import { JsonRpcRequest, JsonRpcResponse } from "../interface/jsonrpc.interface";
3
+ export declare class StandaloneMcpServer {
4
+ private toolRegistry;
5
+ private resourceRegistry;
6
+ private promptRegistry;
7
+ private serverInfo;
8
+ private transport;
9
+ private auth?;
10
+ private httpServer?;
11
+ private port?;
12
+ private host?;
13
+ constructor(options: CreateMcpServerOptions);
14
+ start(): Promise<void>;
15
+ private startStdio;
16
+ private startHttp;
17
+ handleRequest(request: JsonRpcRequest): Promise<JsonRpcResponse>;
18
+ private handleInitialize;
19
+ private handleListTools;
20
+ private handleCallTool;
21
+ stop(): Promise<void>;
22
+ }
23
+ export declare function createMcpServer(options: CreateMcpServerOptions): StandaloneMcpServer;