create-mcp-use-app 0.4.3 → 0.4.4-canary.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.
- package/README.md +10 -10
- package/dist/index.js +102 -13
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
<img src="https://img.shields.io/npm/dw/create-mcp-use-app.svg"/></a>
|
|
14
14
|
<a href="https://www.npmjs.com/package/create-mcp-use-app" alt="NPM Version">
|
|
15
15
|
<img src="https://img.shields.io/npm/v/create-mcp-use-app.svg"/></a>
|
|
16
|
-
<a href="https://github.com/mcp-use/mcp-use
|
|
16
|
+
<a href="https://github.com/mcp-use/mcp-use/blob/main/LICENSE" alt="License">
|
|
17
17
|
<img src="https://img.shields.io/github/license/mcp-use/mcp-use-ts" /></a>
|
|
18
|
-
<a href="https://github.com/mcp-use/mcp-use
|
|
18
|
+
<a href="https://github.com/mcp-use/mcp-use/stargazers" alt="GitHub stars">
|
|
19
19
|
<img src="https://img.shields.io/github/stars/mcp-use/mcp-use-ts?style=social" /></a>
|
|
20
20
|
<a href="https://discord.gg/XkNkSkMz3V" alt="Discord">
|
|
21
21
|
<img src="https://dcbadge.limes.pink/api/server/XkNkSkMz3V?style=flat" /></a>
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
|
|
28
28
|
| Package | Description | Version |
|
|
29
29
|
| ---------------------------------------------------------------------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
30
|
-
| [mcp-use](https://github.com/mcp-use/mcp-use
|
|
31
|
-
| [@mcp-use/cli](https://github.com/mcp-use/mcp-use
|
|
32
|
-
| [@mcp-use/inspector](https://github.com/mcp-use/mcp-use
|
|
30
|
+
| [mcp-use](https://github.com/mcp-use/mcp-use/tree/main/packages/mcp-use) | Core MCP framework | [](https://www.npmjs.com/package/mcp-use) |
|
|
31
|
+
| [@mcp-use/cli](https://github.com/mcp-use/mcp-use/tree/main/packages/cli) | Build tool for MCP apps | [](https://www.npmjs.com/package/@mcp-use/cli) |
|
|
32
|
+
| [@mcp-use/inspector](https://github.com/mcp-use/mcp-use/tree/main/packages/inspector) | Web-based MCP inspector | [](https://www.npmjs.com/package/@mcp-use/inspector) |
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -439,17 +439,17 @@ We welcome contributions! To contribute:
|
|
|
439
439
|
3. Make your changes
|
|
440
440
|
4. Submit a pull request
|
|
441
441
|
|
|
442
|
-
See our [contributing guide](https://github.com/mcp-use/mcp-use
|
|
442
|
+
See our [contributing guide](https://github.com/mcp-use/mcp-use/blob/main/CONTRIBUTING.md) for more details.
|
|
443
443
|
|
|
444
444
|
---
|
|
445
445
|
|
|
446
446
|
## 📚 Learn More
|
|
447
447
|
|
|
448
|
-
- [mcp-use Documentation](https://github.com/mcp-use/mcp-use
|
|
448
|
+
- [mcp-use Documentation](https://github.com/mcp-use/mcp-use)
|
|
449
449
|
- [Model Context Protocol Spec](https://modelcontextprotocol.io)
|
|
450
|
-
- [Creating MCP Tools](https://github.com/mcp-use/mcp-use
|
|
451
|
-
- [Building UI Widgets](https://github.com/mcp-use/mcp-use
|
|
452
|
-
- [Using the Inspector](https://github.com/mcp-use/mcp-use
|
|
450
|
+
- [Creating MCP Tools](https://github.com/mcp-use/mcp-use/tree/main/packages/mcp-use#-mcp-server-framework)
|
|
451
|
+
- [Building UI Widgets](https://github.com/mcp-use/mcp-use/tree/main/packages/cli#-creating-ui-widgets)
|
|
452
|
+
- [Using the Inspector](https://github.com/mcp-use/mcp-use/tree/main/packages/inspector)
|
|
453
453
|
|
|
454
454
|
---
|
|
455
455
|
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,39 @@ function runPackageManager(packageManager, args, cwd) {
|
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
function detectPackageManager() {
|
|
35
|
+
const userAgent = process.env.npm_config_user_agent || "";
|
|
36
|
+
if (userAgent.includes("yarn")) {
|
|
37
|
+
return "yarn";
|
|
38
|
+
} else if (userAgent.includes("pnpm")) {
|
|
39
|
+
return "pnpm";
|
|
40
|
+
} else if (userAgent.includes("npm")) {
|
|
41
|
+
return "npm";
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
function getDevCommand(packageManager) {
|
|
46
|
+
switch (packageManager) {
|
|
47
|
+
case "yarn":
|
|
48
|
+
return "yarn dev";
|
|
49
|
+
case "pnpm":
|
|
50
|
+
return "pnpm dev";
|
|
51
|
+
case "npm":
|
|
52
|
+
default:
|
|
53
|
+
return "npm run dev";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function getInstallCommand(packageManager) {
|
|
57
|
+
switch (packageManager) {
|
|
58
|
+
case "yarn":
|
|
59
|
+
return "yarn";
|
|
60
|
+
case "pnpm":
|
|
61
|
+
return "pnpm install";
|
|
62
|
+
case "npm":
|
|
63
|
+
default:
|
|
64
|
+
return "npm install";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
34
67
|
var program = new Command();
|
|
35
68
|
function renderLogo() {
|
|
36
69
|
console.log(chalk.cyan("\u259B\u259B\u258C\u259B\u2598\u259B\u258C\u2584\u2596\u258C\u258C\u259B\u2598\u2588\u258C"));
|
|
@@ -89,7 +122,7 @@ function processTemplateFile(filePath, versions, isDevelopment = false, useCanar
|
|
|
89
122
|
}
|
|
90
123
|
return processedContent;
|
|
91
124
|
}
|
|
92
|
-
program.name("create-mcp-use-app").description("Create a new MCP server project").version(packageJson.version).argument("[project-name]", "Name of the MCP server project").option("-t, --template <template>", "Template to use", "simple").option("--no-install", "Skip installing dependencies").option("--dev", "Use workspace dependencies for development").option("--canary", "Use canary versions of packages").action(async (projectName, options) => {
|
|
125
|
+
program.name("create-mcp-use-app").description("Create a new MCP server project").version(packageJson.version).argument("[project-name]", "Name of the MCP server project").option("-t, --template <template>", "Template to use", "simple").option("--no-install", "Skip installing dependencies").option("--dev", "Use workspace dependencies for development").option("--canary", "Use canary versions of packages").option("--yarn", "Use yarn as package manager").option("--npm", "Use npm as package manager").option("--pnpm", "Use pnpm as package manager").action(async (projectName, options) => {
|
|
93
126
|
try {
|
|
94
127
|
let selectedTemplate = options.template;
|
|
95
128
|
if (!projectName) {
|
|
@@ -130,20 +163,76 @@ program.name("create-mcp-use-app").description("Create a new MCP server project"
|
|
|
130
163
|
const versions = getCurrentPackageVersions(options.dev, options.canary);
|
|
131
164
|
await copyTemplate(projectPath, validatedTemplate, versions, options.dev, options.canary);
|
|
132
165
|
updatePackageJson(projectPath, sanitizedProjectName);
|
|
166
|
+
let usedPackageManager = "npm";
|
|
167
|
+
if (options.yarn) {
|
|
168
|
+
usedPackageManager = "yarn";
|
|
169
|
+
} else if (options.npm) {
|
|
170
|
+
usedPackageManager = "npm";
|
|
171
|
+
} else if (options.pnpm) {
|
|
172
|
+
usedPackageManager = "pnpm";
|
|
173
|
+
} else {
|
|
174
|
+
const detected = detectPackageManager();
|
|
175
|
+
if (detected) {
|
|
176
|
+
usedPackageManager = detected;
|
|
177
|
+
} else {
|
|
178
|
+
const defaultOrder = ["yarn", "npm", "pnpm"];
|
|
179
|
+
usedPackageManager = defaultOrder[0];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
133
182
|
if (options.install) {
|
|
134
|
-
const
|
|
183
|
+
const showSpinner = usedPackageManager !== "yarn" && usedPackageManager !== "npm";
|
|
184
|
+
const spinner = showSpinner ? ora("Installing packages...").start() : null;
|
|
135
185
|
try {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
186
|
+
if (options.yarn || options.npm || options.pnpm || detectPackageManager()) {
|
|
187
|
+
if (!showSpinner) {
|
|
188
|
+
console.log("");
|
|
189
|
+
}
|
|
190
|
+
await runPackageManager(usedPackageManager, ["install"], projectPath);
|
|
191
|
+
if (spinner) {
|
|
192
|
+
spinner.succeed(`Packages installed successfully with ${usedPackageManager}`);
|
|
193
|
+
} else {
|
|
194
|
+
console.log("");
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
if (spinner) spinner.text = "Installing packages (trying yarn)...";
|
|
198
|
+
try {
|
|
199
|
+
if (!spinner) console.log("");
|
|
200
|
+
await runPackageManager("yarn", ["install"], projectPath);
|
|
201
|
+
usedPackageManager = "yarn";
|
|
202
|
+
if (spinner) {
|
|
203
|
+
spinner.succeed("Packages installed successfully with yarn");
|
|
204
|
+
} else {
|
|
205
|
+
console.log("");
|
|
206
|
+
}
|
|
207
|
+
} catch {
|
|
208
|
+
if (spinner) spinner.text = "yarn not found, trying npm...";
|
|
209
|
+
try {
|
|
210
|
+
await runPackageManager("npm", ["install"], projectPath);
|
|
211
|
+
usedPackageManager = "npm";
|
|
212
|
+
if (spinner) {
|
|
213
|
+
spinner.succeed("Packages installed successfully with npm");
|
|
214
|
+
} else {
|
|
215
|
+
console.log("");
|
|
216
|
+
}
|
|
217
|
+
} catch {
|
|
218
|
+
if (spinner) spinner.text = "npm not found, trying pnpm...";
|
|
219
|
+
await runPackageManager("pnpm", ["install"], projectPath);
|
|
220
|
+
usedPackageManager = "pnpm";
|
|
221
|
+
if (spinner) {
|
|
222
|
+
spinner.succeed("Packages installed successfully with pnpm");
|
|
223
|
+
} else {
|
|
224
|
+
console.log("");
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
} catch (error) {
|
|
230
|
+
if (spinner) {
|
|
144
231
|
spinner.fail("Package installation failed");
|
|
145
|
-
|
|
232
|
+
} else {
|
|
233
|
+
console.log("\u274C Package installation failed");
|
|
146
234
|
}
|
|
235
|
+
console.log('\u26A0\uFE0F Please run "npm install", "yarn install", or "pnpm install" manually');
|
|
147
236
|
}
|
|
148
237
|
}
|
|
149
238
|
console.log("");
|
|
@@ -172,9 +261,9 @@ program.name("create-mcp-use-app").description("Create a new MCP server project"
|
|
|
172
261
|
console.log(chalk.bold("\u{1F680} To get started:"));
|
|
173
262
|
console.log(chalk.cyan(` cd ${sanitizedProjectName}`));
|
|
174
263
|
if (!options.install) {
|
|
175
|
-
console.log(chalk.cyan(
|
|
264
|
+
console.log(chalk.cyan(` ${getInstallCommand(usedPackageManager)}`));
|
|
176
265
|
}
|
|
177
|
-
console.log(chalk.cyan(
|
|
266
|
+
console.log(chalk.cyan(` ${getDevCommand(usedPackageManager)}`));
|
|
178
267
|
console.log("");
|
|
179
268
|
if (options.dev) {
|
|
180
269
|
console.log(chalk.yellow("\u{1F4A1} Development mode: Your project uses workspace dependencies"));
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mcp-use-app",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4-canary.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Create MCP-Use apps with one command",
|
|
6
6
|
"author": "mcp-use, Inc.",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"homepage": "https://github.com/mcp-use/mcp-use
|
|
8
|
+
"homepage": "https://github.com/mcp-use/mcp-use#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/mcp-use/mcp-use
|
|
11
|
+
"url": "git+https://github.com/mcp-use/mcp-use.git",
|
|
12
12
|
"directory": "packages/create-mcp-use-app"
|
|
13
13
|
},
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/mcp-use/mcp-use
|
|
15
|
+
"url": "https://github.com/mcp-use/mcp-use/issues"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"mcp",
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
"copy-templates": "node scripts/copy-templates.js",
|
|
60
60
|
"dev": "tsc --build --watch",
|
|
61
61
|
"test": "vitest --run --passWithNoTests",
|
|
62
|
+
"test:cli": "./test-cli.sh",
|
|
63
|
+
"test:cli:full": "RUN_INSTALL_TESTS=yes ./test-cli.sh",
|
|
62
64
|
"lint": "eslint ."
|
|
63
65
|
}
|
|
64
66
|
}
|