mcp-new 1.2.2 → 1.5.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 (47) hide show
  1. package/README.md +33 -1
  2. package/dist/{chunk-3JG4FVS2.js → chunk-YISSMIHU.js} +222 -46
  3. package/dist/cli.js +334 -15
  4. package/dist/index.d.ts +25 -7
  5. package/dist/index.js +17 -3
  6. package/package.json +1 -1
  7. package/templates/csharp/.env.example +6 -0
  8. package/templates/csharp/.gitignore.ejs +53 -0
  9. package/templates/csharp/McpServer.csproj.ejs +19 -0
  10. package/templates/csharp/README.md.ejs +136 -0
  11. package/templates/csharp/src/Program.cs.ejs +117 -0
  12. package/templates/elixir/.env.example +6 -0
  13. package/templates/elixir/.gitignore.ejs +33 -0
  14. package/templates/elixir/README.md.ejs +154 -0
  15. package/templates/elixir/config/config.exs.ejs +9 -0
  16. package/templates/elixir/config/dev.exs.ejs +3 -0
  17. package/templates/elixir/config/prod.exs.ejs +3 -0
  18. package/templates/elixir/lib/application.ex.ejs +19 -0
  19. package/templates/elixir/lib/cli.ex.ejs +17 -0
  20. package/templates/elixir/lib/server.ex.ejs +112 -0
  21. package/templates/elixir/mix.exs.ejs +32 -0
  22. package/templates/java/gradle/.env.example +6 -0
  23. package/templates/java/gradle/.gitignore.ejs +48 -0
  24. package/templates/java/gradle/README.md.ejs +132 -0
  25. package/templates/java/gradle/build.gradle.ejs +46 -0
  26. package/templates/java/gradle/settings.gradle.ejs +1 -0
  27. package/templates/java/gradle/src/main/java/com/example/mcp/McpServer.java.ejs +149 -0
  28. package/templates/java/gradle/src/main/resources/logback.xml +13 -0
  29. package/templates/java/maven/.env.example +6 -0
  30. package/templates/java/maven/.gitignore.ejs +53 -0
  31. package/templates/java/maven/README.md.ejs +131 -0
  32. package/templates/java/maven/pom.xml.ejs +86 -0
  33. package/templates/java/maven/src/main/java/com/example/mcp/McpServer.java.ejs +149 -0
  34. package/templates/java/maven/src/main/resources/logback.xml +13 -0
  35. package/templates/kotlin/gradle/.env.example +6 -0
  36. package/templates/kotlin/gradle/.gitignore.ejs +45 -0
  37. package/templates/kotlin/gradle/README.md.ejs +138 -0
  38. package/templates/kotlin/gradle/build.gradle.kts.ejs +48 -0
  39. package/templates/kotlin/gradle/settings.gradle.kts.ejs +1 -0
  40. package/templates/kotlin/gradle/src/main/kotlin/com/example/mcp/McpServer.kt.ejs +141 -0
  41. package/templates/kotlin/gradle/src/main/resources/logback.xml +13 -0
  42. package/templates/kotlin/maven/.env.example +6 -0
  43. package/templates/kotlin/maven/.gitignore.ejs +50 -0
  44. package/templates/kotlin/maven/README.md.ejs +96 -0
  45. package/templates/kotlin/maven/pom.xml.ejs +105 -0
  46. package/templates/kotlin/maven/src/main/kotlin/com/example/mcp/McpServer.kt.ejs +141 -0
  47. package/templates/kotlin/maven/src/main/resources/logback.xml +13 -0
package/README.md CHANGED
@@ -40,8 +40,9 @@ mcp-new my-server
40
40
  | Feature | Description |
41
41
  |---------|-------------|
42
42
  | 🧙 **Interactive Wizard** | Step-by-step prompts to configure your MCP server |
43
- | 🌍 **Multi-Language** | TypeScript, Python, Go, and Rust support |
43
+ | 🌍 **Multi-Language** | TypeScript, Python, Go, Rust, Java, Kotlin, C#, Elixir |
44
44
  | 📦 **Preset Templates** | Ready-to-use templates for common use cases |
45
+ | 🗂️ **Monorepo Support** | Manage multiple MCP servers in one workspace |
45
46
  | 📄 **OpenAPI Import** | Auto-generate tools from OpenAPI/Swagger specs |
46
47
  | 🤖 **AI Generation** | Create tools from natural language using Claude |
47
48
  | 📚 **Rich Documentation** | Generated README with examples and Claude Desktop config |
@@ -94,6 +95,10 @@ mcp-new my-server -t # TypeScript
94
95
  mcp-new my-server -p # Python
95
96
  mcp-new my-server -g # Go
96
97
  mcp-new my-server -r # Rust
98
+ mcp-new my-server -j # Java
99
+ mcp-new my-server -k # Kotlin
100
+ mcp-new my-server -c # C#
101
+ mcp-new my-server -e # Elixir
97
102
 
98
103
  # Skip prompts with defaults
99
104
  mcp-new my-server -t -y
@@ -116,6 +121,23 @@ mcp-new my-server --from-prompt
116
121
 
117
122
  Describe your API in natural language, Claude generates the tools.
118
123
 
124
+ ### Monorepo Workspaces
125
+
126
+ Manage multiple MCP servers in one repository:
127
+
128
+ ```bash
129
+ # Create a workspace
130
+ mcp-new monorepo init my-workspace
131
+ cd my-workspace
132
+
133
+ # Add servers
134
+ mcp-new monorepo add api-server -t
135
+ mcp-new monorepo add data-service -p
136
+
137
+ # List all servers
138
+ mcp-new monorepo list
139
+ ```
140
+
119
141
  ### Additional Commands
120
142
 
121
143
  ```bash
@@ -152,6 +174,12 @@ Options:
152
174
  -p, --python Use Python
153
175
  -g, --go Use Go
154
176
  -r, --rust Use Rust
177
+ -j, --java Use Java
178
+ -k, --kotlin Use Kotlin
179
+ -c, --csharp Use C# (.NET)
180
+ -e, --elixir Use Elixir
181
+ --maven Use Maven (Java/Kotlin)
182
+ --gradle Use Gradle (Java/Kotlin)
155
183
  --preset <name> Use preset (database, rest-api, filesystem)
156
184
  --from-openapi <path> Generate from OpenAPI spec
157
185
  --from-prompt Generate using AI
@@ -166,6 +194,9 @@ Commands:
166
194
  list-presets List all available preset templates
167
195
  validate Validate current MCP server project
168
196
  upgrade Upgrade MCP SDK to latest version
197
+ monorepo init Create a monorepo workspace
198
+ monorepo add Add server to workspace
199
+ monorepo list List servers in workspace
169
200
  ```
170
201
 
171
202
  ### Generated Project Structure
@@ -279,6 +310,7 @@ For detailed documentation, see the [docs](./docs) folder:
279
310
  |----------|-------------|
280
311
  | [Getting Started](./docs/getting-started.md) | Installation and first steps |
281
312
  | [CLI Reference](./docs/cli-reference.md) | Complete command reference |
313
+ | [Monorepo](./docs/monorepo.md) | Manage multiple MCP servers |
282
314
  | [Presets](./docs/presets.md) | Pre-configured templates |
283
315
  | [Templates](./docs/templates.md) | Language-specific guides |
284
316
  | [OpenAPI Integration](./docs/openapi.md) | Generate from specs |
@@ -102,7 +102,11 @@ async function promptLanguage() {
102
102
  { name: "TypeScript", value: "typescript" },
103
103
  { name: "Python", value: "python" },
104
104
  { name: "Go", value: "go" },
105
- { name: "Rust", value: "rust" }
105
+ { name: "Rust", value: "rust" },
106
+ { name: "Java", value: "java" },
107
+ { name: "Kotlin", value: "kotlin" },
108
+ { name: "C# (.NET)", value: "csharp" },
109
+ { name: "Elixir", value: "elixir" }
106
110
  ],
107
111
  default: "typescript"
108
112
  }
@@ -314,10 +318,28 @@ async function promptMultipleResources() {
314
318
  return resources;
315
319
  }
316
320
 
317
- // src/prompts/generation-method.ts
321
+ // src/prompts/java-build-tool.ts
318
322
  import inquirer6 from "inquirer";
323
+ async function promptJavaBuildTool() {
324
+ const { buildTool } = await inquirer6.prompt([
325
+ {
326
+ type: "list",
327
+ name: "buildTool",
328
+ message: "Select Java build tool:",
329
+ choices: [
330
+ { name: "Maven (pom.xml)", value: "maven" },
331
+ { name: "Gradle (build.gradle)", value: "gradle" }
332
+ ],
333
+ default: "maven"
334
+ }
335
+ ]);
336
+ return buildTool;
337
+ }
338
+
339
+ // src/prompts/generation-method.ts
340
+ import inquirer7 from "inquirer";
319
341
  async function promptGenerationMethod() {
320
- const { method } = await inquirer6.prompt([
342
+ const { method } = await inquirer7.prompt([
321
343
  {
322
344
  type: "list",
323
345
  name: "method",
@@ -347,7 +369,7 @@ async function promptGenerationMethod() {
347
369
  }
348
370
 
349
371
  // src/prompts/preset.ts
350
- import inquirer7 from "inquirer";
372
+ import inquirer8 from "inquirer";
351
373
 
352
374
  // src/presets/database.ts
353
375
  var DATABASE_PRESET = {
@@ -677,7 +699,7 @@ async function promptPreset() {
677
699
  name: `${preset2.name} - ${preset2.description}`,
678
700
  value: preset2.id
679
701
  }));
680
- const { preset } = await inquirer7.prompt([
702
+ const { preset } = await inquirer8.prompt([
681
703
  {
682
704
  type: "list",
683
705
  name: "preset",
@@ -697,6 +719,10 @@ async function runWizard(options = {}) {
697
719
  description = await promptProjectDescription();
698
720
  }
699
721
  const language = options.presetLanguage || await promptLanguage();
722
+ let javaBuildTool;
723
+ if (language === "java" || language === "kotlin") {
724
+ javaBuildTool = options.presetJavaBuildTool || await promptJavaBuildTool();
725
+ }
700
726
  const transport = await promptTransport();
701
727
  const includeExampleTool = await promptIncludeExampleTool();
702
728
  let tools = [];
@@ -720,14 +746,19 @@ async function runWizard(options = {}) {
720
746
  resources,
721
747
  includeExampleTool,
722
748
  skipInstall: false,
723
- initGit: true
749
+ initGit: true,
750
+ javaBuildTool
724
751
  };
725
752
  }
726
- async function runQuickWizard(defaultName, presetLanguage) {
727
- const name = await promptProjectName(defaultName);
753
+ async function runQuickWizard(defaultName, presetLanguage, presetJavaBuildTool) {
754
+ const name = defaultName || await promptProjectName();
728
755
  const language = presetLanguage || await promptLanguage();
729
- const transport = await promptTransport();
730
- const includeExampleTool = await promptIncludeExampleTool();
756
+ let javaBuildTool;
757
+ if (language === "java" || language === "kotlin") {
758
+ javaBuildTool = presetJavaBuildTool || await promptJavaBuildTool();
759
+ }
760
+ const transport = "stdio";
761
+ const includeExampleTool = true;
731
762
  return {
732
763
  name,
733
764
  description: "",
@@ -737,7 +768,8 @@ async function runQuickWizard(defaultName, presetLanguage) {
737
768
  resources: [],
738
769
  includeExampleTool,
739
770
  skipInstall: false,
740
- initGit: true
771
+ initGit: true,
772
+ javaBuildTool
741
773
  };
742
774
  }
743
775
 
@@ -903,7 +935,7 @@ var logger = {
903
935
  });
904
936
  console.log(chalk.green("\u2514\u2500"));
905
937
  },
906
- nextSteps: (projectName, language) => {
938
+ nextSteps: (projectName, language, javaBuildTool) => {
907
939
  logger.blank();
908
940
  let installCmd;
909
941
  let runCmd;
@@ -924,6 +956,24 @@ var logger = {
924
956
  installCmd = "cargo build";
925
957
  runCmd = "cargo run";
926
958
  break;
959
+ case "java":
960
+ case "kotlin":
961
+ if (javaBuildTool === "gradle") {
962
+ installCmd = "./gradlew build";
963
+ runCmd = "./gradlew run";
964
+ } else {
965
+ installCmd = "mvn install";
966
+ runCmd = 'mvn exec:java -Dexec.mainClass="com.example.mcp.McpServer"';
967
+ }
968
+ break;
969
+ case "csharp":
970
+ installCmd = "dotnet restore";
971
+ runCmd = "dotnet run";
972
+ break;
973
+ case "elixir":
974
+ installCmd = "mix deps.get";
975
+ runCmd = "mix run --no-halt";
976
+ break;
927
977
  default:
928
978
  installCmd = "npm install";
929
979
  runCmd = "npm run dev";
@@ -1024,6 +1074,8 @@ var BaseGenerator = class {
1024
1074
  });
1025
1075
  }
1026
1076
  getTemplateData() {
1077
+ const cleanName = this.config.name.replace(/[^a-zA-Z0-9]/g, "");
1078
+ const capitalizedName = cleanName.charAt(0).toUpperCase() + cleanName.slice(1);
1027
1079
  return {
1028
1080
  name: this.config.name,
1029
1081
  description: this.config.description,
@@ -1031,7 +1083,12 @@ var BaseGenerator = class {
1031
1083
  transport: this.config.transport,
1032
1084
  tools: this.config.tools,
1033
1085
  resources: this.config.resources,
1034
- includeExampleTool: this.config.includeExampleTool
1086
+ includeExampleTool: this.config.includeExampleTool,
1087
+ javaBuildTool: this.config.javaBuildTool,
1088
+ // Helper for Java/Elixir package name (lowercase, no special chars)
1089
+ packageName: this.config.name.toLowerCase().replace(/[^a-z0-9]/g, ""),
1090
+ // Helper for C#/Elixir namespace (PascalCase)
1091
+ namespace: capitalizedName
1035
1092
  };
1036
1093
  }
1037
1094
  async installDependencies() {
@@ -1052,6 +1109,16 @@ var BaseGenerator = class {
1052
1109
  case "rust":
1053
1110
  await this.installRustDependencies();
1054
1111
  break;
1112
+ case "java":
1113
+ case "kotlin":
1114
+ await this.installJavaDependencies();
1115
+ break;
1116
+ case "csharp":
1117
+ await this.installDotnetDependencies();
1118
+ break;
1119
+ case "elixir":
1120
+ await this.installElixirDependencies();
1121
+ break;
1055
1122
  }
1056
1123
  }
1057
1124
  async installNodeDependencies() {
@@ -1123,6 +1190,88 @@ var BaseGenerator = class {
1123
1190
  "Failed to build project"
1124
1191
  );
1125
1192
  }
1193
+ async installJavaDependencies() {
1194
+ const buildTool = this.config.javaBuildTool || "maven";
1195
+ if (buildTool === "maven") {
1196
+ const hasMvn = await this.checkCommand("mvn");
1197
+ if (!hasMvn) {
1198
+ logger.warning("Maven not found. Please install dependencies manually:");
1199
+ logger.code("mvn install");
1200
+ return;
1201
+ }
1202
+ await withSpinner(
1203
+ "Installing Maven dependencies...",
1204
+ async () => {
1205
+ await execa2("mvn", ["install", "-DskipTests"], {
1206
+ cwd: this.outputDir
1207
+ });
1208
+ },
1209
+ "Dependencies installed",
1210
+ "Failed to install dependencies"
1211
+ );
1212
+ } else {
1213
+ const hasGradle = await this.checkCommand("gradle");
1214
+ const hasGradlew = await exists(path3.join(this.outputDir, "gradlew"));
1215
+ if (!hasGradle && !hasGradlew) {
1216
+ logger.warning("Gradle not found. Please install dependencies manually:");
1217
+ logger.code("gradle build");
1218
+ return;
1219
+ }
1220
+ const gradleCmd = hasGradlew ? "./gradlew" : "gradle";
1221
+ await withSpinner(
1222
+ "Installing Gradle dependencies...",
1223
+ async () => {
1224
+ await execa2(gradleCmd, ["build", "-x", "test"], {
1225
+ cwd: this.outputDir
1226
+ });
1227
+ },
1228
+ "Dependencies installed",
1229
+ "Failed to install dependencies"
1230
+ );
1231
+ }
1232
+ }
1233
+ async installDotnetDependencies() {
1234
+ const hasDotnet = await this.checkCommand("dotnet");
1235
+ if (!hasDotnet) {
1236
+ logger.warning(".NET SDK not found. Please install dependencies manually:");
1237
+ logger.code("dotnet restore");
1238
+ return;
1239
+ }
1240
+ await withSpinner(
1241
+ "Restoring .NET dependencies...",
1242
+ async () => {
1243
+ await execa2("dotnet", ["restore"], {
1244
+ cwd: this.outputDir
1245
+ });
1246
+ await execa2("dotnet", ["build"], {
1247
+ cwd: this.outputDir
1248
+ });
1249
+ },
1250
+ "Dependencies installed",
1251
+ "Failed to install dependencies"
1252
+ );
1253
+ }
1254
+ async installElixirDependencies() {
1255
+ const hasMix = await this.checkCommand("mix");
1256
+ if (!hasMix) {
1257
+ logger.warning("Elixir/Mix not found. Please install dependencies manually:");
1258
+ logger.code("mix deps.get");
1259
+ return;
1260
+ }
1261
+ await withSpinner(
1262
+ "Installing Elixir dependencies...",
1263
+ async () => {
1264
+ await execa2("mix", ["deps.get"], {
1265
+ cwd: this.outputDir
1266
+ });
1267
+ await execa2("mix", ["compile"], {
1268
+ cwd: this.outputDir
1269
+ });
1270
+ },
1271
+ "Dependencies installed",
1272
+ "Failed to install dependencies"
1273
+ );
1274
+ }
1126
1275
  async checkCommand(command) {
1127
1276
  try {
1128
1277
  const checkCmd = process.platform === "win32" ? "where" : "which";
@@ -1163,7 +1312,12 @@ var BaseGenerator = class {
1163
1312
  };
1164
1313
  function createGeneratorContext(config, outputPath) {
1165
1314
  const outputDir = outputPath || path3.resolve(process.cwd(), config.name);
1166
- const templateDir = path3.join(getTemplateDir(), config.language);
1315
+ let templateDir;
1316
+ if ((config.language === "java" || config.language === "kotlin") && config.javaBuildTool) {
1317
+ templateDir = path3.join(getTemplateDir(), config.language, config.javaBuildTool);
1318
+ } else {
1319
+ templateDir = path3.join(getTemplateDir(), config.language);
1320
+ }
1167
1321
  return {
1168
1322
  config,
1169
1323
  outputDir,
@@ -1201,7 +1355,7 @@ var WizardGenerator = class extends BaseGenerator {
1201
1355
  await this.installDependencies();
1202
1356
  await this.initializeGit();
1203
1357
  logger.success(`Project ${this.config.name} created successfully!`);
1204
- logger.nextSteps(this.config.name, this.config.language);
1358
+ logger.nextSteps(this.config.name, this.config.language, this.config.javaBuildTool);
1205
1359
  }
1206
1360
  };
1207
1361
  async function generateFromWizard(config, outputPath) {
@@ -1212,7 +1366,7 @@ async function generateFromWizard(config, outputPath) {
1212
1366
 
1213
1367
  // src/parsers/openapi.ts
1214
1368
  import YAML from "yaml";
1215
- import inquirer8 from "inquirer";
1369
+ import inquirer9 from "inquirer";
1216
1370
  async function parseOpenAPISpec(content) {
1217
1371
  let spec;
1218
1372
  try {
@@ -1312,7 +1466,7 @@ async function selectEndpoints(endpoints) {
1312
1466
  value: ep,
1313
1467
  checked: true
1314
1468
  }));
1315
- const { selected } = await inquirer8.prompt([
1469
+ const { selected } = await inquirer9.prompt([
1316
1470
  {
1317
1471
  type: "checkbox",
1318
1472
  name: "selected",
@@ -1359,9 +1513,7 @@ var OpenAPIGenerator = class extends BaseGenerator {
1359
1513
  logger.title(`Creating ${this.config.name} from OpenAPI`);
1360
1514
  const isSafe = await this.checkOutputDir();
1361
1515
  if (!isSafe) {
1362
- throw new Error(
1363
- `Directory ${this.outputDir} already exists and is not empty.`
1364
- );
1516
+ throw new Error(`Directory ${this.outputDir} already exists and is not empty.`);
1365
1517
  }
1366
1518
  await withSpinner(
1367
1519
  "Creating project structure...",
@@ -1381,7 +1533,7 @@ var OpenAPIGenerator = class extends BaseGenerator {
1381
1533
  await this.initializeGit();
1382
1534
  logger.success(`Project ${this.config.name} created successfully!`);
1383
1535
  logger.info(`Generated ${this.config.tools.length} tools from OpenAPI spec`);
1384
- logger.nextSteps(this.config.name, this.config.language);
1536
+ logger.nextSteps(this.config.name, this.config.language, this.config.javaBuildTool);
1385
1537
  }
1386
1538
  setEndpoints(endpoints) {
1387
1539
  this._endpoints = endpoints;
@@ -1415,7 +1567,8 @@ async function generateFromOpenAPI(specPath, baseConfig) {
1415
1567
  resources: [],
1416
1568
  includeExampleTool: false,
1417
1569
  skipInstall: baseConfig.skipInstall || false,
1418
- initGit: baseConfig.initGit !== false
1570
+ initGit: baseConfig.initGit !== false,
1571
+ javaBuildTool: baseConfig.javaBuildTool
1419
1572
  };
1420
1573
  const context = createGeneratorContext(config);
1421
1574
  const generator = new OpenAPIGenerator(context);
@@ -1448,7 +1601,7 @@ function mapOpenAPIType(type) {
1448
1601
 
1449
1602
  // src/generators/from-prompt.ts
1450
1603
  import Anthropic from "@anthropic-ai/sdk";
1451
- import inquirer9 from "inquirer";
1604
+ import inquirer10 from "inquirer";
1452
1605
  var SYSTEM_PROMPT = `You are an expert at designing MCP (Model Context Protocol) servers.
1453
1606
  Given a description of an API or functionality, you generate a list of tools that would be useful for that API.
1454
1607
 
@@ -1480,9 +1633,7 @@ var PromptGenerator = class extends BaseGenerator {
1480
1633
  logger.title(`Creating ${this.config.name}`);
1481
1634
  const isSafe = await this.checkOutputDir();
1482
1635
  if (!isSafe) {
1483
- throw new Error(
1484
- `Directory ${this.outputDir} already exists and is not empty.`
1485
- );
1636
+ throw new Error(`Directory ${this.outputDir} already exists and is not empty.`);
1486
1637
  }
1487
1638
  await withSpinner(
1488
1639
  "Creating project structure...",
@@ -1502,11 +1653,11 @@ var PromptGenerator = class extends BaseGenerator {
1502
1653
  await this.initializeGit();
1503
1654
  logger.success(`Project ${this.config.name} created successfully!`);
1504
1655
  logger.info(`Generated ${this.config.tools.length} tools from your description`);
1505
- logger.nextSteps(this.config.name, this.config.language);
1656
+ logger.nextSteps(this.config.name, this.config.language, this.config.javaBuildTool);
1506
1657
  }
1507
1658
  };
1508
1659
  async function generateFromPrompt(baseConfig) {
1509
- const { description } = await inquirer9.prompt([
1660
+ const { description } = await inquirer10.prompt([
1510
1661
  {
1511
1662
  type: "editor",
1512
1663
  name: "description",
@@ -1562,7 +1713,7 @@ async function generateFromPrompt(baseConfig) {
1562
1713
  logger.list([`${index + 1}. ${tool.name} - ${tool.description}`]);
1563
1714
  });
1564
1715
  logger.blank();
1565
- const { confirm } = await inquirer9.prompt([
1716
+ const { confirm } = await inquirer10.prompt([
1566
1717
  {
1567
1718
  type: "confirm",
1568
1719
  name: "confirm",
@@ -1582,7 +1733,8 @@ async function generateFromPrompt(baseConfig) {
1582
1733
  resources: [],
1583
1734
  includeExampleTool: false,
1584
1735
  skipInstall: baseConfig.skipInstall || false,
1585
- initGit: baseConfig.initGit !== false
1736
+ initGit: baseConfig.initGit !== false,
1737
+ javaBuildTool: baseConfig.javaBuildTool
1586
1738
  };
1587
1739
  const context = createGeneratorContext(config);
1588
1740
  const generator = new PromptGenerator(context);
@@ -1623,7 +1775,7 @@ var PresetGenerator = class extends BaseGenerator {
1623
1775
  logger.success(`Project ${this.config.name} created successfully!`);
1624
1776
  logger.info(`Preset: ${this.presetName}`);
1625
1777
  logger.info(`Tools included: ${this.config.tools.map((t) => t.name).join(", ")}`);
1626
- logger.nextSteps(this.config.name, this.config.language);
1778
+ logger.nextSteps(this.config.name, this.config.language, this.config.javaBuildTool);
1627
1779
  }
1628
1780
  };
1629
1781
  async function generateFromPreset(options) {
@@ -1634,6 +1786,10 @@ async function generateFromPreset(options) {
1634
1786
  const name = options.projectName || await promptProjectName();
1635
1787
  const description = options.useDefaults ? "" : await promptProjectDescription();
1636
1788
  const language = options.language || (options.useDefaults ? "typescript" : await promptLanguage());
1789
+ let javaBuildTool;
1790
+ if (language === "java" || language === "kotlin") {
1791
+ javaBuildTool = options.javaBuildTool || (options.useDefaults ? "maven" : await promptJavaBuildTool());
1792
+ }
1637
1793
  const transport = options.useDefaults ? "stdio" : await promptTransport();
1638
1794
  const config = {
1639
1795
  name,
@@ -1644,7 +1800,8 @@ async function generateFromPreset(options) {
1644
1800
  resources: [],
1645
1801
  includeExampleTool: false,
1646
1802
  skipInstall: options.skipInstall || false,
1647
- initGit: true
1803
+ initGit: true,
1804
+ javaBuildTool
1648
1805
  };
1649
1806
  const context = createGeneratorContext(config);
1650
1807
  const generator = new PresetGenerator(context, preset.name);
@@ -1653,15 +1810,29 @@ async function generateFromPreset(options) {
1653
1810
  function validatePresetId(presetId) {
1654
1811
  if (!isValidPresetId(presetId)) {
1655
1812
  const validPresets = ["database", "rest-api", "filesystem"];
1656
- throw new Error(
1657
- `Invalid preset "${presetId}". Valid presets are: ${validPresets.join(", ")}`
1658
- );
1813
+ throw new Error(`Invalid preset "${presetId}". Valid presets are: ${validPresets.join(", ")}`);
1659
1814
  }
1660
1815
  return true;
1661
1816
  }
1662
1817
 
1663
1818
  // src/commands/create.ts
1664
1819
  import path4 from "path";
1820
+ function getLanguageFromOptions(options) {
1821
+ if (options.typescript) return "typescript";
1822
+ if (options.python) return "python";
1823
+ if (options.go) return "go";
1824
+ if (options.rust) return "rust";
1825
+ if (options.java) return "java";
1826
+ if (options.kotlin) return "kotlin";
1827
+ if (options.csharp) return "csharp";
1828
+ if (options.elixir) return "elixir";
1829
+ return void 0;
1830
+ }
1831
+ function getJavaBuildToolFromOptions(options) {
1832
+ if (options.maven) return "maven";
1833
+ if (options.gradle) return "gradle";
1834
+ return void 0;
1835
+ }
1665
1836
  async function createCommand(projectName, options) {
1666
1837
  try {
1667
1838
  if (options.preset) {
@@ -1688,11 +1859,12 @@ async function createCommand(projectName, options) {
1688
1859
  }
1689
1860
  async function handleWizardGeneration(projectName, options) {
1690
1861
  let config;
1691
- const presetLanguage = options.typescript ? "typescript" : options.python ? "python" : options.go ? "go" : options.rust ? "rust" : void 0;
1862
+ const presetLanguage = getLanguageFromOptions(options);
1863
+ const presetJavaBuildTool = getJavaBuildToolFromOptions(options);
1692
1864
  if (options.yes) {
1693
- config = await runQuickWizard(projectName, presetLanguage);
1865
+ config = await runQuickWizard(projectName, presetLanguage, presetJavaBuildTool);
1694
1866
  } else {
1695
- config = await runWizard({ defaultName: projectName, presetLanguage });
1867
+ config = await runWizard({ defaultName: projectName, presetLanguage, presetJavaBuildTool });
1696
1868
  }
1697
1869
  if (options.skipInstall) {
1698
1870
  config.skipInstall = true;
@@ -1716,15 +1888,17 @@ async function handleOpenAPIGeneration(projectName, options) {
1716
1888
  const name = projectName || path4.basename(specPath, path4.extname(specPath)) + "-mcp";
1717
1889
  await generateFromOpenAPI(specPath, {
1718
1890
  name,
1719
- language: options.typescript ? "typescript" : options.python ? "python" : options.go ? "go" : options.rust ? "rust" : void 0,
1720
- skipInstall: options.skipInstall
1891
+ language: getLanguageFromOptions(options),
1892
+ skipInstall: options.skipInstall,
1893
+ javaBuildTool: getJavaBuildToolFromOptions(options)
1721
1894
  });
1722
1895
  }
1723
1896
  async function handlePromptGeneration(projectName, options) {
1724
1897
  await generateFromPrompt({
1725
1898
  name: projectName,
1726
- language: options.typescript ? "typescript" : options.python ? "python" : options.go ? "go" : options.rust ? "rust" : void 0,
1727
- skipInstall: options.skipInstall
1899
+ language: getLanguageFromOptions(options),
1900
+ skipInstall: options.skipInstall,
1901
+ javaBuildTool: getJavaBuildToolFromOptions(options)
1728
1902
  });
1729
1903
  }
1730
1904
  async function handlePresetGeneration(projectName, options) {
@@ -1733,15 +1907,16 @@ async function handlePresetGeneration(projectName, options) {
1733
1907
  await generateFromPreset({
1734
1908
  projectName,
1735
1909
  presetId,
1736
- language: options.typescript ? "typescript" : options.python ? "python" : options.go ? "go" : options.rust ? "rust" : void 0,
1910
+ language: getLanguageFromOptions(options),
1737
1911
  skipInstall: options.skipInstall,
1738
- useDefaults: options.yes
1912
+ useDefaults: options.yes,
1913
+ javaBuildTool: getJavaBuildToolFromOptions(options)
1739
1914
  });
1740
1915
  }
1741
1916
 
1742
1917
  // src/commands/init.ts
1743
1918
  import path5 from "path";
1744
- import inquirer10 from "inquirer";
1919
+ import inquirer11 from "inquirer";
1745
1920
  async function initCommand(options) {
1746
1921
  try {
1747
1922
  const currentDir = process.cwd();
@@ -1751,7 +1926,7 @@ async function initCommand(options) {
1751
1926
  const hasGoMod = await exists(path5.join(currentDir, "go.mod"));
1752
1927
  const hasCargoToml = await exists(path5.join(currentDir, "Cargo.toml"));
1753
1928
  if ((hasPackageJson || hasPyproject || hasGoMod || hasCargoToml) && !options.force) {
1754
- const { proceed } = await inquirer10.prompt([
1929
+ const { proceed } = await inquirer11.prompt([
1755
1930
  {
1756
1931
  type: "confirm",
1757
1932
  name: "proceed",
@@ -2218,6 +2393,7 @@ export {
2218
2393
  promptAddResources,
2219
2394
  promptResourceConfig,
2220
2395
  promptMultipleResources,
2396
+ promptJavaBuildTool,
2221
2397
  promptGenerationMethod,
2222
2398
  PRESETS,
2223
2399
  promptPreset,