@aiwerk/mcp-bridge 1.2.2 → 1.3.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
@@ -1,5 +1,9 @@
1
1
  # @aiwerk/mcp-bridge
2
2
 
3
+ [![Tests](https://github.com/AIWerk/mcp-bridge/actions/workflows/test.yml/badge.svg)](https://github.com/AIWerk/mcp-bridge/actions/workflows/test.yml)
4
+ [![npm version](https://img.shields.io/npm/v/@aiwerk/mcp-bridge.svg)](https://www.npmjs.com/package/@aiwerk/mcp-bridge)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
3
7
  Multiplex multiple MCP servers into one interface. One config, one connection, all your tools.
4
8
 
5
9
  Works with **Claude Desktop**, **Cursor**, **Windsurf**, **Cline**, **OpenClaw**, or any MCP client.
@@ -111,10 +115,38 @@ Config: `~/.mcp-bridge/config.json` | Secrets: `~/.mcp-bridge/.env`
111
115
  },
112
116
  "toolPrefix": true,
113
117
  "connectionTimeoutMs": 5000,
114
- "requestTimeoutMs": 60000
118
+ "requestTimeoutMs": 60000,
119
+ "schemaCompression": {
120
+ "enabled": true,
121
+ "maxDescriptionLength": 80
122
+ }
123
+ }
124
+ ```
125
+
126
+ ### Schema Compression
127
+
128
+ In router mode, tool descriptions from upstream servers can be verbose (100-300+ chars each). Schema compression truncates them to save tokens:
129
+
130
+ - **Enabled by default** — descriptions capped at 80 characters
131
+ - Cuts at sentence boundary when possible, otherwise word boundary
132
+ - Use `action=schema` to retrieve the full uncompressed schema for any tool on demand
133
+
134
+ ```json
135
+ "schemaCompression": {
136
+ "enabled": true,
137
+ "maxDescriptionLength": 80
115
138
  }
116
139
  ```
117
140
 
141
+ **Token savings example:** 30 Todoist tools: ~2800 tokens uncompressed -> ~1200 compressed (~57% reduction).
142
+
143
+ To get full details for a specific tool:
144
+ ```
145
+ mcp(server="todoist", action="schema", tool="find-tasks")
146
+ ```
147
+
148
+ Set `"enabled": false` to disable compression and return full descriptions.
149
+
118
150
  ### Modes
119
151
 
120
152
  | Mode | Tools exposed | Best for |
@@ -182,6 +214,9 @@ Built-in catalog with pre-configured servers:
182
214
  | wise | stdio | International payments |
183
215
  | tavily | stdio | AI-optimized web search |
184
216
  | apify | streamable-http | Web scraping and automation |
217
+ | atlassian | stdio | Confluence and Jira |
218
+ | chrome-devtools | stdio | Chrome browser automation |
219
+ | hostinger | sse | Web hosting management |
185
220
 
186
221
  ```bash
187
222
  mcp-bridge install todoist # Interactive setup with API key prompt
@@ -26,6 +26,12 @@ export type RouterDispatchResponse = {
26
26
  action: "call";
27
27
  tool: string;
28
28
  result: any;
29
+ } | {
30
+ server: string;
31
+ action: "schema";
32
+ tool: string;
33
+ schema: any;
34
+ description: string;
29
35
  } | {
30
36
  action: "status";
31
37
  servers: RouterServerStatus[];
@@ -2,6 +2,7 @@ import { SseTransport } from "./transport-sse.js";
2
2
  import { StdioTransport } from "./transport-stdio.js";
3
3
  import { StreamableHttpTransport } from "./transport-streamable-http.js";
4
4
  import { fetchToolsList, initializeProtocol, PACKAGE_VERSION } from "./protocol.js";
5
+ import { compressDescription } from "./schema-compression.js";
5
6
  const DEFAULT_IDLE_TIMEOUT_MS = 10 * 60 * 1000;
6
7
  const DEFAULT_MAX_CONCURRENT = 5;
7
8
  export class McpRouter {
@@ -59,10 +60,28 @@ export class McpRouter {
59
60
  return this.error("connection_failed", `Failed to connect to ${server}: ${error instanceof Error ? error.message : String(error)}`);
60
61
  }
61
62
  }
63
+ if (normalizedAction === "schema") {
64
+ if (!tool) {
65
+ return this.error("invalid_params", "tool is required for action=schema");
66
+ }
67
+ try {
68
+ await this.getToolList(server);
69
+ }
70
+ catch (error) {
71
+ return this.error("connection_failed", `Failed to connect to ${server}: ${error instanceof Error ? error.message : String(error)}`);
72
+ }
73
+ const state = this.states.get(server);
74
+ const fullTool = state.fullToolsMap?.get(tool);
75
+ if (!fullTool) {
76
+ return this.error("unknown_tool", `Tool '${tool}' not found on server '${server}'`, state.toolNames);
77
+ }
78
+ return { server, action: "schema", tool, schema: fullTool.inputSchema, description: fullTool.description };
79
+ }
62
80
  if (normalizedAction === "refresh") {
63
81
  try {
64
82
  const state = await this.ensureConnected(server);
65
83
  state.toolsCache = undefined;
84
+ state.fullToolsMap = undefined;
66
85
  state.toolNames = [];
67
86
  const tools = await this.getToolList(server);
68
87
  return { server, action: "refresh", refreshed: true, tools };
@@ -72,7 +91,7 @@ export class McpRouter {
72
91
  }
73
92
  }
74
93
  if (normalizedAction !== "call") {
75
- return this.error("invalid_params", `action must be one of: list, call, refresh`);
94
+ return this.error("invalid_params", `action must be one of: list, call, refresh, schema`);
76
95
  }
77
96
  if (!tool) {
78
97
  return this.error("invalid_params", "tool is required for action=call");
@@ -116,9 +135,15 @@ export class McpRouter {
116
135
  }
117
136
  const tools = await fetchToolsList(state.transport);
118
137
  state.toolNames = tools.map((tool) => tool.name);
138
+ // Store full tool metadata for action=schema
139
+ state.fullToolsMap = new Map(tools.map((tool) => [tool.name, { description: tool.description || "", inputSchema: tool.inputSchema }]));
140
+ const compressionEnabled = this.clientConfig.schemaCompression?.enabled ?? true;
141
+ const maxLen = this.clientConfig.schemaCompression?.maxDescriptionLength ?? 80;
119
142
  state.toolsCache = tools.map((tool) => ({
120
143
  name: tool.name,
121
- description: tool.description || "",
144
+ description: compressionEnabled
145
+ ? compressDescription(tool.description || "", maxLen)
146
+ : (tool.description || ""),
122
147
  requiredParams: this.extractRequiredParams(tool)
123
148
  }));
124
149
  this.markUsed(server);
@@ -213,6 +238,7 @@ export class McpRouter {
213
238
  }
214
239
  state.initialized = false;
215
240
  state.toolsCache = undefined;
241
+ state.fullToolsMap = undefined;
216
242
  state.toolNames = [];
217
243
  }
218
244
  markUsed(server) {
@@ -240,6 +266,7 @@ export class McpRouter {
240
266
  return;
241
267
  state.initialized = false;
242
268
  state.toolsCache = undefined;
269
+ state.fullToolsMap = undefined;
243
270
  state.toolNames = [];
244
271
  };
245
272
  if (serverConfig.transport === "sse") {
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Compress tool descriptions to reduce token usage in router tool listings.
3
+ */
4
+ export declare function compressDescription(desc: string, maxLen?: number): string;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Compress tool descriptions to reduce token usage in router tool listings.
3
+ */
4
+ export function compressDescription(desc, maxLen = 80) {
5
+ if (desc.length <= maxLen) {
6
+ return desc;
7
+ }
8
+ // Try to cut at sentence boundary (". " before maxLen)
9
+ const searchArea = desc.slice(0, maxLen);
10
+ const sentenceEnd = searchArea.lastIndexOf(". ");
11
+ if (sentenceEnd > 0) {
12
+ return desc.slice(0, sentenceEnd + 1) + "\u2026";
13
+ }
14
+ // Fall back to word boundary
15
+ const lastSpace = searchArea.lastIndexOf(" ");
16
+ if (lastSpace > 0) {
17
+ return desc.slice(0, lastSpace) + "\u2026";
18
+ }
19
+ // No word boundary found, hard truncate
20
+ return desc.slice(0, maxLen) + "\u2026";
21
+ }
@@ -25,8 +25,30 @@ export class StdioTransport extends BaseTransport {
25
25
  async startProcess() {
26
26
  if (!this.config.command)
27
27
  return;
28
- const env = { ...process.env, ...resolveEnvRecord(this.config.env || {}, "env key") };
28
+ const configEnv = resolveEnvRecord(this.config.env || {}, "env key");
29
+ const env = { ...process.env, ...configEnv };
29
30
  const args = resolveArgs(this.config.args || [], env);
31
+ if (process.env.DEBUG_STDIO_ENV) {
32
+ this.logger.info(`[mcp-bridge] stdio spawn: ${this.config.command} ${args.join(" ")}`);
33
+ for (const [key, value] of Object.entries(configEnv)) {
34
+ const len = value.length;
35
+ const head = len > 4 ? value.slice(0, 4) : "****";
36
+ const tail = len > 4 ? value.slice(-4) : "****";
37
+ const hasPlaceholder = /\$\{/.test(value);
38
+ const inProcessEnv = process.env[key] !== undefined;
39
+ const processEnvLen = inProcessEnv ? (process.env[key]?.length ?? 0) : -1;
40
+ const processEnvMatch = inProcessEnv ? (process.env[key] === value) : null;
41
+ this.logger.info(`[mcp-bridge] stdio env: ${key} len=${len} head=${head}... tail=...${tail} placeholder=${hasPlaceholder} inProcessEnv=${inProcessEnv}(len=${processEnvLen}, match=${processEnvMatch})`);
42
+ }
43
+ // Log the FINAL merged value that the child will receive
44
+ for (const key of Object.keys(configEnv)) {
45
+ const finalVal = env[key] ?? "(undefined)";
46
+ const finalLen = typeof finalVal === "string" ? finalVal.length : -1;
47
+ const finalHead = typeof finalVal === "string" && finalLen > 4 ? finalVal.slice(0, 4) : "****";
48
+ const finalTail = typeof finalVal === "string" && finalLen > 4 ? finalVal.slice(-4) : "****";
49
+ this.logger.info(`[mcp-bridge] stdio env FINAL: ${key} len=${finalLen} head=${finalHead}... tail=...${finalTail}`);
50
+ }
51
+ }
30
52
  this.process = spawn(this.config.command, args, {
31
53
  stdio: ["pipe", "pipe", "pipe"],
32
54
  env
@@ -34,6 +56,9 @@ export class StdioTransport extends BaseTransport {
34
56
  if (!this.process.stdin || !this.process.stdout || !this.process.stderr) {
35
57
  throw new Error("Failed to create process pipes");
36
58
  }
59
+ if (process.env.DEBUG_STDIO_ENV) {
60
+ this.logger.info(`[mcp-bridge] stdio child PID: ${this.process.pid} (check /proc/${this.process.pid}/environ if needed)`);
61
+ }
37
62
  this.framingMode = this.config.framing || "auto";
38
63
  this.stdoutBuffer = Buffer.alloc(0);
39
64
  this.process.stdout.on("data", (data) => {
@@ -48,7 +73,13 @@ export class StdioTransport extends BaseTransport {
48
73
  this.processStdoutBuffer();
49
74
  });
50
75
  this.process.stderr.on("data", (data) => {
51
- this.logger.debug(`MCP server stderr: ${data.toString()}`);
76
+ const msg = data.toString();
77
+ if (process.env.DEBUG_STDIO_ENV) {
78
+ this.logger.info(`[mcp-bridge] stdio stderr: ${msg.trimEnd()}`);
79
+ }
80
+ else {
81
+ this.logger.debug(`MCP server stderr: ${msg}`);
82
+ }
52
83
  });
53
84
  this.process.on("exit", (code, signal) => {
54
85
  this.logger.debug(`MCP server process exited: code=${code}, signal=${signal}`);
@@ -24,6 +24,10 @@ export interface McpClientConfig {
24
24
  requestTimeoutMs?: number;
25
25
  routerIdleTimeoutMs?: number;
26
26
  routerMaxConcurrent?: number;
27
+ schemaCompression?: {
28
+ enabled?: boolean;
29
+ maxDescriptionLength?: number;
30
+ };
27
31
  }
28
32
  export interface McpTool {
29
33
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwerk/mcp-bridge",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "Standalone MCP server that multiplexes multiple MCP servers into one interface",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -0,0 +1,72 @@
1
+ # Atlassian MCP Server
2
+
3
+ Confluence wiki and Jira project management - search, create, and update pages and issues.
4
+
5
+ ## Requirements
6
+ - Python + uvx (or pip)
7
+ - Atlassian Cloud or Server/Data Center instance
8
+ - API token for authentication
9
+
10
+ ## Quick Install
11
+
12
+ ### Linux / macOS
13
+ ```bash
14
+ # Using mcp-bridge CLI:
15
+ mcp-bridge install atlassian
16
+ ```
17
+
18
+ ### Windows (PowerShell)
19
+ ```powershell
20
+ # Using mcp-bridge CLI:
21
+ mcp-bridge install atlassian
22
+ ```
23
+
24
+ ### Manual Setup
25
+ 1. Get your API token: https://id.atlassian.com/manage-profile/security/api-tokens
26
+ 2. Add to .env:
27
+ ```
28
+ CONFLUENCE_URL=https://your-domain.atlassian.net/wiki
29
+ CONFLUENCE_USERNAME=your@email.com
30
+ CONFLUENCE_API_TOKEN=your_token
31
+ JIRA_URL=https://your-domain.atlassian.net
32
+ JIRA_USERNAME=your@email.com
33
+ JIRA_API_TOKEN=your_token
34
+ ```
35
+ 3. Add config to ~/.mcp-bridge/config.json (see config.json)
36
+ 4. Restart mcp-bridge
37
+
38
+ ## Configuration
39
+
40
+ You can use Confluence only, Jira only, or both. Just set the env vars for the services you need.
41
+
42
+ ### Cloud vs Server/Data Center
43
+ - **Cloud**: Use API token authentication (as above)
44
+ - **Server/DC**: Use personal access token instead:
45
+ ```
46
+ CONFLUENCE_PERSONAL_TOKEN=your_pat
47
+ JIRA_PERSONAL_TOKEN=your_pat
48
+ ```
49
+
50
+ ## What you get
51
+
52
+ ### Confluence (12+ tools)
53
+ - Search pages and spaces
54
+ - Read, create, update, and delete pages
55
+ - Manage labels and attachments
56
+ - Get page comments
57
+
58
+ ### Jira (10+ tools)
59
+ - Search issues (JQL)
60
+ - Create, update, and transition issues
61
+ - Manage sprints and boards
62
+ - Add comments and attachments
63
+
64
+ 72 tools total. Uses [sooperset/mcp-atlassian](https://github.com/sooperset/mcp-atlassian) (MIT license).
65
+
66
+ ## Remove
67
+
68
+ ```bash
69
+ ./install-server.sh atlassian --remove
70
+ ```
71
+
72
+ Removes the server from config and cleans up the API tokens. The server recipe stays in `servers/atlassian/` for easy reinstall.
@@ -0,0 +1,6 @@
1
+ CONFLUENCE_URL
2
+ CONFLUENCE_USERNAME
3
+ CONFLUENCE_API_TOKEN
4
+ JIRA_URL
5
+ JIRA_USERNAME
6
+ JIRA_API_TOKEN
@@ -0,0 +1,3 @@
1
+ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
2
+ $ServerName = Split-Path -Leaf $ScriptDir
3
+ & (Join-Path $ScriptDir "..\..\install-server.ps1") $ServerName @args
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3
+ SERVER_NAME="$(basename "$SCRIPT_DIR")"
4
+ exec "$SCRIPT_DIR/../../install-server.sh" "$SERVER_NAME" "$@"
@@ -0,0 +1,69 @@
1
+ # Chrome DevTools MCP Server
2
+
3
+ Control and inspect a live Chrome browser for automation, debugging, and performance analysis.
4
+
5
+ ## Requirements
6
+ - Node.js + npx
7
+ - Chrome >= 144 (stable channel)
8
+ - No API key needed
9
+
10
+ ## Quick Install
11
+
12
+ ### Linux / macOS
13
+ ```bash
14
+ # Using mcp-bridge CLI:
15
+ mcp-bridge install chrome-devtools
16
+ ```
17
+
18
+ ### Windows (PowerShell)
19
+ ```powershell
20
+ # Using mcp-bridge CLI:
21
+ mcp-bridge install chrome-devtools
22
+ ```
23
+
24
+ ### Manual Setup
25
+ 1. Enable remote debugging in Chrome: open `chrome://inspect/#remote-debugging` and toggle it on
26
+ 2. Add config to ~/.mcp-bridge/config.json (see config.json)
27
+ 3. Restart mcp-bridge
28
+
29
+ ## Connection Modes
30
+
31
+ ### Auto-connect (default, recommended)
32
+ Connects to your running Chrome via native pipe. Chrome shows a permission dialog on each connection.
33
+ ```json
34
+ "args": ["-y", "chrome-devtools-mcp@0.20.0", "--autoConnect"]
35
+ ```
36
+
37
+ ### Browser URL
38
+ Connect to Chrome running with `--remote-debugging-port=9222`. No dialog needed.
39
+ ```json
40
+ "args": ["-y", "chrome-devtools-mcp@0.20.0", "--browserUrl", "http://127.0.0.1:9222"]
41
+ ```
42
+
43
+ ### Headless (standalone)
44
+ Launches its own headless Chrome instance. No existing browser needed.
45
+ ```json
46
+ "args": ["-y", "chrome-devtools-mcp@0.20.0", "--headless"]
47
+ ```
48
+
49
+ ## What you get
50
+ - **Navigation** (6 tools): navigate, open/close/list/select pages, wait for content
51
+ - **Input** (9 tools): click, hover, drag, fill forms, type text, press keys, upload files, handle dialogs
52
+ - **Debugging** (5 tools): page snapshots, screenshots, JS evaluation, console messages
53
+ - **Network** (2 tools): list/inspect network requests with full request/response bodies
54
+ - **Performance** (4 tools): record traces, analyze insights, memory snapshots, Lighthouse audits
55
+ - **Emulation** (2 tools): viewport, network throttling, geolocation, dark mode
56
+
57
+ 28 tools total. See [full tool reference](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md).
58
+
59
+ ## Privacy Notes
60
+ - Google collects usage statistics by default. Opt out with `--no-usage-statistics`
61
+ - Performance tools may send URLs to Google CrUX API. Disable with `--no-performance-crux`
62
+
63
+ ## Remove
64
+
65
+ ```bash
66
+ ./install-server.sh chrome-devtools --remove
67
+ ```
68
+
69
+ Removes the server from config. The server recipe stays in `servers/chrome-devtools/` for easy reinstall.
@@ -0,0 +1,16 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "name": "chrome-devtools",
4
+ "description": "Control and inspect a live Chrome browser for automation, debugging, and performance analysis",
5
+ "transport": "stdio",
6
+ "command": "npx",
7
+ "args": [
8
+ "-y",
9
+ "chrome-devtools-mcp@0.20.0",
10
+ "--autoConnect"
11
+ ],
12
+ "env": {},
13
+ "authRequired": false,
14
+ "homepage": "https://github.com/ChromeDevTools/chrome-devtools-mcp",
15
+ "notes": "Requires Chrome >= 144 with remote debugging enabled at chrome://inspect/#remote-debugging. Chrome will show a permission dialog on each connection."
16
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
2
+ $ServerName = Split-Path -Leaf $ScriptDir
3
+ & (Join-Path $ScriptDir "..\..\install-server.ps1") $ServerName @args
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3
+ SERVER_NAME="$(basename "$SCRIPT_DIR")"
4
+ exec "$SCRIPT_DIR/../../install-server.sh" "$SERVER_NAME" "$@"
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "servers": {
4
+ "chrome-devtools": {
5
+ "description": "Control and inspect a live Chrome browser",
6
+ "transport": "stdio",
7
+ "authRequired": false,
8
+ "homepage": "https://github.com/ChromeDevTools/chrome-devtools-mcp",
9
+ "installMethod": "npx",
10
+ "envVars": [],
11
+ "notes": "Requires Chrome >= 144 with chrome://inspect/#remote-debugging enabled"
12
+ },
4
13
  "apify": {
5
14
  "description": "web scraping & automation",
6
15
  "transport": "streamable-http",