@veloxts/mcp 0.6.23

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 (58) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bin.d.ts +17 -0
  3. package/dist/bin.d.ts.map +1 -0
  4. package/dist/bin.js +25 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/index.d.ts +34 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +29 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/prompts/index.d.ts +8 -0
  11. package/dist/prompts/index.d.ts.map +1 -0
  12. package/dist/prompts/index.js +7 -0
  13. package/dist/prompts/index.js.map +1 -0
  14. package/dist/prompts/templates.d.ts +75 -0
  15. package/dist/prompts/templates.d.ts.map +1 -0
  16. package/dist/prompts/templates.js +442 -0
  17. package/dist/prompts/templates.js.map +1 -0
  18. package/dist/resources/errors.d.ts +45 -0
  19. package/dist/resources/errors.d.ts.map +1 -0
  20. package/dist/resources/errors.js +117 -0
  21. package/dist/resources/errors.js.map +1 -0
  22. package/dist/resources/index.d.ts +14 -0
  23. package/dist/resources/index.d.ts.map +1 -0
  24. package/dist/resources/index.js +10 -0
  25. package/dist/resources/index.js.map +1 -0
  26. package/dist/resources/procedures.d.ts +61 -0
  27. package/dist/resources/procedures.d.ts.map +1 -0
  28. package/dist/resources/procedures.js +147 -0
  29. package/dist/resources/procedures.js.map +1 -0
  30. package/dist/resources/routes.d.ts +44 -0
  31. package/dist/resources/routes.d.ts.map +1 -0
  32. package/dist/resources/routes.js +115 -0
  33. package/dist/resources/routes.js.map +1 -0
  34. package/dist/resources/schemas.d.ts +41 -0
  35. package/dist/resources/schemas.d.ts.map +1 -0
  36. package/dist/resources/schemas.js +143 -0
  37. package/dist/resources/schemas.js.map +1 -0
  38. package/dist/server.d.ts +28 -0
  39. package/dist/server.d.ts.map +1 -0
  40. package/dist/server.js +371 -0
  41. package/dist/server.js.map +1 -0
  42. package/dist/tools/generate.d.ts +64 -0
  43. package/dist/tools/generate.d.ts.map +1 -0
  44. package/dist/tools/generate.js +155 -0
  45. package/dist/tools/generate.js.map +1 -0
  46. package/dist/tools/index.d.ts +10 -0
  47. package/dist/tools/index.d.ts.map +1 -0
  48. package/dist/tools/index.js +8 -0
  49. package/dist/tools/index.js.map +1 -0
  50. package/dist/tools/migrate.d.ts +72 -0
  51. package/dist/tools/migrate.d.ts.map +1 -0
  52. package/dist/tools/migrate.js +163 -0
  53. package/dist/tools/migrate.js.map +1 -0
  54. package/dist/utils/project.d.ts +49 -0
  55. package/dist/utils/project.d.ts.map +1 -0
  56. package/dist/utils/project.js +133 -0
  57. package/dist/utils/project.js.map +1 -0
  58. package/package.json +63 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 VeloxTS Framework Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/bin.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * VeloxTS MCP Server CLI
4
+ *
5
+ * Run the MCP server with stdio transport for integration with AI tools.
6
+ *
7
+ * @example
8
+ * ```bash
9
+ * # Run MCP server
10
+ * velox-mcp
11
+ *
12
+ * # Run with debug output
13
+ * velox-mcp --debug
14
+ * ```
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG"}
package/dist/bin.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * VeloxTS MCP Server CLI
4
+ *
5
+ * Run the MCP server with stdio transport for integration with AI tools.
6
+ *
7
+ * @example
8
+ * ```bash
9
+ * # Run MCP server
10
+ * velox-mcp
11
+ *
12
+ * # Run with debug output
13
+ * velox-mcp --debug
14
+ * ```
15
+ */
16
+ import { runMCPServer } from './server.js';
17
+ // Parse command line arguments
18
+ const args = process.argv.slice(2);
19
+ const debug = args.includes('--debug') || args.includes('-d');
20
+ // Run the server
21
+ runMCPServer({ debug }).catch((error) => {
22
+ console.error('Failed to start MCP server:', error);
23
+ process.exit(1);
24
+ });
25
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAE9D,iBAAiB;AACjB,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACtC,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @veloxts/mcp - Model Context Protocol Server for VeloxTS
3
+ *
4
+ * Exposes VeloxTS project context to AI tools via the Model Context Protocol.
5
+ * This enables AI assistants like Claude to introspect procedures, schemas,
6
+ * routes, and error codes programmatically.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { createVeloxMCPServer, runMCPServer } from '@veloxts/mcp';
11
+ *
12
+ * // Run with stdio transport (for CLI integration)
13
+ * await runMCPServer({ debug: true });
14
+ *
15
+ * // Or create a server instance for custom integration
16
+ * const server = createVeloxMCPServer({
17
+ * projectRoot: '/path/to/project',
18
+ * debug: true,
19
+ * });
20
+ * ```
21
+ *
22
+ * @module @veloxts/mcp
23
+ */
24
+ export type { VeloxMCPServerOptions } from './server.js';
25
+ export { createVeloxMCPServer, runMCPServer } from './server.js';
26
+ export type { ErrorInfo, ErrorsResourceResponse, ProcedureInfo, ProceduresResourceResponse, RouteInfo, RoutesResourceResponse, SchemaInfo, SchemasResourceResponse, } from './resources/index.js';
27
+ export { formatErrorsAsText, formatProceduresAsText, formatRoutesAsText, formatSchemasAsText, getErrors, getErrorsByPrefix, getProcedures, getProceduresByNamespace, getProceduresByType, getRoutes, getRoutesByMethod, getRoutesByNamespace, getSchemas, searchErrors, searchSchemas, } from './resources/index.js';
28
+ export type { GenerateOptions, GenerateResult, GeneratorType, MigrateAction, MigrateOptions, MigrateResult, MigrationInfo, } from './tools/index.js';
29
+ export { formatGenerateResult, formatMigrateResult, generate, generateProcedure, generateResource, generateSchema, migrate, migrateFresh, migrateReset, migrateRollback, migrateRun, migrateStatus, } from './tools/index.js';
30
+ export type { PromptArgument, PromptTemplate } from './prompts/index.js';
31
+ export { ADD_VALIDATION, CREATE_PROCEDURE, ERROR_HANDLING, getPromptTemplate, listPromptTemplates, PROMPT_TEMPLATES, renderPromptTemplate, SETUP_AUTH, } from './prompts/index.js';
32
+ export type { ProjectInfo } from './utils/project.js';
33
+ export { findProjectRoot, getProceduresPath, getProjectInfo, getSchemasPath, isVeloxProject, } from './utils/project.js';
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMjE,YAAY,EACV,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,0BAA0B,EAC1B,SAAS,EACT,sBAAsB,EACtB,UAAU,EACV,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,wBAAwB,EACxB,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,sBAAsB,CAAC;AAM9B,YAAY,EACV,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,UAAU,EACV,aAAa,GACd,MAAM,kBAAkB,CAAC;AAM1B,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,GACX,MAAM,oBAAoB,CAAC;AAM5B,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @veloxts/mcp - Model Context Protocol Server for VeloxTS
3
+ *
4
+ * Exposes VeloxTS project context to AI tools via the Model Context Protocol.
5
+ * This enables AI assistants like Claude to introspect procedures, schemas,
6
+ * routes, and error codes programmatically.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { createVeloxMCPServer, runMCPServer } from '@veloxts/mcp';
11
+ *
12
+ * // Run with stdio transport (for CLI integration)
13
+ * await runMCPServer({ debug: true });
14
+ *
15
+ * // Or create a server instance for custom integration
16
+ * const server = createVeloxMCPServer({
17
+ * projectRoot: '/path/to/project',
18
+ * debug: true,
19
+ * });
20
+ * ```
21
+ *
22
+ * @module @veloxts/mcp
23
+ */
24
+ export { createVeloxMCPServer, runMCPServer } from './server.js';
25
+ export { formatErrorsAsText, formatProceduresAsText, formatRoutesAsText, formatSchemasAsText, getErrors, getErrorsByPrefix, getProcedures, getProceduresByNamespace, getProceduresByType, getRoutes, getRoutesByMethod, getRoutesByNamespace, getSchemas, searchErrors, searchSchemas, } from './resources/index.js';
26
+ export { formatGenerateResult, formatMigrateResult, generate, generateProcedure, generateResource, generateSchema, migrate, migrateFresh, migrateReset, migrateRollback, migrateRun, migrateStatus, } from './tools/index.js';
27
+ export { ADD_VALIDATION, CREATE_PROCEDURE, ERROR_HANDLING, getPromptTemplate, listPromptTemplates, PROMPT_TEMPLATES, renderPromptTemplate, SETUP_AUTH, } from './prompts/index.js';
28
+ export { findProjectRoot, getProceduresPath, getProjectInfo, getSchemasPath, isVeloxProject, } from './utils/project.js';
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgBjE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,wBAAwB,EACxB,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,sBAAsB,CAAC;AAe9B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,UAAU,EACV,aAAa,GACd,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,GACX,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MCP Prompts
3
+ *
4
+ * Reusable prompt templates for AI assistants.
5
+ */
6
+ export type { PromptArgument, PromptTemplate } from './templates.js';
7
+ export { ADD_VALIDATION, CREATE_PROCEDURE, ERROR_HANDLING, getPromptTemplate, listPromptTemplates, PROMPT_TEMPLATES, renderPromptTemplate, SETUP_AUTH, } from './templates.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,GACX,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MCP Prompts
3
+ *
4
+ * Reusable prompt templates for AI assistants.
5
+ */
6
+ export { ADD_VALIDATION, CREATE_PROCEDURE, ERROR_HANDLING, getPromptTemplate, listPromptTemplates, PROMPT_TEMPLATES, renderPromptTemplate, SETUP_AUTH, } from './templates.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,GACX,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Prompt Templates
3
+ *
4
+ * Reusable prompt templates for common VeloxTS tasks.
5
+ */
6
+ /**
7
+ * Prompt template definition
8
+ */
9
+ export interface PromptTemplate {
10
+ /** Unique identifier for the prompt */
11
+ name: string;
12
+ /** Human-readable description */
13
+ description: string;
14
+ /** Template arguments */
15
+ arguments?: PromptArgument[];
16
+ /** The prompt content */
17
+ content: string;
18
+ }
19
+ /**
20
+ * Prompt argument definition
21
+ */
22
+ export interface PromptArgument {
23
+ /** Argument name */
24
+ name: string;
25
+ /** Argument description */
26
+ description: string;
27
+ /** Whether the argument is required */
28
+ required?: boolean;
29
+ }
30
+ /**
31
+ * Create procedure template
32
+ */
33
+ export declare const CREATE_PROCEDURE: PromptTemplate;
34
+ /**
35
+ * Add validation template
36
+ */
37
+ export declare const ADD_VALIDATION: PromptTemplate;
38
+ /**
39
+ * Setup authentication template
40
+ */
41
+ export declare const SETUP_AUTH: PromptTemplate;
42
+ /**
43
+ * Error handling template
44
+ */
45
+ export declare const ERROR_HANDLING: PromptTemplate;
46
+ /**
47
+ * All available prompt templates
48
+ */
49
+ export declare const PROMPT_TEMPLATES: PromptTemplate[];
50
+ /**
51
+ * Get a prompt template by name
52
+ */
53
+ export declare function getPromptTemplate(name: string): PromptTemplate | undefined;
54
+ /**
55
+ * Render a prompt template with argument substitution
56
+ *
57
+ * Supports the following placeholder transformations:
58
+ * - {arg} - lowercase (e.g., "user")
59
+ * - {Arg} - PascalCase (e.g., "User")
60
+ * - {args} - lowercase plural (e.g., "users")
61
+ * - {Args} - PascalCase plural (e.g., "Users")
62
+ *
63
+ * @param name - Template name
64
+ * @param args - Argument values as key-value pairs
65
+ * @returns Rendered content or undefined if template not found
66
+ */
67
+ export declare function renderPromptTemplate(name: string, args: Record<string, string>): string | undefined;
68
+ /**
69
+ * List all available prompts
70
+ */
71
+ export declare function listPromptTemplates(): {
72
+ name: string;
73
+ description: string;
74
+ }[];
75
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/prompts/templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAMD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cA+E9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,cAkF5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,cA6FxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,cAwF5B,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAK5C,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE1E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,GAAG,SAAS,CAuCpB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EAAE,CAK7E"}