create-catalyst-app-internal 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/cli.cjs +8 -7
- package/templates/none-js/package.json +1 -1
- package/templates/none-ts/package.json +1 -1
- package/templates/redux-js/package.json +1 -1
- package/templates/redux-ts/package.json +1 -1
- package/templates/rtk-js/package.json +1 -1
- package/templates/rtk-ts/package.json +1 -1
- package/templates/mcp-root/mcp/mcp.js +0 -55
package/package.json
CHANGED
package/scripts/cli.cjs
CHANGED
|
@@ -43,6 +43,12 @@ const program = new Commander.Command()
|
|
|
43
43
|
return
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
if (process.argv.includes("mcp-setup")) {
|
|
47
|
+
const setupPath = path.join(process.cwd(), "node_modules/catalyst-core-internal/mcp_v2/setup.js")
|
|
48
|
+
execSync(`node ${setupPath}`, { stdio: "inherit" })
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
|
|
46
52
|
console.log(cyan(`Using create-catalyst-app version ${bold(packageJson.version)}`))
|
|
47
53
|
|
|
48
54
|
// Use options provided through commander or prompt the user
|
|
@@ -93,11 +99,8 @@ const program = new Commander.Command()
|
|
|
93
99
|
const commonCodeDirectory = "package/templates/common"
|
|
94
100
|
const selectedTemplateCode = `package/templates/${repositorySuffixes[stateManagement]}-${repositorySuffixes[language]}`
|
|
95
101
|
const tailwindCodeDirectory = "package/templates/tailwind"
|
|
96
|
-
const mcpCodeDirectory = "package/templates/mcp-root"
|
|
97
|
-
|
|
98
102
|
const subDirectoriesToExtract = [commonCodeDirectory, selectedTemplateCode]
|
|
99
103
|
if (tailWindSupport) subDirectoriesToExtract.push(tailwindCodeDirectory)
|
|
100
|
-
if (mcpSupport) subDirectoriesToExtract.push(mcpCodeDirectory)
|
|
101
104
|
|
|
102
105
|
const extractionDestination = `/${projectName}/`
|
|
103
106
|
let tempDir
|
|
@@ -122,7 +125,8 @@ const program = new Commander.Command()
|
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
if (mcpSupport) {
|
|
125
|
-
|
|
128
|
+
const setupPath = path.join(process.cwd(), projectName, "node_modules/catalyst-core-internal/mcp_v2/setup.js")
|
|
129
|
+
execSync(`node ${setupPath}`, { stdio: "inherit" })
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
execSync(
|
|
@@ -203,9 +207,6 @@ const program = new Commander.Command()
|
|
|
203
207
|
if (entry.path.startsWith(tailwindCodeDirectory)) {
|
|
204
208
|
entry.path = entry.path.replace(tailwindCodeDirectory, extractionDestination)
|
|
205
209
|
}
|
|
206
|
-
if (entry.path.startsWith(mcpCodeDirectory)) {
|
|
207
|
-
entry.path = entry.path.replace(mcpCodeDirectory, extractionDestination)
|
|
208
|
-
}
|
|
209
210
|
},
|
|
210
211
|
})
|
|
211
212
|
} catch (e) {
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const { McpServer } = require("@modelcontextprotocol/sdk/server/mcp.js")
|
|
2
|
-
const { StdioServerTransport } = require("@modelcontextprotocol/sdk/server/stdio.js")
|
|
3
|
-
|
|
4
|
-
const fetchContextFromGitHub = async () => {
|
|
5
|
-
const url = "https://raw.githubusercontent.com/tata1mg/catalyst-core-internal/main/context.md"
|
|
6
|
-
const response = await fetch(url)
|
|
7
|
-
|
|
8
|
-
if (!response.ok) {
|
|
9
|
-
throw new Error(`HTTP ${response.status}: Failed to fetch context from GitHub`)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return await response.text()
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const server = new McpServer({
|
|
16
|
-
name: "catalyst",
|
|
17
|
-
version: "1.0.0",
|
|
18
|
-
capabilities: {
|
|
19
|
-
tools: {},
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
server.tool("get_context", "Complete context of catalyst framework", {}, async () => {
|
|
24
|
-
try {
|
|
25
|
-
const context = await fetchContextFromGitHub()
|
|
26
|
-
return {
|
|
27
|
-
content: [
|
|
28
|
-
{
|
|
29
|
-
type: "text",
|
|
30
|
-
text: context,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
}
|
|
34
|
-
} catch (error) {
|
|
35
|
-
return {
|
|
36
|
-
content: [
|
|
37
|
-
{
|
|
38
|
-
type: "text",
|
|
39
|
-
text: `Error fetching context: ${error.message}`,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
const init = async () => {
|
|
47
|
-
try {
|
|
48
|
-
const transport = new StdioServerTransport()
|
|
49
|
-
await server.connect(transport)
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.error("Error starting MCP server:", error)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
init()
|