@koda-sl/baker-cli 0.158.2 → 0.159.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 +1 -1
- package/dist/cli.js +48 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2642,7 +2642,7 @@ baker mcp add --name mine --url https://my.dev/mcp --scope user
|
|
|
2642
2642
|
baker mcp remove --name weather
|
|
2643
2643
|
```
|
|
2644
2644
|
|
|
2645
|
-
- `--url` must be HTTPS and public; loopback / private / cloud-metadata hosts are rejected.
|
|
2645
|
+
- `--url` must be the **full MCP endpoint** (commonly ending in `/mcp`), HTTPS and public; loopback / private / cloud-metadata hosts are rejected. A bare domain frequently accepts the OAuth sign-in and then serves no tools, so every address is handshake-checked after it changes: `connected` and `list` report `usable: false` plus a `problem` (and a `suggestedAddress` when the server advertises a better endpoint) for a server that isn't serving tools, or `lastCheck: failed` when the last check only hit an outage — that one may work anyway, and a later turn re-checks it automatically. Repointing a server at a different host clears its saved sign-in: a token belongs to the host that issued it, so the server has to be connected again.
|
|
2646
2646
|
- Scope is two independent choices — audience (just you / everyone) × level (this company / whole org):
|
|
2647
2647
|
- `--scope company` (default) — everyone in this company.
|
|
2648
2648
|
- `--scope org` — everyone across the org; needs an admin API key.
|
package/dist/cli.js
CHANGED
|
@@ -29494,6 +29494,20 @@ function parseScope(raw) {
|
|
|
29494
29494
|
function actingUserId() {
|
|
29495
29495
|
return getEnv().BAKER_ACTING_USER_ID;
|
|
29496
29496
|
}
|
|
29497
|
+
function customEntry(server) {
|
|
29498
|
+
const failed = server.health && !server.health.ok;
|
|
29499
|
+
const problem = server.health?.message ?? "This server's address is not serving tools.";
|
|
29500
|
+
return {
|
|
29501
|
+
name: server.name,
|
|
29502
|
+
scope: server.scope,
|
|
29503
|
+
enabled: server.enabled,
|
|
29504
|
+
...failed && !server.health?.transient ? { usable: false, problem } : {},
|
|
29505
|
+
...failed && server.health?.transient ? { lastCheck: "failed", problem } : {},
|
|
29506
|
+
...failed && server.health?.suggestedUrl ? { suggestedAddress: server.health.suggestedUrl } : {}
|
|
29507
|
+
};
|
|
29508
|
+
}
|
|
29509
|
+
var BROKEN_SERVER_HINT = "A server marked usable=false will NOT answer: its tools are absent from this turn. Say plainly that the tool is not working and relay `problem`; never claim its tools are loading, coming next message, or temporarily unavailable. Fixing it needs a person: the user updates its address in the dashboard (Brain \u2192 Integrations \u2192 MCPs). If `suggestedAddress` is present, that is the address to use.";
|
|
29510
|
+
var LAST_CHECK_FAILED_HINT = "A server with lastCheck=failed was unreachable or erroring when it was last checked \u2014 that may already have passed, and its tools ARE loaded this turn. Try the tool; if it works, say nothing about the check. If it fails, report `problem` as what happened rather than guessing.";
|
|
29497
29511
|
function parseHeaders(raw) {
|
|
29498
29512
|
const list = raw === void 0 ? [] : Array.isArray(raw) ? raw : [raw];
|
|
29499
29513
|
const headers = {};
|
|
@@ -29540,8 +29554,14 @@ A tool the user names that is NOT listed here is simply not connected yet.`
|
|
|
29540
29554
|
...c.accountLabel ? { account: c.accountLabel } : {},
|
|
29541
29555
|
...c.readOnly ? { readOnly: true } : {}
|
|
29542
29556
|
}));
|
|
29543
|
-
const custom = data.custom.map(
|
|
29557
|
+
const custom = data.custom.map(customEntry);
|
|
29544
29558
|
const hints = [];
|
|
29559
|
+
if (data.custom.some((s) => s.health && !s.health.ok && !s.health.transient)) {
|
|
29560
|
+
hints.push(BROKEN_SERVER_HINT);
|
|
29561
|
+
}
|
|
29562
|
+
if (data.custom.some((s) => s.health && !s.health.ok && s.health.transient)) {
|
|
29563
|
+
hints.push(LAST_CHECK_FAILED_HINT);
|
|
29564
|
+
}
|
|
29545
29565
|
if (data.managedDisabled) {
|
|
29546
29566
|
hints.push("Managed integrations are disabled for this company \u2014 only custom MCP servers load.");
|
|
29547
29567
|
}
|
|
@@ -29577,7 +29597,15 @@ var listCommand13 = defineCommand139({
|
|
|
29577
29597
|
"/api/mcp/custom",
|
|
29578
29598
|
user ? { actingUserId: user } : void 0
|
|
29579
29599
|
);
|
|
29580
|
-
writeJson({
|
|
29600
|
+
writeJson({
|
|
29601
|
+
ok: true,
|
|
29602
|
+
// Detail view: the full row (address included) plus the usability verdict.
|
|
29603
|
+
// `health` itself is folded into `usable`/`problem` by `customEntry`.
|
|
29604
|
+
data: data.servers.map((server) => ({ ...server, health: void 0, ...customEntry(server) })),
|
|
29605
|
+
...data.servers.some((s) => s.health && !s.health.ok) ? {
|
|
29606
|
+
hints: data.servers.some((s) => s.health && !s.health.ok && !s.health.transient) ? [BROKEN_SERVER_HINT] : [LAST_CHECK_FAILED_HINT]
|
|
29607
|
+
} : {}
|
|
29608
|
+
});
|
|
29581
29609
|
} catch (err) {
|
|
29582
29610
|
fail6(err);
|
|
29583
29611
|
}
|
|
@@ -29588,7 +29616,11 @@ registerSchema({
|
|
|
29588
29616
|
description: "Register a custom MCP server. Tools appear as mcp__<name>__* on the next message. URL must be HTTPS. Scope: company (default, all chats) | org (org admin key) | user (only the current sender).",
|
|
29589
29617
|
args: {
|
|
29590
29618
|
name: { type: "string", description: "Server name \u2192 tools appear as mcp__<name>__*", required: true },
|
|
29591
|
-
url: {
|
|
29619
|
+
url: {
|
|
29620
|
+
type: "string",
|
|
29621
|
+
description: "Full HTTPS MCP endpoint (commonly ends in /mcp, not just the domain)",
|
|
29622
|
+
required: true
|
|
29623
|
+
},
|
|
29592
29624
|
scope: { type: "string", description: "user | user_org | company | org (default company)", required: false },
|
|
29593
29625
|
header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
|
|
29594
29626
|
}
|
|
@@ -29607,7 +29639,11 @@ Examples:
|
|
|
29607
29639
|
},
|
|
29608
29640
|
args: {
|
|
29609
29641
|
name: { type: "string", description: "Server name (mcp__<name>__*)", required: true },
|
|
29610
|
-
url: {
|
|
29642
|
+
url: {
|
|
29643
|
+
type: "string",
|
|
29644
|
+
description: "Full HTTPS MCP endpoint (commonly ends in /mcp, not just the domain)",
|
|
29645
|
+
required: true
|
|
29646
|
+
},
|
|
29611
29647
|
scope: { type: "string", description: "user | user_org | company | org (default company)", required: false },
|
|
29612
29648
|
header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
|
|
29613
29649
|
},
|
|
@@ -29623,7 +29659,14 @@ Examples:
|
|
|
29623
29659
|
...user ? { actingUserId: user } : {},
|
|
29624
29660
|
...headers ? { headers } : {}
|
|
29625
29661
|
});
|
|
29626
|
-
writeJson({
|
|
29662
|
+
writeJson({
|
|
29663
|
+
ok: true,
|
|
29664
|
+
data,
|
|
29665
|
+
hints: [
|
|
29666
|
+
"The address must be the full MCP endpoint (commonly ending in /mcp), not just the domain \u2014 a domain on its own usually answers sign-in and then serves no tools.",
|
|
29667
|
+
"The address is checked in the background. Run `baker mcp connected` on the next message to confirm it serves tools before promising the user anything."
|
|
29668
|
+
]
|
|
29669
|
+
});
|
|
29627
29670
|
} catch (err) {
|
|
29628
29671
|
fail6(err);
|
|
29629
29672
|
}
|