Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

fix: clearer reason for key flags

ogsamrat8cc74fd0a46d
diff --git a/apps/server/src/mcp-allow/PARITY.sha256 b/apps/server/src/mcp-allow/PARITY.sha256
index e6cdda4e..b410a9cc 100644
--- a/apps/server/src/mcp-allow/PARITY.sha256
+++ b/apps/server/src/mcp-allow/PARITY.sha256
@@ -1,4 +1,4 @@
# The MCP allowlist module: the same files in omnirush-cli (src/mcp/) and omnirush-gui (apps/server/src/mcp-allow/).
# A change to one must be ported to the other and this list updated in both.
-5bdd9e1ba56bfe55fdb67ae4eb8be689abdf721364c5fe6c70d75d989edd433a mcp-allow.mjs
+80be9bea990f9de88899e4785828f6352b7f36c8a249bcac30882fabbfb0c97a mcp-allow.mjs
482fb25ea7dba6dc91aeeb24891e0b2e94d4abe8ff585b0068eb2a7575e75491 mcp-allow.d.mts
diff --git a/apps/server/src/mcp-allow/mcp-allow.mjs b/apps/server/src/mcp-allow/mcp-allow.mjs
index 52c9bae0..88e81c1d 100644
--- a/apps/server/src/mcp-allow/mcp-allow.mjs
+++ b/apps/server/src/mcp-allow/mcp-allow.mjs
@@ -49,6 +49,7 @@ export const MCP_REASONS = {
missing_flag: "This MCP server needs a setting that points at a file in the project.",
missing_arg: "This MCP server needs the file it works on, inside the project, as its argument.",
flag: "This MCP server setting is not supported: it reaches outside the project.",
+ secret_flag: "A key or token is not supported in a config file (it would travel with the project): set it in your environment instead.",
duplicate: "Another entry already starts this MCP server.",
invalid: "This MCP server entry is not valid.",
runner_missing: "npx or uvx was not found on this computer outside the project folder, so the server does not start.",
@@ -579,7 +580,7 @@ export function evaluateMcp(mcpMap, policy, ctx = {}) {
if (box && !boxHere) notes.push("runs on this computer (needs your key)");
if (rules.allow_flags) {
const other = rest.map((a) => (a.includes("=") ? a.slice(0, a.indexOf("=")) : a)).find((a) => a.startsWith("-") && !rules.allow_flags.includes(a));
- if (other) refusal = blocked(name, "flag", { ...base, version, reason: `${MCP_REASONS.flag} (${other})` });
+ if (other) refusal = blocked(name, "flag", { ...base, version, reason: `${/key|token|secret|passw/i.test(other) ? MCP_REASONS.secret_flag : MCP_REASONS.flag} (${other})` });
}
if (!refusal) for (const [flag, values] of Object.entries(rules.flag_values ?? {})) {
const found = flagValue(rest, flag);