@atlassian/mcp-compressor 0.38.2 → 0.40.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 CHANGED
@@ -391,3 +391,32 @@ import { CompressorRuntime } from "@atlassian/mcp-compressor";
391
391
  // light: ~zero runtime deps
392
392
  import { interpolateString } from "@atlassian/mcp-compressor/config";
393
393
  ```
394
+
395
+ ### Summary-only CLI discovery
396
+
397
+ Host-owned CLI and Just Bash transforms can retain their complete command surface
398
+ while advertising only a short toolset description to the model:
399
+
400
+ ```typescript
401
+ const transformed = await transformToolsForCliMode(tools, {
402
+ serverName: "records",
403
+ helpMode: "summary",
404
+ helpSummary: "Search, read and manage enterprise records.",
405
+ });
406
+ ```
407
+
408
+ `helpMode` defaults to `"full"` (the existing subcommand catalog). With `"summary"`,
409
+ the model-visible `records_help` description omits that catalog. `helpSummary` is
410
+ optional caller-authored capability text, not an inferred or permission-checked
411
+ capability promise. Missing/blank summaries fall back to a generic CLI description.
412
+ Both `records --help` and calling `records_help` still return full discovery;
413
+ `records <subcommand> --help` and all invocations are unchanged. The same options
414
+ are available on `planToolsForJustBash` / `transformToolsForJustBash`.
415
+
416
+ Hosts using `buildHostTransformPlan` directly can pass the same options. Use
417
+ `plan.helpDescription` for the model-visible description and `plan.helpText` for
418
+ the help tool's execution result. Do **not** use the shortened description as the
419
+ on-demand help response. Artifacts, command registrations, auth and schemas do
420
+ not change. Python/TypeScript code-generation transforms do not support summary
421
+ mode. This is independent of MCP proxy `compressionLevel`; it does not add a new
422
+ standalone CLI flag or change the high-level `CompressorClient` session modes.
@@ -1,5 +1,7 @@
1
1
  export interface ExecutableTool<TResult = string> {
2
2
  name: string;
3
+ title?: string | null;
4
+ annotations?: Record<string, unknown> | null;
3
5
  description?: string;
4
6
  inputSchema: Record<string, unknown>;
5
7
  execute(input?: Record<string, unknown>): Promise<TResult>;
@@ -2,6 +2,8 @@ import { type HostShrinkfitOptions } from "./host_shrinkfit.js";
2
2
  import type { CompressionLevel } from "./types.js";
3
3
  import type { ExecutableTool } from "./adapters.js";
4
4
  export interface LocalTool<TInput = Record<string, unknown>, TResult = unknown> {
5
+ title?: string | null;
6
+ annotations?: Record<string, unknown> | null;
5
7
  description?: string;
6
8
  inputSchema: unknown;
7
9
  execute: (input: TInput) => TResult | Promise<TResult>;
@@ -46,6 +46,8 @@ export function compressTools(tools, options = {}) {
46
46
  const compressionLevel = options.compressionLevel ?? "medium";
47
47
  const specs = Object.entries(tools).map(([name, tool]) => ({
48
48
  name,
49
+ title: tool.title,
50
+ annotations: tool.annotations,
49
51
  description: tool.description,
50
52
  inputSchema: asJsonSchema(tool.inputSchema, options.schemaAdapter),
51
53
  }));
package/dist/native.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export interface NativeToolSpec {
2
2
  name: string;
3
+ title?: string | null;
4
+ annotations?: Record<string, unknown> | null;
3
5
  description?: string | null;
4
6
  input_schema: Record<string, unknown>;
5
7
  }
@@ -24,6 +24,8 @@ export interface CompressorClientOptions {
24
24
  }
25
25
  export interface ProxyTool {
26
26
  name: string;
27
+ title?: string | null;
28
+ annotations?: Record<string, unknown> | null;
27
29
  description?: string | null;
28
30
  inputSchema: Record<string, unknown>;
29
31
  }
@@ -198,6 +198,8 @@ export class CompressorProxy {
198
198
  get tools() {
199
199
  return this.info().frontend_tools.map((tool) => ({
200
200
  name: tool.name,
201
+ title: tool.title,
202
+ annotations: tool.annotations,
201
203
  description: tool.description,
202
204
  inputSchema: tool.input_schema,
203
205
  }));
@@ -275,6 +277,8 @@ export class CompressorProxy {
275
277
  for (const tool of this.tools) {
276
278
  result[tool.name] = {
277
279
  name: tool.name,
280
+ title: tool.title,
281
+ annotations: tool.annotations,
278
282
  description: tool.description ?? undefined,
279
283
  inputSchema: tool.inputSchema,
280
284
  execute: async (input = {}) => (await this.invokeWrapper(tool.name, input)).text,
@@ -291,6 +295,8 @@ export class CompressorProxy {
291
295
  token: info.token,
292
296
  tools: info.backend_tools.map((tool) => ({
293
297
  name: tool.name,
298
+ title: tool.title,
299
+ annotations: tool.annotations,
294
300
  description: tool.description,
295
301
  inputSchema: tool.input_schema,
296
302
  })),
@@ -1,6 +1,8 @@
1
1
  import { type NativeCompressedSession } from "./native.js";
2
2
  export interface ToolSpec {
3
3
  name: string;
4
+ title?: string | null;
5
+ annotations?: Record<string, unknown> | null;
4
6
  description?: string | null;
5
7
  inputSchema: Record<string, unknown>;
6
8
  }
@@ -63,11 +65,15 @@ export interface CompressedSessionInfo {
63
65
  token: string;
64
66
  frontend_tools: Array<{
65
67
  name: string;
68
+ title?: string | null;
69
+ annotations?: Record<string, unknown> | null;
66
70
  description?: string | null;
67
71
  input_schema: Record<string, unknown>;
68
72
  }>;
69
73
  backend_tools: Array<{
70
74
  name: string;
75
+ title?: string | null;
76
+ annotations?: Record<string, unknown> | null;
71
77
  description?: string | null;
72
78
  input_schema: Record<string, unknown>;
73
79
  }>;
@@ -76,6 +82,8 @@ export interface CompressedSessionInfo {
76
82
  serverName?: string;
77
83
  tool: {
78
84
  name: string;
85
+ title?: string | null;
86
+ annotations?: Record<string, unknown> | null;
79
87
  description?: string | null;
80
88
  input_schema: Record<string, unknown>;
81
89
  };
@@ -116,6 +124,10 @@ export interface OAuthStoreEntry {
116
124
  export declare function listOAuthCredentials(): OAuthStoreEntry[];
117
125
  export declare function clearOAuthCredentials(target?: string | null): string[];
118
126
  export interface HostTransformPlanConfig {
127
+ /** Model-visible shell help only; commands and full help are unchanged. */
128
+ helpMode?: "full" | "summary";
129
+ /** Optional toolset capability description for summary mode. */
130
+ helpSummary?: string;
119
131
  kind: ClientArtifactKind | "just-bash";
120
132
  serverName: string;
121
133
  tools: ToolSpec[];
@@ -126,6 +138,8 @@ export interface HostTransformPlanConfig {
126
138
  sessionPid?: number;
127
139
  }
128
140
  export interface HostTransformPlan {
141
+ /** Full on-demand help, independent of the model-visible description. */
142
+ helpText: string;
129
143
  helpToolName: string;
130
144
  helpDescription: string;
131
145
  outputDir?: string;
package/dist/rust_core.js CHANGED
@@ -2,6 +2,8 @@ import { loadNativeCore } from "./native.js";
2
2
  function toNativeTool(tool) {
3
3
  return {
4
4
  name: tool.name,
5
+ title: tool.title ?? null,
6
+ annotations: tool.annotations ?? null,
5
7
  description: tool.description ?? null,
6
8
  input_schema: tool.inputSchema,
7
9
  };
@@ -138,6 +140,8 @@ export function clearOAuthCredentials(target) {
138
140
  export function buildHostTransformPlan(config) {
139
141
  return JSON.parse(loadNativeCore().buildHostTransformPlanJson(stringify({
140
142
  kind: config.kind,
143
+ helpMode: config.helpMode,
144
+ helpSummary: config.helpSummary,
141
145
  serverName: config.serverName,
142
146
  tools: config.tools.map(toNativeTool),
143
147
  outputDir: config.outputDir,
@@ -4,7 +4,13 @@ import { type JustBashCommandRegistration } from "./just_bash_commands.js";
4
4
  export interface TransformToolOptions extends HostShrinkfitOptions {
5
5
  serverName?: string;
6
6
  }
7
- export interface PlanToolsForJustBashOptions extends TransformToolOptions {
7
+ export interface ShellHelpOptions {
8
+ /** Defaults to full; summary omits the upfront subcommand catalog. */
9
+ helpMode?: "full" | "summary";
10
+ /** Toolset capability summary, used only with helpMode: "summary". */
11
+ helpSummary?: string;
12
+ }
13
+ export interface PlanToolsForJustBashOptions extends TransformToolOptions, ShellHelpOptions {
8
14
  /**
9
15
  * Convert JSON/CSV/YAML tool results to TOON before writing them to stdout.
10
16
  * Defaults to ``false`` so Just Bash output matches the generated CLI byte for
@@ -25,7 +31,7 @@ export interface TransformToolsForCodeModeOptions extends TransformToolOptions {
25
31
  language: CodeTransformLanguage;
26
32
  outputDir?: string;
27
33
  }
28
- export interface TransformToolsForCliModeOptions extends TransformToolOptions {
34
+ export interface TransformToolsForCliModeOptions extends TransformToolOptions, ShellHelpOptions {
29
35
  outputDir?: string;
30
36
  }
31
37
  export interface GeneratedToolTransformResult {
@@ -8,7 +8,13 @@ export function planToolsForJustBash(tools, options = {}) {
8
8
  const shrinking = shrinkfitTools(tools, options);
9
9
  tools = shrinking.tools;
10
10
  const toolSpecs = executableToolsToSpecs(tools);
11
- const plan = buildHostTransformPlan({ kind: "just-bash", serverName, tools: toolSpecs });
11
+ const plan = buildHostTransformPlan({
12
+ kind: "just-bash",
13
+ serverName,
14
+ tools: toolSpecs,
15
+ helpMode: options.helpMode,
16
+ helpSummary: options.helpSummary,
17
+ });
12
18
  const registrations = createJustBashCommandRegistrations((plan.justBash?.commands ?? []).map((command) => justBashSource(serverName, command.commandName, command.backendToolName, tools, options.shrinkfit === undefined && (options.toonify ?? false))));
13
19
  return {
14
20
  registrations,
@@ -16,7 +22,7 @@ export function planToolsForJustBash(tools, options = {}) {
16
22
  tools: helpTools({
17
23
  name: plan.helpToolName,
18
24
  description: plan.helpDescription,
19
- output: plan.helpDescription,
25
+ output: plan.helpText,
20
26
  }),
21
27
  };
22
28
  }
@@ -39,6 +45,8 @@ export async function transformToolsForCliMode(tools, options = {}) {
39
45
  return generatedTransform(tools, {
40
46
  shrinkfit: options.shrinkfit,
41
47
  kind: "cli",
48
+ helpMode: options.helpMode,
49
+ helpSummary: options.helpSummary,
42
50
  serverName,
43
51
  outputDir: options.outputDir,
44
52
  commandName: serverName,
@@ -64,6 +72,8 @@ async function generatedTransform(tools, options) {
64
72
  const bridge = await startLocalToolBridge(tools);
65
73
  const plan = buildHostTransformPlan({
66
74
  kind: options.kind,
75
+ helpMode: options.helpMode,
76
+ helpSummary: options.helpSummary,
67
77
  serverName: options.serverName,
68
78
  tools: executableToolsToSpecs(tools),
69
79
  outputDir: options.outputDir,
@@ -80,7 +90,7 @@ async function generatedTransform(tools, options) {
80
90
  tools: helpTools({
81
91
  name: plan.helpToolName,
82
92
  description: plan.helpDescription,
83
- output: plan.helpDescription,
93
+ output: plan.helpText,
84
94
  }),
85
95
  close: () => {
86
96
  shrinking.close();
Binary file
Binary file
Binary file
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/native/index.linux-x64-gnu.node
3
- size: 34550480 bytes
4
- sha256: d08919951b7c469b4e53e8ce38f01c60b6a5c1aba03ae95acf5d1d614d45e92e
3
+ size: 34662656 bytes
4
+ sha256: 2d5f74b045200e5ec57ab6285b75b5403a7a251008e2bb3be5d1f039d24460fb
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlassian/mcp-compressor",
3
- "version": "0.38.2",
3
+ "version": "0.40.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",