@aiwerk/mcp-bridge 1.2.1 → 1.2.3

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.
@@ -1,4 +1,15 @@
1
1
  import { BridgeConfig, Logger } from "./types.js";
2
+ /**
3
+ * Load ~/.openclaw/.env as a fallback env source.
4
+ *
5
+ * When running as an OpenClaw plugin, dotenv uses `override: false` which means
6
+ * pre-existing env vars (even empty strings) take precedence over .env values.
7
+ * This fallback allows the bridge to recover the intended .env values when
8
+ * process.env has empty/missing entries.
9
+ */
10
+ export declare function loadOpenClawDotEnvFallback(): Record<string, string>;
11
+ /** Reset the cached OpenClaw .env (for testing). */
12
+ export declare function resetOpenClawDotEnvCache(): void;
2
13
  /** Parse a simple KEY=VALUE .env file (no npm dependency). */
3
14
  export declare function parseEnvFile(content: string): Record<string, string>;
4
15
  export interface LoadConfigOptions {
@@ -6,6 +6,37 @@ import { randomBytes } from "crypto";
6
6
  const DEFAULT_CONFIG_DIR = join(homedir(), ".mcp-bridge");
7
7
  const DEFAULT_CONFIG_FILE = "config.json";
8
8
  const DEFAULT_ENV_FILE = ".env";
9
+ /** Cached fallback env from ~/.openclaw/.env (loaded once). */
10
+ let _openclawDotEnvCache = null;
11
+ /**
12
+ * Load ~/.openclaw/.env as a fallback env source.
13
+ *
14
+ * When running as an OpenClaw plugin, dotenv uses `override: false` which means
15
+ * pre-existing env vars (even empty strings) take precedence over .env values.
16
+ * This fallback allows the bridge to recover the intended .env values when
17
+ * process.env has empty/missing entries.
18
+ */
19
+ export function loadOpenClawDotEnvFallback() {
20
+ if (_openclawDotEnvCache !== null)
21
+ return _openclawDotEnvCache;
22
+ const openclawEnvPath = join(process.env.OPENCLAW_CONFIG_DIR || join(homedir(), ".openclaw"), ".env");
23
+ if (existsSync(openclawEnvPath)) {
24
+ try {
25
+ _openclawDotEnvCache = parseEnvFile(readFileSync(openclawEnvPath, "utf-8"));
26
+ }
27
+ catch {
28
+ _openclawDotEnvCache = {};
29
+ }
30
+ }
31
+ else {
32
+ _openclawDotEnvCache = {};
33
+ }
34
+ return _openclawDotEnvCache;
35
+ }
36
+ /** Reset the cached OpenClaw .env (for testing). */
37
+ export function resetOpenClawDotEnvCache() {
38
+ _openclawDotEnvCache = null;
39
+ }
9
40
  /** Parse a simple KEY=VALUE .env file (no npm dependency). */
10
41
  export function parseEnvFile(content) {
11
42
  const env = {};
@@ -1,3 +1,4 @@
1
+ import { loadOpenClawDotEnvFallback } from "./config.js";
1
2
  /**
2
3
  * Base class for all MCP transports. Provides shared logic for:
3
4
  * - Message handling (JSON-RPC response routing, notification dispatch)
@@ -119,6 +120,15 @@ export class BaseTransport {
119
120
  export function resolveEnvVars(value, contextDescription, extraEnv) {
120
121
  return value.replace(/\$\{(\w+)\}/g, (_, varName) => {
121
122
  const resolved = extraEnv?.[varName] ?? process.env[varName];
123
+ // If resolved is undefined or empty string, try the OpenClaw .env fallback.
124
+ // This handles the case where dotenv(override:false) didn't overwrite a
125
+ // pre-existing empty env var in process.env.
126
+ if (resolved === undefined || resolved === "") {
127
+ const fallback = loadOpenClawDotEnvFallback()[varName];
128
+ if (fallback !== undefined && fallback !== "") {
129
+ return fallback;
130
+ }
131
+ }
122
132
  if (resolved === undefined) {
123
133
  throw new Error(`[mcp-bridge] Missing required environment variable "${varName}" while resolving ${contextDescription}`);
124
134
  }
@@ -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}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwerk/mcp-bridge",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
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",