create-mcp-use-app 0.4.4-canary.1 → 0.4.4
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/dist/index.js
CHANGED
|
@@ -360,12 +360,21 @@ async function promptForProjectName() {
|
|
|
360
360
|
}
|
|
361
361
|
async function promptForTemplate() {
|
|
362
362
|
const templatesDir = join(__dirname, "templates");
|
|
363
|
-
const availableTemplates =
|
|
364
|
-
const templateDescriptions = {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
363
|
+
const availableTemplates = readdirSync(templatesDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
|
|
364
|
+
const templateDescriptions = {};
|
|
365
|
+
for (const template2 of availableTemplates) {
|
|
366
|
+
const packageJsonPath = join(templatesDir, template2, "package.json");
|
|
367
|
+
if (existsSync(packageJsonPath)) {
|
|
368
|
+
try {
|
|
369
|
+
const packageJson2 = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
370
|
+
templateDescriptions[template2] = packageJson2.description || "MCP server template";
|
|
371
|
+
} catch (error) {
|
|
372
|
+
templateDescriptions[template2] = "MCP server template";
|
|
373
|
+
}
|
|
374
|
+
} else {
|
|
375
|
+
templateDescriptions[template2] = "MCP server template";
|
|
376
|
+
}
|
|
377
|
+
}
|
|
369
378
|
const { template } = await inquirer.prompt([
|
|
370
379
|
{
|
|
371
380
|
type: "list",
|
|
@@ -179,15 +179,17 @@ server.prompt({
|
|
|
179
179
|
{ name: 'code', type: 'string', required: true }
|
|
180
180
|
],
|
|
181
181
|
cb: async (params: Record<string, any>) => {
|
|
182
|
-
const code = params
|
|
182
|
+
const { code } = params
|
|
183
183
|
return {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
text: `Please review this code:\n\n${code}`
|
|
184
|
+
messages: [{
|
|
185
|
+
role: 'user',
|
|
186
|
+
content: {type: 'text', text: `Please review this code:\n\n${code}`}
|
|
187
187
|
}]
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
})
|
|
191
191
|
|
|
192
|
+
const PORT = process.env.PORT ? parseInt(process.env.PORT) : 3000
|
|
193
|
+
console.log(`Server running on port ${PORT}`)
|
|
192
194
|
// Start the server
|
|
193
|
-
server.listen(
|
|
195
|
+
server.listen(PORT)
|