@atlassian/mcp-compressor 0.21.0 → 0.21.1
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.
|
@@ -4,6 +4,10 @@ export interface GeneratedClientArtifactsResult {
|
|
|
4
4
|
files: Record<string, string>;
|
|
5
5
|
environment: Record<string, string>;
|
|
6
6
|
}
|
|
7
|
+
export interface GeneratedBridgeClientArtifactsResult extends GeneratedClientArtifactsResult {
|
|
8
|
+
bridgeUrl: string;
|
|
9
|
+
token: string;
|
|
10
|
+
}
|
|
7
11
|
export interface GenerateClientFromBridgeOptions {
|
|
8
12
|
kind: ClientArtifactKind;
|
|
9
13
|
name: string;
|
|
@@ -13,5 +17,5 @@ export interface GenerateClientFromBridgeOptions {
|
|
|
13
17
|
outputDir: string;
|
|
14
18
|
sessionPid?: number;
|
|
15
19
|
}
|
|
16
|
-
export declare function generateClientFromBridge(options: GenerateClientFromBridgeOptions):
|
|
20
|
+
export declare function generateClientFromBridge(options: GenerateClientFromBridgeOptions): GeneratedBridgeClientArtifactsResult;
|
|
17
21
|
export declare function generatedClientEnvironment(kind: ClientArtifactKind, outputDir: string): Record<string, string>;
|
|
@@ -12,6 +12,8 @@ export function generateClientFromBridge(options) {
|
|
|
12
12
|
paths: generateClientArtifacts(options.kind, config),
|
|
13
13
|
files: generateClientArtifactFiles(options.kind, config),
|
|
14
14
|
environment: generatedClientEnvironment(options.kind, options.outputDir),
|
|
15
|
+
bridgeUrl: options.bridgeUrl,
|
|
16
|
+
token: options.token,
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
19
|
export function generatedClientEnvironment(kind, outputDir) {
|
|
@@ -4,6 +4,10 @@ export async function startLocalToolBridge(tools) {
|
|
|
4
4
|
const token = crypto.randomUUID();
|
|
5
5
|
const server = http.createServer(async (request, response) => {
|
|
6
6
|
try {
|
|
7
|
+
if (request.method === "GET" && request.url === "/health") {
|
|
8
|
+
response.writeHead(200, { "content-type": "text/plain" }).end("ok");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
7
11
|
if (request.method !== "POST" || request.url !== "/exec") {
|
|
8
12
|
response.writeHead(404).end("not found");
|
|
9
13
|
return;
|
|
@@ -13,7 +17,7 @@ export async function startLocalToolBridge(tools) {
|
|
|
13
17
|
return;
|
|
14
18
|
}
|
|
15
19
|
const body = JSON.parse(await readRequestBody(request));
|
|
16
|
-
const toolName = String(body.tool_name ?? "");
|
|
20
|
+
const toolName = String(body.tool ?? body.tool_name ?? "");
|
|
17
21
|
const tool = tools[toolName];
|
|
18
22
|
if (!tool) {
|
|
19
23
|
response
|
|
@@ -21,7 +25,7 @@ export async function startLocalToolBridge(tools) {
|
|
|
21
25
|
.end(JSON.stringify({ error: `Tool not found: ${toolName}` }));
|
|
22
26
|
return;
|
|
23
27
|
}
|
|
24
|
-
const result = await tool.execute(body.tool_input ?? {});
|
|
28
|
+
const result = await tool.execute(body.input ?? body.tool_input ?? {});
|
|
25
29
|
response
|
|
26
30
|
.writeHead(200, { "content-type": "application/json" })
|
|
27
31
|
.end(JSON.stringify({ result: stringifyToolResult(result) }));
|
package/dist/transforms.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExecutableTool } from "./adapters.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type GeneratedBridgeClientArtifactsResult } from "./generated_clients.js";
|
|
3
3
|
import { type JustBashCommandRegistration } from "./just_bash_commands.js";
|
|
4
4
|
export interface TransformToolOptions {
|
|
5
5
|
serverName?: string;
|
|
@@ -19,7 +19,7 @@ export interface TransformToolsForCodeModeOptions extends TransformToolOptions {
|
|
|
19
19
|
export interface TransformToolsForCliModeOptions extends TransformToolOptions {
|
|
20
20
|
outputDir?: string;
|
|
21
21
|
}
|
|
22
|
-
export interface GeneratedToolTransformResult extends
|
|
22
|
+
export interface GeneratedToolTransformResult extends GeneratedBridgeClientArtifactsResult {
|
|
23
23
|
tools: Record<string, ExecutableTool>;
|
|
24
24
|
close(): void;
|
|
25
25
|
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlassian/mcp-compressor",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
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",
|