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.
@@ -1 +1 @@
1
- {"version":3,"file":"ClaudeCode.node.d.ts","sourceRoot":"","sources":["../../../nodes/ClaudeCode/ClaudeCode.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAEpB,MAAM,cAAc,CAAC;AA2BtB,qBAAa,UAAW,YAAW,SAAS;IAC3C,WAAW,EAAE,oBAAoB,CA6F/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAuHvE"}
1
+ {"version":3,"file":"ClaudeCode.node.d.ts","sourceRoot":"","sources":["../../../nodes/ClaudeCode/ClaudeCode.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAEpB,MAAM,cAAc,CAAC;AA4BtB,qBAAa,UAAW,YAAW,SAAS;IAC3C,WAAW,EAAE,oBAAoB,CAgG/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAuHvE"}
@@ -174132,6 +174132,148 @@ var agentsDescription = [
174132
174132
  }
174133
174133
  ];
174134
174134
 
174135
+ // nodes/ClaudeCode/descriptions/mcpServersDescription.ts
174136
+ var mcpServersDescription = [
174137
+ {
174138
+ displayName: "MCP Servers",
174139
+ name: "mcpServers",
174140
+ type: "fixedCollection",
174141
+ typeOptions: {
174142
+ multipleValues: true,
174143
+ multipleValueButtonText: "Add MCP Server"
174144
+ },
174145
+ default: { serversList: [] },
174146
+ displayOptions: {
174147
+ show: {
174148
+ operation: ["executePrompt", "executeWithContext"]
174149
+ }
174150
+ },
174151
+ options: [
174152
+ {
174153
+ name: "serversList",
174154
+ displayName: "Servers",
174155
+ values: [
174156
+ {
174157
+ displayName: "Server Name",
174158
+ name: "name",
174159
+ type: "string",
174160
+ default: "",
174161
+ required: true,
174162
+ placeholder: "slack",
174163
+ description: "Unique identifier for this MCP server."
174164
+ },
174165
+ {
174166
+ displayName: "Transport Type",
174167
+ name: "serverType",
174168
+ type: "options",
174169
+ options: [
174170
+ { name: "Stdio", value: "stdio" },
174171
+ { name: "HTTP", value: "http" }
174172
+ ],
174173
+ default: "stdio",
174174
+ description: "Transport protocol for communicating with the MCP server."
174175
+ },
174176
+ {
174177
+ displayName: "Command",
174178
+ name: "command",
174179
+ type: "string",
174180
+ default: "",
174181
+ required: true,
174182
+ placeholder: "npx -y @modelcontextprotocol/server-slack",
174183
+ 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']).",
174184
+ displayOptions: {
174185
+ show: {
174186
+ serverType: ["stdio"]
174187
+ }
174188
+ }
174189
+ },
174190
+ {
174191
+ displayName: "Arguments",
174192
+ name: "args",
174193
+ type: "string",
174194
+ default: "",
174195
+ placeholder: "--port,3000,--verbose",
174196
+ description: "Comma-separated arguments to pass to the command.",
174197
+ displayOptions: {
174198
+ show: {
174199
+ serverType: ["stdio"]
174200
+ }
174201
+ }
174202
+ },
174203
+ {
174204
+ displayName: "Environment Variables",
174205
+ name: "env",
174206
+ type: "string",
174207
+ typeOptions: { rows: 2 },
174208
+ default: "",
174209
+ placeholder: '{"SLACK_TOKEN": "xoxb-..."}',
174210
+ description: "JSON object of environment variables for the server process.",
174211
+ displayOptions: {
174212
+ show: {
174213
+ serverType: ["stdio"]
174214
+ }
174215
+ }
174216
+ },
174217
+ {
174218
+ displayName: "URL",
174219
+ name: "url",
174220
+ type: "string",
174221
+ default: "",
174222
+ required: true,
174223
+ placeholder: "https://mcp.example.com/sse",
174224
+ description: "HTTP endpoint URL of the MCP server.",
174225
+ displayOptions: {
174226
+ show: {
174227
+ serverType: ["http"]
174228
+ }
174229
+ }
174230
+ },
174231
+ {
174232
+ displayName: "Headers",
174233
+ name: "headers",
174234
+ type: "string",
174235
+ typeOptions: { rows: 2 },
174236
+ default: "",
174237
+ placeholder: '{"Authorization": "Bearer ..."}',
174238
+ description: "JSON object of HTTP headers to send with requests.",
174239
+ displayOptions: {
174240
+ show: {
174241
+ serverType: ["http"]
174242
+ }
174243
+ }
174244
+ }
174245
+ ]
174246
+ }
174247
+ ],
174248
+ description: "Define MCP servers to inject into the Claude Code session. Servers provide external tools (Slack, GitHub, databases, etc.)."
174249
+ },
174250
+ {
174251
+ displayName: "MCP Config File Paths",
174252
+ name: "mcpConfigFilePaths",
174253
+ type: "string",
174254
+ default: "",
174255
+ placeholder: "/path/to/mcp-config.json, /path/to/another.json",
174256
+ description: "Comma-separated file paths to MCP configuration files. Each file is passed as a separate --mcp-config argument.",
174257
+ displayOptions: {
174258
+ show: {
174259
+ operation: ["executePrompt", "executeWithContext"]
174260
+ }
174261
+ }
174262
+ },
174263
+ {
174264
+ displayName: "MCP Strict Mode",
174265
+ name: "mcpStrictMode",
174266
+ type: "boolean",
174267
+ default: false,
174268
+ description: "Whether to enable strict MCP config mode. When enabled, Claude Code will fail if any MCP server cannot be started.",
174269
+ displayOptions: {
174270
+ show: {
174271
+ operation: ["executePrompt", "executeWithContext"]
174272
+ }
174273
+ }
174274
+ }
174275
+ ];
174276
+
174135
174277
  // nodes/ClaudeCode/descriptions/optionsDescription.ts
174136
174278
  var optionsDescription = [
174137
174279
  {
@@ -174344,6 +174486,22 @@ function buildCommand(options, credentials) {
174344
174486
  if (options.agents && Object.keys(options.agents).length > 0) {
174345
174487
  args.push("--agents", JSON.stringify(options.agents));
174346
174488
  }
174489
+ if (options.mcpConfig) {
174490
+ if (options.mcpConfig.inlineServers && Object.keys(options.mcpConfig.inlineServers).length > 0) {
174491
+ args.push(
174492
+ "--mcp-config",
174493
+ JSON.stringify({ mcpServers: options.mcpConfig.inlineServers })
174494
+ );
174495
+ }
174496
+ if (options.mcpConfig.configFilePaths && options.mcpConfig.configFilePaths.length > 0) {
174497
+ for (const filePath of options.mcpConfig.configFilePaths) {
174498
+ args.push("--mcp-config", filePath);
174499
+ }
174500
+ }
174501
+ if (options.mcpConfig.strictMode) {
174502
+ args.push("--strict-mcp-config");
174503
+ }
174504
+ }
174347
174505
  if (options.additionalArgs && options.additionalArgs.length > 0) {
174348
174506
  args.push(...options.additionalArgs);
174349
174507
  }
@@ -174582,6 +174740,63 @@ function buildExecutionOptions(context, itemIndex, operation) {
174582
174740
  agents[agent.name] = def;
174583
174741
  }
174584
174742
  }
174743
+ const mcpServersData = context.getNodeParameter("mcpServers", itemIndex, {
174744
+ serversList: []
174745
+ });
174746
+ const mcpConfigFilePathsRaw = context.getNodeParameter(
174747
+ "mcpConfigFilePaths",
174748
+ itemIndex,
174749
+ ""
174750
+ );
174751
+ const mcpStrictMode = context.getNodeParameter(
174752
+ "mcpStrictMode",
174753
+ itemIndex,
174754
+ false
174755
+ );
174756
+ let mcpConfig;
174757
+ const hasInlineServers = mcpServersData.serversList && mcpServersData.serversList.length > 0;
174758
+ const configFilePaths = mcpConfigFilePathsRaw ? mcpConfigFilePathsRaw.split(",").map((p) => p.trim()).filter(Boolean) : [];
174759
+ const hasConfigFiles = configFilePaths.length > 0;
174760
+ if (hasInlineServers || hasConfigFiles || mcpStrictMode) {
174761
+ mcpConfig = {};
174762
+ if (hasInlineServers) {
174763
+ mcpConfig.inlineServers = {};
174764
+ for (const server of mcpServersData.serversList) {
174765
+ let def;
174766
+ if (server.serverType === "http") {
174767
+ def = {
174768
+ type: "http",
174769
+ url: server.url
174770
+ };
174771
+ if (server.headers) {
174772
+ def.headers = JSON.parse(server.headers);
174773
+ }
174774
+ } else {
174775
+ const commandParts = server.command.split(/\s+/).filter(Boolean);
174776
+ const executable = commandParts[0];
174777
+ const commandArgs = commandParts.slice(1);
174778
+ const explicitArgs = server.args ? server.args.split(",").map((a) => a.trim()).filter(Boolean) : [];
174779
+ const allArgs = [...commandArgs, ...explicitArgs];
174780
+ def = {
174781
+ command: executable
174782
+ };
174783
+ if (allArgs.length > 0) {
174784
+ def.args = allArgs;
174785
+ }
174786
+ if (server.env) {
174787
+ def.env = JSON.parse(server.env);
174788
+ }
174789
+ }
174790
+ mcpConfig.inlineServers[server.name] = def;
174791
+ }
174792
+ }
174793
+ if (hasConfigFiles) {
174794
+ mcpConfig.configFilePaths = configFilePaths;
174795
+ }
174796
+ if (mcpStrictMode) {
174797
+ mcpConfig.strictMode = true;
174798
+ }
174799
+ }
174585
174800
  return {
174586
174801
  prompt,
174587
174802
  workingDirectory: options.workingDirectory,
@@ -174601,6 +174816,7 @@ function buildExecutionOptions(context, itemIndex, operation) {
174601
174816
  jsonSchema: options.jsonSchema || void 0,
174602
174817
  fallbackModel: options.fallbackModel || void 0,
174603
174818
  agents,
174819
+ mcpConfig,
174604
174820
  extendedContext: options.extendedContext !== false,
174605
174821
  worktree: options.worktreeEnabled ? options.worktreeName || "" : void 0
174606
174822
  };
@@ -175355,6 +175571,22 @@ function buildClaudeArgs(options) {
175355
175571
  if (options.agents && Object.keys(options.agents).length > 0) {
175356
175572
  args.push("--agents", JSON.stringify(options.agents));
175357
175573
  }
175574
+ if (options.mcpConfig) {
175575
+ if (options.mcpConfig.inlineServers && Object.keys(options.mcpConfig.inlineServers).length > 0) {
175576
+ args.push(
175577
+ "--mcp-config",
175578
+ JSON.stringify({ mcpServers: options.mcpConfig.inlineServers })
175579
+ );
175580
+ }
175581
+ if (options.mcpConfig.configFilePaths && options.mcpConfig.configFilePaths.length > 0) {
175582
+ for (const filePath of options.mcpConfig.configFilePaths) {
175583
+ args.push("--mcp-config", filePath);
175584
+ }
175585
+ }
175586
+ if (options.mcpConfig.strictMode) {
175587
+ args.push("--strict-mcp-config");
175588
+ }
175589
+ }
175358
175590
  if (options.additionalArgs && options.additionalArgs.length > 0) {
175359
175591
  args.push(...options.additionalArgs);
175360
175592
  }
@@ -175802,6 +176034,8 @@ var ClaudeCode = class {
175802
176034
  ...modelDescription,
175803
176035
  // Custom subagents
175804
176036
  ...agentsDescription,
176037
+ // MCP servers
176038
+ ...mcpServersDescription,
175805
176039
  // Additional options
175806
176040
  ...optionsDescription
175807
176041
  ]