@aiwerk/mcp-bridge 1.2.0 → 1.2.2
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/dist/src/config.d.ts +11 -0
- package/dist/src/config.js +31 -0
- package/dist/src/transport-base.js +10 -0
- package/package.json +1 -1
- package/servers/atlassian/config.json +19 -0
- package/servers/google-maps/config.json +1 -1
- package/servers/index.json +15 -0
- package/servers/stripe/config.json +1 -1
- package/servers/tavily/config.json +1 -1
package/dist/src/config.d.ts
CHANGED
|
@@ -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 {
|
package/dist/src/config.js
CHANGED
|
@@ -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
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"name": "atlassian",
|
|
4
|
+
"description": "Confluence wiki and Jira project management (search, create, update pages and issues)",
|
|
5
|
+
"transport": "stdio",
|
|
6
|
+
"command": "uvx",
|
|
7
|
+
"args": ["mcp-atlassian"],
|
|
8
|
+
"env": {
|
|
9
|
+
"CONFLUENCE_URL": "${CONFLUENCE_URL}",
|
|
10
|
+
"CONFLUENCE_USERNAME": "${CONFLUENCE_USERNAME}",
|
|
11
|
+
"CONFLUENCE_API_TOKEN": "${CONFLUENCE_API_TOKEN}",
|
|
12
|
+
"JIRA_URL": "${JIRA_URL}",
|
|
13
|
+
"JIRA_USERNAME": "${JIRA_USERNAME}",
|
|
14
|
+
"JIRA_API_TOKEN": "${JIRA_API_TOKEN}"
|
|
15
|
+
},
|
|
16
|
+
"authRequired": true,
|
|
17
|
+
"credentialsUrl": "https://id.atlassian.com/manage-profile/security/api-tokens",
|
|
18
|
+
"homepage": "https://github.com/sooperset/mcp-atlassian"
|
|
19
|
+
}
|
package/servers/index.json
CHANGED
|
@@ -11,6 +11,21 @@
|
|
|
11
11
|
"APIFY_TOKEN"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
|
+
"atlassian": {
|
|
15
|
+
"description": "Confluence wiki & Jira project management",
|
|
16
|
+
"transport": "stdio",
|
|
17
|
+
"authRequired": true,
|
|
18
|
+
"homepage": "https://github.com/sooperset/mcp-atlassian",
|
|
19
|
+
"installMethod": "uvx",
|
|
20
|
+
"envVars": [
|
|
21
|
+
"CONFLUENCE_URL",
|
|
22
|
+
"CONFLUENCE_USERNAME",
|
|
23
|
+
"CONFLUENCE_API_TOKEN",
|
|
24
|
+
"JIRA_URL",
|
|
25
|
+
"JIRA_USERNAME",
|
|
26
|
+
"JIRA_API_TOKEN"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
14
29
|
"github": {
|
|
15
30
|
"description": "repos, issues, PRs",
|
|
16
31
|
"transport": "stdio",
|