@atlassian/mcp-compressor 0.20.0 → 0.21.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.
@@ -61,6 +61,7 @@ async function generatedTransform(tools, options) {
61
61
  outputDir: options.outputDir,
62
62
  files: Object.keys(generated.files),
63
63
  commandName: options.commandName,
64
+ tools: executableToolsToSpecs(tools),
64
65
  });
65
66
  return {
66
67
  ...generated,
@@ -86,7 +87,7 @@ function helpTools(options) {
86
87
  function generatedHelpDescription(options) {
87
88
  if (options.kind === "cli") {
88
89
  const command = options.commandName ?? `${options.outputDir}/${options.serverName}`;
89
- return cliHelpDescription(command, options.serverName);
90
+ return cliHelpDescription(command, options.serverName, options.tools);
90
91
  }
91
92
  const language = options.kind === "python" ? "Python" : "TypeScript";
92
93
  const moduleName = options.kind === "python" ? `${options.serverName}.py` : `${options.serverName}.ts`;
@@ -103,7 +104,7 @@ function generatedHelpDescription(options) {
103
104
  ...options.files.map((file) => ` - ${options.outputDir}/${file}`),
104
105
  ].join("\n");
105
106
  }
106
- function cliHelpDescription(command, cliName) {
107
+ function cliHelpDescription(command, cliName, tools) {
107
108
  return [
108
109
  `Functionality associated with the ${cliName} toolset is provided via the \`${command}\` CLI. Do not call this tool - use the CLI instead.`,
109
110
  `${cliName} - the ${cliName} toolset`,
@@ -114,13 +115,27 @@ function cliHelpDescription(command, cliName) {
114
115
  ` ${command} <subcommand> [options]`,
115
116
  "",
116
117
  "SUBCOMMANDS:",
117
- ` Run '${command} --help' in the shell for available subcommands.`,
118
+ ...formatSubcommands(tools),
118
119
  "",
119
120
  `Run '${command} --help' in the shell for usage.`,
120
121
  `Run '${command} <subcommand> --help' for per-command help.`,
121
122
  `Run '${command} <subcommand> [options]' to invoke a tool.`,
122
123
  ].join("\n");
123
124
  }
125
+ function formatSubcommands(tools) {
126
+ const maxNameLength = Math.max(...tools.map((tool) => cliSubcommandName(tool.name).length), 0);
127
+ return tools.map((tool) => {
128
+ const subcommand = cliSubcommandName(tool.name);
129
+ const description = compactDescription(tool.description ?? undefined);
130
+ return ` ${subcommand.padEnd(maxNameLength + 2)}${description}`.trimEnd();
131
+ });
132
+ }
133
+ function cliSubcommandName(toolName) {
134
+ return toolName.replaceAll("_", "-");
135
+ }
136
+ function compactDescription(description) {
137
+ return (description ?? "").replace(/\s+/g, " ").trim();
138
+ }
124
139
  function justBashHelpDescription(serverName, registrations) {
125
140
  return [
126
141
  `Functionality associated with the ${serverName} toolset is provided via bash commands. Do not call this tool - use the bash commands instead.`,
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlassian/mcp-compressor",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "TypeScript MCP server wrapper for reducing tokens consumed by MCP tools.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/atlassian-labs/mcp-compressor",