@react-spa-scaffold/mcp 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 (173) hide show
  1. package/README.md +423 -0
  2. package/dist/features/index.d.ts +5 -0
  3. package/dist/features/index.d.ts.map +1 -0
  4. package/dist/features/index.js +3 -0
  5. package/dist/features/index.js.map +1 -0
  6. package/dist/features/registry.d.ts +10 -0
  7. package/dist/features/registry.d.ts.map +1 -0
  8. package/dist/features/registry.js +508 -0
  9. package/dist/features/registry.js.map +1 -0
  10. package/dist/features/types.d.ts +45 -0
  11. package/dist/features/types.d.ts.map +1 -0
  12. package/dist/features/types.js +5 -0
  13. package/dist/features/types.js.map +1 -0
  14. package/dist/features/versions.d.ts +16 -0
  15. package/dist/features/versions.d.ts.map +1 -0
  16. package/dist/features/versions.js +46 -0
  17. package/dist/features/versions.js.map +1 -0
  18. package/dist/features/versions.json +5 -0
  19. package/dist/index.d.ts +22 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +43 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/resources/docs.d.ts +29 -0
  24. package/dist/resources/docs.d.ts.map +1 -0
  25. package/dist/resources/docs.js +105 -0
  26. package/dist/resources/docs.js.map +1 -0
  27. package/dist/resources/index.d.ts +2 -0
  28. package/dist/resources/index.d.ts.map +1 -0
  29. package/dist/resources/index.js +2 -0
  30. package/dist/resources/index.js.map +1 -0
  31. package/dist/server.d.ts +12 -0
  32. package/dist/server.d.ts.map +1 -0
  33. package/dist/server.js +115 -0
  34. package/dist/server.js.map +1 -0
  35. package/dist/tools/get-example.d.ts +51 -0
  36. package/dist/tools/get-example.d.ts.map +1 -0
  37. package/dist/tools/get-example.js +90 -0
  38. package/dist/tools/get-example.js.map +1 -0
  39. package/dist/tools/get-features.d.ts +30 -0
  40. package/dist/tools/get-features.d.ts.map +1 -0
  41. package/dist/tools/get-features.js +46 -0
  42. package/dist/tools/get-features.js.map +1 -0
  43. package/dist/tools/get-scaffold.d.ts +77 -0
  44. package/dist/tools/get-scaffold.d.ts.map +1 -0
  45. package/dist/tools/get-scaffold.js +153 -0
  46. package/dist/tools/get-scaffold.js.map +1 -0
  47. package/dist/tools/index.d.ts +4 -0
  48. package/dist/tools/index.d.ts.map +1 -0
  49. package/dist/tools/index.js +4 -0
  50. package/dist/tools/index.js.map +1 -0
  51. package/dist/utils/docs.d.ts +14 -0
  52. package/dist/utils/docs.d.ts.map +1 -0
  53. package/dist/utils/docs.js +64 -0
  54. package/dist/utils/docs.js.map +1 -0
  55. package/dist/utils/examples.d.ts +27 -0
  56. package/dist/utils/examples.d.ts.map +1 -0
  57. package/dist/utils/examples.js +399 -0
  58. package/dist/utils/examples.js.map +1 -0
  59. package/dist/utils/index.d.ts +5 -0
  60. package/dist/utils/index.d.ts.map +1 -0
  61. package/dist/utils/index.js +5 -0
  62. package/dist/utils/index.js.map +1 -0
  63. package/dist/utils/paths.d.ts +28 -0
  64. package/dist/utils/paths.d.ts.map +1 -0
  65. package/dist/utils/paths.js +40 -0
  66. package/dist/utils/paths.js.map +1 -0
  67. package/dist/utils/scaffold.d.ts +50 -0
  68. package/dist/utils/scaffold.d.ts.map +1 -0
  69. package/dist/utils/scaffold.js +500 -0
  70. package/dist/utils/scaffold.js.map +1 -0
  71. package/dist/version.d.ts +5 -0
  72. package/dist/version.d.ts.map +1 -0
  73. package/dist/version.js +19 -0
  74. package/dist/version.js.map +1 -0
  75. package/package.json +63 -0
  76. package/templates/.bundled +0 -0
  77. package/templates/CLAUDE.md +145 -0
  78. package/templates/docs/API_REFERENCE.md +58 -0
  79. package/templates/docs/ARCHITECTURE.md +185 -0
  80. package/templates/docs/CODING_STANDARDS.md +53 -0
  81. package/templates/docs/COMPONENT_GUIDELINES.md +301 -0
  82. package/templates/docs/E2E_TESTING.md +116 -0
  83. package/templates/docs/INTERNATIONALIZATION.md +67 -0
  84. package/templates/docs/TESTING.md +259 -0
  85. package/templates/docs/WORKFLOW.md +170 -0
  86. package/templates/src/App.tsx +42 -0
  87. package/templates/src/components/layout/Header.tsx +19 -0
  88. package/templates/src/components/layout/index.ts +1 -0
  89. package/templates/src/components/shared/ErrorBoundary/ErrorBoundary.tsx +104 -0
  90. package/templates/src/components/shared/ErrorBoundary/index.ts +1 -0
  91. package/templates/src/components/shared/LanguageSwitcher/LanguageSwitcher.tsx +45 -0
  92. package/templates/src/components/shared/LanguageSwitcher/index.ts +1 -0
  93. package/templates/src/components/shared/SEO/SEO.tsx +55 -0
  94. package/templates/src/components/shared/SEO/index.ts +1 -0
  95. package/templates/src/components/shared/ThemeToggle/ThemeToggle.tsx +41 -0
  96. package/templates/src/components/shared/ThemeToggle/index.ts +1 -0
  97. package/templates/src/components/shared/index.ts +4 -0
  98. package/templates/src/components/ui/button.tsx +48 -0
  99. package/templates/src/components/ui/dropdown-menu.tsx +228 -0
  100. package/templates/src/components/ui/form-error.tsx +95 -0
  101. package/templates/src/components/ui/loading.tsx +58 -0
  102. package/templates/src/components/ui/skeleton.tsx +52 -0
  103. package/templates/src/components/ui/sonner.tsx +34 -0
  104. package/templates/src/components/ui/spinner.tsx +40 -0
  105. package/templates/src/components/ui/visually-hidden.tsx +51 -0
  106. package/templates/src/contexts/mobileContext.tsx +66 -0
  107. package/templates/src/contexts/queryContext.tsx +28 -0
  108. package/templates/src/hooks/index.ts +7 -0
  109. package/templates/src/hooks/useContactForm.ts +33 -0
  110. package/templates/src/hooks/useExampleQuery.ts +20 -0
  111. package/templates/src/hooks/useLanguage.ts +23 -0
  112. package/templates/src/hooks/useMediaQuery.ts +53 -0
  113. package/templates/src/hooks/useThemeEffect.ts +31 -0
  114. package/templates/src/hooks/useTouchSizes.ts +16 -0
  115. package/templates/src/i18n/config.ts +11 -0
  116. package/templates/src/i18n/detectLanguage.ts +57 -0
  117. package/templates/src/i18n/index.ts +20 -0
  118. package/templates/src/i18n/loadCatalog.ts +30 -0
  119. package/templates/src/index.css +98 -0
  120. package/templates/src/lib/api.ts +142 -0
  121. package/templates/src/lib/config.ts +15 -0
  122. package/templates/src/lib/constants.ts +8 -0
  123. package/templates/src/lib/env.ts +53 -0
  124. package/templates/src/lib/format.ts +119 -0
  125. package/templates/src/lib/index.ts +24 -0
  126. package/templates/src/lib/routes.ts +11 -0
  127. package/templates/src/lib/storage.ts +91 -0
  128. package/templates/src/lib/storageKeys.ts +10 -0
  129. package/templates/src/lib/utils.ts +6 -0
  130. package/templates/src/lib/validations.ts +39 -0
  131. package/templates/src/locales/de.po +65 -0
  132. package/templates/src/locales/en.po +65 -0
  133. package/templates/src/locales/es.po +65 -0
  134. package/templates/src/main.tsx +107 -0
  135. package/templates/src/mocks/fixtures/index.ts +1 -0
  136. package/templates/src/mocks/fixtures/todos.ts +40 -0
  137. package/templates/src/mocks/handlers/index.ts +7 -0
  138. package/templates/src/mocks/handlers/todos.ts +59 -0
  139. package/templates/src/mocks/index.ts +3 -0
  140. package/templates/src/mocks/node.ts +9 -0
  141. package/templates/src/pages/Home.tsx +27 -0
  142. package/templates/src/pages/NotFound.tsx +28 -0
  143. package/templates/src/pages/index.ts +2 -0
  144. package/templates/src/stores/index.ts +2 -0
  145. package/templates/src/stores/preferencesStore.ts +85 -0
  146. package/templates/src/test/index.ts +8 -0
  147. package/templates/src/test/mocks.ts +17 -0
  148. package/templates/src/test/providers.tsx +54 -0
  149. package/templates/src/test-setup.ts +54 -0
  150. package/templates/src/types/api.ts +31 -0
  151. package/templates/src/types/index.ts +2 -0
  152. package/templates/src/types/preferences.ts +5 -0
  153. package/templates/src/vite-env.d.ts +10 -0
  154. package/templates/tests/unit/components/ErrorBoundary.test.tsx +193 -0
  155. package/templates/tests/unit/components/Header.test.tsx +33 -0
  156. package/templates/tests/unit/components/LanguageSwitcher.test.tsx +40 -0
  157. package/templates/tests/unit/components/Loading.test.tsx +76 -0
  158. package/templates/tests/unit/components/SEO.test.tsx +80 -0
  159. package/templates/tests/unit/components/ThemeToggle.test.tsx +62 -0
  160. package/templates/tests/unit/contexts/mobileContext.test.tsx +54 -0
  161. package/templates/tests/unit/hooks/useContactForm.test.ts +60 -0
  162. package/templates/tests/unit/hooks/useExampleQuery.test.tsx +94 -0
  163. package/templates/tests/unit/hooks/useLanguage.test.tsx +75 -0
  164. package/templates/tests/unit/hooks/useMediaQuery.test.ts +57 -0
  165. package/templates/tests/unit/hooks/useThemeEffect.test.ts +42 -0
  166. package/templates/tests/unit/i18n/detectLanguage.test.ts +40 -0
  167. package/templates/tests/unit/i18n/loadCatalog.test.ts +70 -0
  168. package/templates/tests/unit/lib/api.test.ts +142 -0
  169. package/templates/tests/unit/lib/format.test.ts +100 -0
  170. package/templates/tests/unit/lib/storage.test.ts +90 -0
  171. package/templates/tests/unit/lib/utils.test.ts +19 -0
  172. package/templates/tests/unit/lib/validations.test.ts +56 -0
  173. package/templates/tests/unit/stores/preferencesStore.test.ts +75 -0
@@ -0,0 +1,5 @@
1
+ {
2
+ "@react-spa-scaffold/eslint-config": "^1.0.0",
3
+ "@react-spa-scaffold/prettier-config": "^1.0.0",
4
+ "@react-spa-scaffold/tsconfig": "^1.0.0"
5
+ }
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * react-spa-scaffold MCP Server
4
+ *
5
+ * A Model Context Protocol server that provides tools and resources
6
+ * for scaffolding new projects based on the react-spa-scaffold template.
7
+ *
8
+ * Usage:
9
+ * npx @react-spa-scaffold/mcp # Run with STDIO transport
10
+ * node dist/index.js # Direct execution
11
+ *
12
+ * Tools:
13
+ * - get_features: List available feature modules
14
+ * - get_scaffold: Get complete scaffold for selected features
15
+ * - get_example: Get real code examples for patterns
16
+ *
17
+ * Resources:
18
+ * - docs://conventions, docs://architecture, docs://testing
19
+ * - docs://i18n, docs://api, docs://claude
20
+ */
21
+ export {};
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;GAkBG"}
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * react-spa-scaffold MCP Server
4
+ *
5
+ * A Model Context Protocol server that provides tools and resources
6
+ * for scaffolding new projects based on the react-spa-scaffold template.
7
+ *
8
+ * Usage:
9
+ * npx @react-spa-scaffold/mcp # Run with STDIO transport
10
+ * node dist/index.js # Direct execution
11
+ *
12
+ * Tools:
13
+ * - get_features: List available feature modules
14
+ * - get_scaffold: Get complete scaffold for selected features
15
+ * - get_example: Get real code examples for patterns
16
+ *
17
+ * Resources:
18
+ * - docs://conventions, docs://architecture, docs://testing
19
+ * - docs://i18n, docs://api, docs://claude
20
+ */
21
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
22
+ import { createServer } from './server.js';
23
+ import { VERSION } from './version.js';
24
+ async function main() {
25
+ const server = createServer();
26
+ const transport = new StdioServerTransport();
27
+ // Graceful shutdown handling
28
+ const shutdown = async () => {
29
+ console.error('Shutting down MCP server...');
30
+ await server.close();
31
+ process.exit(0);
32
+ };
33
+ process.on('SIGINT', shutdown);
34
+ process.on('SIGTERM', shutdown);
35
+ await server.connect(transport);
36
+ // Log to stderr (STDIO transport uses stdout for messages)
37
+ console.error(`react-spa-scaffold MCP server v${VERSION} running on STDIO`);
38
+ }
39
+ main().catch((error) => {
40
+ console.error('Failed to start MCP server:', error);
41
+ process.exit(1);
42
+ });
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,6BAA6B;IAC7B,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC7C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEhC,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,2DAA2D;IAC3D,OAAO,CAAC,KAAK,CAAC,kCAAkC,OAAO,mBAAmB,CAAC,CAAC;AAC9E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Documentation resources
3
+ *
4
+ * Reads actual documentation files from the react-spa-scaffold repository
5
+ * to ensure MCP resources stay in sync with the real docs.
6
+ * Uses in-memory caching to avoid repeated disk reads.
7
+ */
8
+ /**
9
+ * Get list of all available documentation resources
10
+ */
11
+ export declare function getDocumentationResources(): {
12
+ uri: string;
13
+ name: string;
14
+ description: string;
15
+ mimeType: string;
16
+ }[];
17
+ /**
18
+ * Read documentation content for a resource URI (cached)
19
+ */
20
+ export declare function readDocumentation(uri: string): Promise<string | null>;
21
+ /**
22
+ * Check if a URI is a valid documentation resource
23
+ */
24
+ export declare function isValidDocumentationUri(uri: string): boolean;
25
+ /**
26
+ * Get all available documentation URIs
27
+ */
28
+ export declare function getDocumentationUris(): string[];
29
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/resources/docs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAuDH;;GAEG;AACH,wBAAgB,yBAAyB;;;;;IAOxC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiC3E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Documentation resources
3
+ *
4
+ * Reads actual documentation files from the react-spa-scaffold repository
5
+ * to ensure MCP resources stay in sync with the real docs.
6
+ * Uses in-memory caching to avoid repeated disk reads.
7
+ */
8
+ import { readFile } from 'fs/promises';
9
+ import { resolveTemplatePath } from '../utils/paths.js';
10
+ // Simple in-memory cache for documentation content
11
+ const cache = new Map();
12
+ /**
13
+ * Documentation file mapping
14
+ *
15
+ * Maps resource URIs to actual files in the repository.
16
+ * Add new entries here to expose additional documentation.
17
+ */
18
+ const DOCS_MAP = {
19
+ 'docs://conventions': {
20
+ files: ['docs/CODING_STANDARDS.md', 'docs/COMPONENT_GUIDELINES.md'],
21
+ name: 'Coding Conventions',
22
+ description: 'Coding standards, naming conventions, and component patterns for react-spa-scaffold projects',
23
+ },
24
+ 'docs://architecture': {
25
+ files: ['docs/ARCHITECTURE.md'],
26
+ name: 'Architecture Overview',
27
+ description: 'Technology stack, data flow, and architectural decisions for react-spa-scaffold',
28
+ },
29
+ 'docs://testing': {
30
+ files: ['docs/TESTING.md', 'docs/E2E_TESTING.md'],
31
+ name: 'Testing Guide',
32
+ description: 'Unit testing with Vitest and E2E testing with Playwright',
33
+ },
34
+ 'docs://i18n': {
35
+ files: ['docs/INTERNATIONALIZATION.md'],
36
+ name: 'Internationalization',
37
+ description: 'LinguiJS setup, Trans component usage, and translation workflow',
38
+ },
39
+ 'docs://api': {
40
+ files: ['docs/API_REFERENCE.md'],
41
+ name: 'API Reference',
42
+ description: 'API client utilities, hooks, and data fetching patterns',
43
+ },
44
+ 'docs://claude': {
45
+ files: ['CLAUDE.md'],
46
+ name: 'Claude AI Guidance',
47
+ description: 'AI assistant instructions and project-specific guidance',
48
+ },
49
+ };
50
+ /**
51
+ * Get list of all available documentation resources
52
+ */
53
+ export function getDocumentationResources() {
54
+ return Object.entries(DOCS_MAP).map(([uri, doc]) => ({
55
+ uri,
56
+ name: doc.name,
57
+ description: doc.description,
58
+ mimeType: 'text/markdown',
59
+ }));
60
+ }
61
+ /**
62
+ * Read documentation content for a resource URI (cached)
63
+ */
64
+ export async function readDocumentation(uri) {
65
+ const doc = DOCS_MAP[uri];
66
+ if (!doc) {
67
+ return null;
68
+ }
69
+ // Return cached content if available
70
+ if (cache.has(uri)) {
71
+ return cache.get(uri);
72
+ }
73
+ const contents = [];
74
+ for (const file of doc.files) {
75
+ const fullPath = resolveTemplatePath(file);
76
+ try {
77
+ const content = await readFile(fullPath, 'utf-8');
78
+ contents.push(content);
79
+ }
80
+ catch {
81
+ // File might not exist
82
+ contents.push(`<!-- File not found: ${file} -->\n`);
83
+ }
84
+ }
85
+ // Join multiple files with a separator
86
+ const result = contents.length > 1 ? contents.join('\n\n---\n\n') : contents[0] || null;
87
+ // Cache the result
88
+ if (result) {
89
+ cache.set(uri, result);
90
+ }
91
+ return result;
92
+ }
93
+ /**
94
+ * Check if a URI is a valid documentation resource
95
+ */
96
+ export function isValidDocumentationUri(uri) {
97
+ return uri in DOCS_MAP;
98
+ }
99
+ /**
100
+ * Get all available documentation URIs
101
+ */
102
+ export function getDocumentationUris() {
103
+ return Object.keys(DOCS_MAP);
104
+ }
105
+ //# sourceMappingURL=docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.js","sourceR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GAAG,IAAI,QAAQ,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getDocumentationResources, readDocumentation, isValidDocumentationUri, getDocumentationUris } from './docs.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getDocumentationResources, readDocumentation, isValidDocumentationUri, getDocumentationUris } from './docs.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * MCP Server for react-spa-scaffold scaffolding
3
+ *
4
+ * This server provides tools and resources for AI agents to scaffold
5
+ * new projects based on the react-spa-scaffold template.
6
+ */
7
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
8
+ /**
9
+ * Create and configure the MCP server
10
+ */
11
+ export declare function createServer(): Server;
12
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AA0DnE;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAoFrC"}
package/dist/server.js ADDED
@@ -0,0 +1,115 @@
1
+ /**
2
+ * MCP Server for react-spa-scaffold scaffolding
3
+ *
4
+ * This server provides tools and resources for AI agents to scaffold
5
+ * new projects based on the react-spa-scaffold template.
6
+ */
7
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
8
+ import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
9
+ import { getFeatures, getFeaturesToolDefinition, getScaffold, getScaffoldSchema, getScaffoldToolDefinition, getExample, getExampleSchema, getExampleToolDefinition, } from './tools/index.js';
10
+ import { getDocumentationResources, readDocumentation, isValidDocumentationUri } from './resources/index.js';
11
+ import { VERSION } from './version.js';
12
+ // ═══════════════════════════════════════════════════════════════════════════
13
+ // Response Helpers
14
+ // ═══════════════════════════════════════════════════════════════════════════
15
+ function jsonResponse(data) {
16
+ return {
17
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
18
+ };
19
+ }
20
+ function errorResponse(message) {
21
+ return {
22
+ content: [{ type: 'text', text: message }],
23
+ isError: true,
24
+ };
25
+ }
26
+ // ═══════════════════════════════════════════════════════════════════════════
27
+ // Server Instructions
28
+ // ═══════════════════════════════════════════════════════════════════════════
29
+ const SERVER_INSTRUCTIONS = `
30
+ react-spa-scaffold MCP Server - Project Scaffolding Assistant
31
+
32
+ Usage:
33
+ 1. Call get_features to see available feature modules
34
+ 2. Call get_scaffold with desired features to get project structure
35
+ 3. Call get_example to get code patterns for specific file types
36
+ 4. Read docs:// resources for conventions and best practices
37
+
38
+ Tips:
39
+ - Core feature is always included automatically
40
+ - Features are independent - select only what you need
41
+ - Check docs://conventions before generating code
42
+ `.trim();
43
+ /**
44
+ * Create and configure the MCP server
45
+ */
46
+ export function createServer() {
47
+ const server = new Server({
48
+ name: 'react-spa-scaffold-mcp',
49
+ version: VERSION,
50
+ }, {
51
+ capabilities: {
52
+ tools: {},
53
+ resources: {},
54
+ },
55
+ instructions: SERVER_INSTRUCTIONS,
56
+ });
57
+ // ═══════════════════════════════════════════════════════════════════════
58
+ // TOOLS
59
+ // ═══════════════════════════════════════════════════════════════════════
60
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
61
+ return {
62
+ tools: [getFeaturesToolDefinition, getScaffoldToolDefinition, getExampleToolDefinition],
63
+ };
64
+ });
65
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
66
+ const { name, arguments: args } = request.params;
67
+ try {
68
+ switch (name) {
69
+ case 'get_features':
70
+ return jsonResponse(getFeatures());
71
+ case 'get_scaffold': {
72
+ const parsed = getScaffoldSchema.safeParse(args);
73
+ if (!parsed.success) {
74
+ return errorResponse(`Invalid input: ${parsed.error.message}`);
75
+ }
76
+ return jsonResponse(await getScaffold(parsed.data));
77
+ }
78
+ case 'get_example': {
79
+ const parsed = getExampleSchema.safeParse(args);
80
+ if (!parsed.success) {
81
+ return errorResponse(`Invalid input: ${parsed.error.message}`);
82
+ }
83
+ return jsonResponse(await getExample(parsed.data));
84
+ }
85
+ default:
86
+ return errorResponse(`Unknown tool: ${name}`);
87
+ }
88
+ }
89
+ catch (error) {
90
+ const message = error instanceof Error ? error.message : String(error);
91
+ return errorResponse(`Error executing ${name}: ${message}`);
92
+ }
93
+ });
94
+ // ═══════════════════════════════════════════════════════════════════════
95
+ // RESOURCES
96
+ // ═══════════════════════════════════════════════════════════════════════
97
+ server.setRequestHandler(ListResourcesRequestSchema, async () => {
98
+ return { resources: getDocumentationResources() };
99
+ });
100
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
101
+ const { uri } = request.params;
102
+ if (!isValidDocumentationUri(uri)) {
103
+ throw new Error(`Unknown resource: ${uri}`);
104
+ }
105
+ const content = await readDocumentation(uri);
106
+ if (!content) {
107
+ throw new Error(`Failed to read resource: ${uri}`);
108
+ }
109
+ return {
110
+ contents: [{ uri, mimeType: 'text/markdown', text: content }],
111
+ };
112
+ });
113
+ return server;
114
+ }
115
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRo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use this to understand how to generate code
6
+ * that matches react-spa-scaffold conventions.
7
+ */
8
+ import { z } from 'zod';
9
+ export declare const getExampleSchema: z.ZodObject<{
10
+ pattern: z.ZodEnum<[string, ...string[]]>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ pattern: string;
13
+ }, {
14
+ pattern: string;
15
+ }>;
16
+ export type GetExampleInput = z.infer<typeof getExampleSchema>;
17
+ export declare function getExample(input: GetExampleInput): Promise<{
18
+ error: string;
19
+ hint: string;
20
+ pattern?: undefined;
21
+ description?: undefined;
22
+ filePath?: undefined;
23
+ keyPoints?: undefined;
24
+ code?: undefined;
25
+ usage?: undefined;
26
+ } | {
27
+ pattern: string;
28
+ description: string;
29
+ filePath: string;
30
+ keyPoints: string[];
31
+ code: string;
32
+ usage: string;
33
+ error?: undefined;
34
+ hint?: undefined;
35
+ }>;
36
+ export declare const getExampleToolDefinition: {
37
+ name: string;
38
+ description: string;
39
+ inputSchema: {
40
+ type: "object";
41
+ properties: {
42
+ pattern: {
43
+ type: "string";
44
+ description: string;
45
+ enum: [string, ...string[]];
46
+ };
47
+ };
48
+ required: string[];
49
+ };
50
+ };
51
+ //# sourceMappingURL=get-example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-example.d.ts","sourceRoot":"","sources":["../../src/tools/get-example.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,gBAAgB;;;;;;EAI3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE/D,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe;;;;;;;;;;;;;;;;;;GAoBtD;AAuBD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;CAoCpC,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * get_example tool
3
+ *
4
+ * Returns real code examples for specific pattern types.
5
+ * AI agents use this to understand how to generate code
6
+ * that matches react-spa-scaffold conventions.
7
+ */
8
+ import { z } from 'zod';
9
+ import { getCodeExample, getAvailablePatterns } from '../utils/index.js';
10
+ const AVAILABLE_PATTERNS = getAvailablePatterns();
11
+ export const getExampleSchema = z.object({
12
+ pattern: z.enum(AVAILABLE_PATTERNS, {
13
+ errorMap: () => ({ message: `Invalid pattern. Available: ${AVAILABLE_PATTERNS.join(', ')}` }),
14
+ }),
15
+ });
16
+ export async function getExample(input) {
17
+ const { pattern } = input;
18
+ const example = await getCodeExample(pattern);
19
+ if (!example) {
20
+ return {
21
+ error: `Could not load example for pattern: ${pattern}`,
22
+ hint: 'Ensure MCP server is running from react-spa-scaffold directory',
23
+ };
24
+ }
25
+ return {
26
+ pattern: example.pattern,
27
+ description: example.description,
28
+ filePath: example.filePath,
29
+ keyPoints: example.keyPoints,
30
+ code: example.code,
31
+ usage: generateUsageHint(pattern),
32
+ };
33
+ }
34
+ function generateUsageHint(pattern) {
35
+ const hints = {
36
+ 'component-ui': 'Place in src/components/ui/ with kebab-case filename',
37
+ 'component-shared': 'Create subdirectory in src/components/shared/ with index.ts barrel',
38
+ 'component-layout': 'Place in src/components/layout/',
39
+ 'hook-state': 'Place in src/hooks/ with useXxx.ts naming',
40
+ 'hook-query': 'Place in src/hooks/ - define fetchFn outside hook',
41
+ 'hook-form': 'Place in src/hooks/ - import schema from lib/validations',
42
+ 'hook-effect': 'Place in src/hooks/ - no return value',
43
+ 'zustand-store': 'Place in src/stores/ with xxxStore.ts naming',
44
+ 'page-component': 'Place in src/pages/ with XxxPage named export',
45
+ 'context-provider': 'Place in src/contexts/ - export both Provider and hook',
46
+ 'test-component': 'Place in tests/unit/components/ mirroring src structure',
47
+ 'test-hook': 'Place in tests/unit/hooks/',
48
+ 'msw-handler': 'Place in src/mocks/handlers/',
49
+ 'zod-schema': 'Add to src/lib/validations.ts',
50
+ };
51
+ return hints[pattern] || 'Follow the file path shown in the example';
52
+ }
53
+ export const getExampleToolDefinition = {
54
+ name: 'get_example',
55
+ description: `Get real code example for a specific pattern type.
56
+
57
+ Returns actual code from the react-spa-scaffold repository, not templates.
58
+ Use this to understand exact patterns when generating new files.
59
+
60
+ Available patterns:
61
+ - Components: component-ui, component-shared, component-layout
62
+ - Hooks: hook-state, hook-query, hook-form, hook-effect, use-language-hook
63
+ - Store: zustand-store
64
+ - Pages: page-component, lazy-page
65
+ - Context: context-provider, query-provider
66
+ - API: api-client
67
+ - Tests: test-component, test-hook, test-store, msw-handler
68
+ - Validation: zod-schema, form-error-component
69
+ - i18n: trans-component, t-function, language-switcher
70
+ - Utils: storage-utility, format-utility
71
+ - Theme: theme-toggle
72
+ - SEO: seo-component
73
+
74
+ Each example includes:
75
+ - Actual working code
76
+ - Key points explaining the pattern
77
+ - File path where it should be placed`,
78
+ inputSchema: {
79
+ type: 'object',
80
+ properties: {
81
+ pattern: {
82
+ type: 'string',
83
+ description: 'Pattern type to get example for',
84
+ enum: AVAILABLE_PATTERNS,
85
+ },
86
+ },
87
+ required: ['pattern'],
88
+ },
89
+ };
90
+ //# sourceMappingURL=get-example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-example.js","sourceRoot":"","sources":["../../src/tools/get-example.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,MAAM,kBAAkB,GAAG,oBAAoB,EAA2B,CAAC;AAE3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE;QAClC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,+BAA+B,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;KAC9F,CAAC;CACH,CAAC,CAA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AE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAiB;gBACvB,WAAW,EAAE,iCAAiC;gBAC9C,IAAI,EAAE,kBAAkB;aACzB;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;CACF,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * get_features tool
3
+ *
4
+ * Lists all available feature modules for project scaffolding.
5
+ * AI agents use this to understand what features are available
6
+ * and present options to users.
7
+ */
8
+ export interface FeatureSummary {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ required: boolean;
13
+ includes: string[];
14
+ hasOptions: boolean;
15
+ options?: Record<string, {
16
+ description: string;
17
+ default: boolean;
18
+ }>;
19
+ }
20
+ export declare function getFeatures(): FeatureSummary[];
21
+ export declare const getFeaturesToolDefinition: {
22
+ name: string;
23
+ description: string;
24
+ inputSchema: {
25
+ type: "object";
26
+ properties: {};
27
+ required: string[];
28
+ };
29
+ };
30
+ //# sourceMappingURL=get-features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-features.d.ts","sourceRoot":"","sources":["../../src/tools/get-features.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACrE;AAED,wBAAgB,WAAW,IAAI,cAAc,EAAE,CAa9C;AAED,eAAO,MAAM,yBAAyB;;;;;;kBAoBlB,MAAM,EAAE;;CAE3B,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * get_features tool
3
+ *
4
+ * Lists all available feature modules for project scaffolding.
5
+ * AI agents use this to understand what features are available
6
+ * and present options to users.
7
+ */
8
+ import { FEATURES, FEATURE_IDS } from '../features/index.js';
9
+ export function getFeatures() {
10
+ return FEATURE_IDS.map((id) => {
11
+ const feature = FEATURES[id];
12
+ return {
13
+ id: String(id),
14
+ name: feature.name,
15
+ description: feature.description,
16
+ required: feature.required,
17
+ includes: feature.includes,
18
+ hasOptions: !!feature.options,
19
+ options: feature.options,
20
+ };
21
+ });
22
+ }
23
+ export const getFeaturesToolDefinition = {
24
+ name: 'get_features',
25
+ description: `List all available feature modules for react-spa-scaffold project scaffolding.
26
+
27
+ Returns a list of features that can be selected when creating a new project:
28
+ - core: Always included (React 19 + TypeScript + Vite + Tailwind)
29
+ - routing: React Router with lazy loading
30
+ - ui: Shadcn/UI + icons + theming
31
+ - forms: React Hook Form + Zod validation
32
+ - state: Zustand state management
33
+ - api: TanStack Query + API client
34
+ - i18n: LinguiJS internationalization
35
+ - testing: Vitest + Playwright + MSW
36
+ - devtools: ESLint + Prettier + Husky
37
+ - ci: GitHub Actions + Lighthouse
38
+
39
+ Use this to understand available options before scaffolding a project.`,
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: {},
43
+ required: [],
44
+ },
45
+ };
46
+ //# sourceMappingURL=get-features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-features.js","sourceRoot":"","sources":["../../src/tools/get-features.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAY7D,MAAM,UAAU,WAAW;IACzB,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAkB,EAAE;QAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO;YAC7B,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE;;;;;;;;;;;;;;uEAcwD;IACrE,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAc;KACzB;CACF,CAAC"}