n8n-nodes-claude-code-cli 1.6.0 → 1.7.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/dist/index.js CHANGED
@@ -174139,6 +174139,148 @@ var agentsDescription = [
174139
174139
  }
174140
174140
  ];
174141
174141
 
174142
+ // nodes/ClaudeCode/descriptions/mcpServersDescription.ts
174143
+ var mcpServersDescription = [
174144
+ {
174145
+ displayName: "MCP Servers",
174146
+ name: "mcpServers",
174147
+ type: "fixedCollection",
174148
+ typeOptions: {
174149
+ multipleValues: true,
174150
+ multipleValueButtonText: "Add MCP Server"
174151
+ },
174152
+ default: { serversList: [] },
174153
+ displayOptions: {
174154
+ show: {
174155
+ operation: ["executePrompt", "executeWithContext"]
174156
+ }
174157
+ },
174158
+ options: [
174159
+ {
174160
+ name: "serversList",
174161
+ displayName: "Servers",
174162
+ values: [
174163
+ {
174164
+ displayName: "Server Name",
174165
+ name: "name",
174166
+ type: "string",
174167
+ default: "",
174168
+ required: true,
174169
+ placeholder: "slack",
174170
+ description: "Unique identifier for this MCP server."
174171
+ },
174172
+ {
174173
+ displayName: "Transport Type",
174174
+ name: "serverType",
174175
+ type: "options",
174176
+ options: [
174177
+ { name: "Stdio", value: "stdio" },
174178
+ { name: "HTTP", value: "http" }
174179
+ ],
174180
+ default: "stdio",
174181
+ description: "Transport protocol for communicating with the MCP server."
174182
+ },
174183
+ {
174184
+ displayName: "Command",
174185
+ name: "command",
174186
+ type: "string",
174187
+ default: "",
174188
+ required: true,
174189
+ placeholder: "npx -y @modelcontextprotocol/server-slack",
174190
+ description: "Full command to launch the MCP server. Arguments after the executable are automatically extracted (e.g. 'npx -y @org/server --key val' becomes command='npx', args=['-y','@org/server','--key','val']).",
174191
+ displayOptions: {
174192
+ show: {
174193
+ serverType: ["stdio"]
174194
+ }
174195
+ }
174196
+ },
174197
+ {
174198
+ displayName: "Arguments",
174199
+ name: "args",
174200
+ type: "string",
174201
+ default: "",
174202
+ placeholder: "--port,3000,--verbose",
174203
+ description: "Comma-separated arguments to pass to the command.",
174204
+ displayOptions: {
174205
+ show: {
174206
+ serverType: ["stdio"]
174207
+ }
174208
+ }
174209
+ },
174210
+ {
174211
+ displayName: "Environment Variables",
174212
+ name: "env",
174213
+ type: "string",
174214
+ typeOptions: { rows: 2 },
174215
+ default: "",
174216
+ placeholder: '{"SLACK_TOKEN": "xoxb-..."}',
174217
+ description: "JSON object of environment variables for the server process.",
174218
+ displayOptions: {
174219
+ show: {
174220
+ serverType: ["stdio"]
174221
+ }
174222
+ }
174223
+ },
174224
+ {
174225
+ displayName: "URL",
174226
+ name: "url",
174227
+ type: "string",
174228
+ default: "",
174229
+ required: true,
174230
+ placeholder: "https://mcp.example.com/sse",
174231
+ description: "HTTP endpoint URL of the MCP server.",
174232
+ displayOptions: {
174233
+ show: {
174234
+ serverType: ["http"]
174235
+ }
174236
+ }
174237
+ },
174238
+ {
174239
+ displayName: "Headers",
174240
+ name: "headers",
174241
+ type: "string",
174242
+ typeOptions: { rows: 2 },
174243
+ default: "",
174244
+ placeholder: '{"Authorization": "Bearer ..."}',
174245
+ description: "JSON object of HTTP headers to send with requests.",
174246
+ displayOptions: {
174247
+ show: {
174248
+ serverType: ["http"]
174249
+ }
174250
+ }
174251
+ }
174252
+ ]
174253
+ }
174254
+ ],
174255
+ description: "Define MCP servers to inject into the Claude Code session. Servers provide external tools (Slack, GitHub, databases, etc.)."
174256
+ },
174257
+ {
174258
+ displayName: "MCP Config File Paths",
174259
+ name: "mcpConfigFilePaths",
174260
+ type: "string",
174261
+ default: "",
174262
+ placeholder: "/path/to/mcp-config.json, /path/to/another.json",
174263
+ description: "Comma-separated file paths to MCP configuration files. Each file is passed as a separate --mcp-config argument.",
174264
+ displayOptions: {
174265
+ show: {
174266
+ operation: ["executePrompt", "executeWithContext"]
174267
+ }
174268
+ }
174269
+ },
174270
+ {
174271
+ displayName: "MCP Strict Mode",
174272
+ name: "mcpStrictMode",
174273
+ type: "boolean",
174274
+ default: false,
174275
+ description: "Whether to enable strict MCP config mode. When enabled, Claude Code will fail if any MCP server cannot be started.",
174276
+ displayOptions: {
174277
+ show: {
174278
+ operation: ["executePrompt", "executeWithContext"]
174279
+ }
174280
+ }
174281
+ }
174282
+ ];
174283
+
174142
174284
  // nodes/ClaudeCode/descriptions/optionsDescription.ts
174143
174285
  var optionsDescription = [
174144
174286
  {
@@ -174351,6 +174493,22 @@ function buildCommand(options, credentials) {
174351
174493
  if (options.agents && Object.keys(options.agents).length > 0) {
174352
174494
  args.push("--agents", JSON.stringify(options.agents));
174353
174495
  }
174496
+ if (options.mcpConfig) {
174497
+ if (options.mcpConfig.inlineServers && Object.keys(options.mcpConfig.inlineServers).length > 0) {
174498
+ args.push(
174499
+ "--mcp-config",
174500
+ JSON.stringify({ mcpServers: options.mcpConfig.inlineServers })
174501
+ );
174502
+ }
174503
+ if (options.mcpConfig.configFilePaths && options.mcpConfig.configFilePaths.length > 0) {
174504
+ for (const filePath of options.mcpConfig.configFilePaths) {
174505
+ args.push("--mcp-config", filePath);
174506
+ }
174507
+ }
174508
+ if (options.mcpConfig.strictMode) {
174509
+ args.push("--strict-mcp-config");
174510
+ }
174511
+ }
174354
174512
  if (options.additionalArgs && options.additionalArgs.length > 0) {
174355
174513
  args.push(...options.additionalArgs);
174356
174514
  }
@@ -174589,6 +174747,63 @@ function buildExecutionOptions(context, itemIndex, operation) {
174589
174747
  agents[agent.name] = def;
174590
174748
  }
174591
174749
  }
174750
+ const mcpServersData = context.getNodeParameter("mcpServers", itemIndex, {
174751
+ serversList: []
174752
+ });
174753
+ const mcpConfigFilePathsRaw = context.getNodeParameter(
174754
+ "mcpConfigFilePaths",
174755
+ itemIndex,
174756
+ ""
174757
+ );
174758
+ const mcpStrictMode = context.getNodeParameter(
174759
+ "mcpStrictMode",
174760
+ itemIndex,
174761
+ false
174762
+ );
174763
+ let mcpConfig;
174764
+ const hasInlineServers = mcpServersData.serversList && mcpServersData.serversList.length > 0;
174765
+ const configFilePaths = mcpConfigFilePathsRaw ? mcpConfigFilePathsRaw.split(",").map((p) => p.trim()).filter(Boolean) : [];
174766
+ const hasConfigFiles = configFilePaths.length > 0;
174767
+ if (hasInlineServers || hasConfigFiles || mcpStrictMode) {
174768
+ mcpConfig = {};
174769
+ if (hasInlineServers) {
174770
+ mcpConfig.inlineServers = {};
174771
+ for (const server of mcpServersData.serversList) {
174772
+ let def;
174773
+ if (server.serverType === "http") {
174774
+ def = {
174775
+ type: "http",
174776
+ url: server.url
174777
+ };
174778
+ if (server.headers) {
174779
+ def.headers = JSON.parse(server.headers);
174780
+ }
174781
+ } else {
174782
+ const commandParts = server.command.split(/\s+/).filter(Boolean);
174783
+ const executable = commandParts[0];
174784
+ const commandArgs = commandParts.slice(1);
174785
+ const explicitArgs = server.args ? server.args.split(",").map((a) => a.trim()).filter(Boolean) : [];
174786
+ const allArgs = [...commandArgs, ...explicitArgs];
174787
+ def = {
174788
+ command: executable
174789
+ };
174790
+ if (allArgs.length > 0) {
174791
+ def.args = allArgs;
174792
+ }
174793
+ if (server.env) {
174794
+ def.env = JSON.parse(server.env);
174795
+ }
174796
+ }
174797
+ mcpConfig.inlineServers[server.name] = def;
174798
+ }
174799
+ }
174800
+ if (hasConfigFiles) {
174801
+ mcpConfig.configFilePaths = configFilePaths;
174802
+ }
174803
+ if (mcpStrictMode) {
174804
+ mcpConfig.strictMode = true;
174805
+ }
174806
+ }
174592
174807
  return {
174593
174808
  prompt,
174594
174809
  workingDirectory: options.workingDirectory,
@@ -174608,6 +174823,7 @@ function buildExecutionOptions(context, itemIndex, operation) {
174608
174823
  jsonSchema: options.jsonSchema || void 0,
174609
174824
  fallbackModel: options.fallbackModel || void 0,
174610
174825
  agents,
174826
+ mcpConfig,
174611
174827
  extendedContext: options.extendedContext !== false,
174612
174828
  worktree: options.worktreeEnabled ? options.worktreeName || "" : void 0
174613
174829
  };
@@ -175362,6 +175578,22 @@ function buildClaudeArgs(options) {
175362
175578
  if (options.agents && Object.keys(options.agents).length > 0) {
175363
175579
  args.push("--agents", JSON.stringify(options.agents));
175364
175580
  }
175581
+ if (options.mcpConfig) {
175582
+ if (options.mcpConfig.inlineServers && Object.keys(options.mcpConfig.inlineServers).length > 0) {
175583
+ args.push(
175584
+ "--mcp-config",
175585
+ JSON.stringify({ mcpServers: options.mcpConfig.inlineServers })
175586
+ );
175587
+ }
175588
+ if (options.mcpConfig.configFilePaths && options.mcpConfig.configFilePaths.length > 0) {
175589
+ for (const filePath of options.mcpConfig.configFilePaths) {
175590
+ args.push("--mcp-config", filePath);
175591
+ }
175592
+ }
175593
+ if (options.mcpConfig.strictMode) {
175594
+ args.push("--strict-mcp-config");
175595
+ }
175596
+ }
175365
175597
  if (options.additionalArgs && options.additionalArgs.length > 0) {
175366
175598
  args.push(...options.additionalArgs);
175367
175599
  }
@@ -175809,6 +176041,8 @@ var ClaudeCode = class {
175809
176041
  ...modelDescription,
175810
176042
  // Custom subagents
175811
176043
  ...agentsDescription,
176044
+ // MCP servers
176045
+ ...mcpServersDescription,
175812
176046
  // Additional options
175813
176047
  ...optionsDescription
175814
176048
  ]