@okostream/mcp 0.12.6 → 0.12.7
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 +12 -2
- package/dist/server.js +50 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,8 +82,9 @@ published version. The server reports the latest version during the key
|
|
|
82
82
|
exchange: `oko_whoami` and `oko_connection_status` return `update`, and the
|
|
83
83
|
first results of a session carry an `UPDATE AVAILABLE` block while the client
|
|
84
84
|
is behind, with the exact update step. Global installs update with
|
|
85
|
-
`npm install -g @okostream/mcp@latest
|
|
86
|
-
|
|
85
|
+
`npm install -g @okostream/mcp@latest`. Claude Desktop is not offered for
|
|
86
|
+
now (the extension bundle is discontinued; the Desktop path returns when the
|
|
87
|
+
package ships through a directory).
|
|
87
88
|
|
|
88
89
|
## When a tool refuses
|
|
89
90
|
|
|
@@ -96,6 +97,15 @@ Refusals are explicit and never require guessing:
|
|
|
96
97
|
OKO team.
|
|
97
98
|
- `PLATFORM_REJECTED_READ` — no access to that resource, or it does not exist.
|
|
98
99
|
|
|
100
|
+
**One install path.** Every supported client — Claude Code, Codex, and any
|
|
101
|
+
MCP client that takes a command with arguments and env — runs the package
|
|
102
|
+
through `npx -y @okostream/mcp@latest` (Node.js required): the latest version
|
|
103
|
+
is installed on each restart, so the server never falls behind. The `.mcpb`
|
|
104
|
+
extension bundle for Claude Desktop is no longer distributed — it never
|
|
105
|
+
updated itself — and the Claude Desktop path is archived until the package
|
|
106
|
+
ships through a directory. The key exchange refuses versions behind the
|
|
107
|
+
latest published one and tells the assistant how to update.
|
|
108
|
+
|
|
99
109
|
Image URLs are fetched by the OKO server first, so a VPN, proxy or captive
|
|
100
110
|
portal on the organizer's machine is not in the way. If the server cannot
|
|
101
111
|
reach the URL (a private host, a login wall, a timeout), the MCP client
|
package/dist/server.js
CHANGED
|
@@ -70503,7 +70503,7 @@ var OKO_CONNECTION_STATUSES = [
|
|
|
70503
70503
|
"rate_limited",
|
|
70504
70504
|
"unavailable"
|
|
70505
70505
|
];
|
|
70506
|
-
function nextSteps(status, minimumVersion) {
|
|
70506
|
+
function nextSteps(status, minimumVersion, latestVersion) {
|
|
70507
70507
|
switch (status) {
|
|
70508
70508
|
case "connected":
|
|
70509
70509
|
return [{
|
|
@@ -70543,7 +70543,7 @@ function nextSteps(status, minimumVersion) {
|
|
|
70543
70543
|
return [
|
|
70544
70544
|
{
|
|
70545
70545
|
id: "update_package",
|
|
70546
|
-
label: `Update to @okostream/mcp@latest${
|
|
70546
|
+
label: `Update to @okostream/mcp@latest${latestVersion ? ` (${latestVersion} is published` : ""}${minimumVersion ? `${latestVersion ? "; " : " ("}minimum ${minimumVersion}` : ""}${latestVersion || minimumVersion ? ")" : ""}.`,
|
|
70547
70547
|
command: "npx -y @okostream/mcp@latest"
|
|
70548
70548
|
},
|
|
70549
70549
|
{
|
|
@@ -70566,7 +70566,7 @@ function nextSteps(status, minimumVersion) {
|
|
|
70566
70566
|
function buildConnectionStatus(status, options2 = {}) {
|
|
70567
70567
|
const connected = status === "connected";
|
|
70568
70568
|
const errorCode = connected ? null : status === "update_required" ? "CLIENT_UPGRADE_REQUIRED" : status === "rate_limited" ? "RATE_LIMITED" : status === "unavailable" ? "SERVICE_UNAVAILABLE" : "AUTH_REQUIRED";
|
|
70569
|
-
const message = connected ? "OKO MCP is connected to an active organizer account." : status === "not_configured" ? "OKO MCP is installed, but OKO_API_KEY is not configured." : status === "invalid_key" ? "OKO MCP is installed, but the configured API key is invalid or revoked." : status === "update_required" ? "This OKO MCP client version is no longer supported." : status === "rate_limited" ? "OKO temporarily rate-limited the connection attempt." : "OKO MCP could not verify the organizer connection.";
|
|
70569
|
+
const message = connected ? "OKO MCP is connected to an active organizer account." : status === "not_configured" ? "OKO MCP is installed, but OKO_API_KEY is not configured." : status === "invalid_key" ? "OKO MCP is installed, but the configured API key is invalid or revoked." : status === "update_required" ? options2.serverMessage ?? "This OKO MCP client version is no longer supported." : status === "rate_limited" ? "OKO temporarily rate-limited the connection attempt." : "OKO MCP could not verify the organizer connection.";
|
|
70570
70570
|
return {
|
|
70571
70571
|
connected,
|
|
70572
70572
|
status,
|
|
@@ -70576,8 +70576,9 @@ function buildConnectionStatus(status, options2 = {}) {
|
|
|
70576
70576
|
organizerAccountRequired: true,
|
|
70577
70577
|
credentialConfigured: status !== "not_configured",
|
|
70578
70578
|
links: OKO_ONBOARDING_URLS,
|
|
70579
|
-
nextSteps: nextSteps(status, options2.minimumVersion),
|
|
70579
|
+
nextSteps: nextSteps(status, options2.minimumVersion, options2.latestVersion),
|
|
70580
70580
|
...options2.minimumVersion ? { minimumVersion: options2.minimumVersion } : {},
|
|
70581
|
+
...options2.latestVersion ? { latestVersion: options2.latestVersion } : {},
|
|
70581
70582
|
...options2.uid ? { uid: options2.uid } : {},
|
|
70582
70583
|
...options2.scopes ? { scopes: options2.scopes } : {},
|
|
70583
70584
|
...options2.update ? { update: options2.update } : {}
|
|
@@ -116223,11 +116224,14 @@ function sanitizeScopes(scopes) {
|
|
|
116223
116224
|
}
|
|
116224
116225
|
|
|
116225
116226
|
// build/version.js
|
|
116226
|
-
var OKO_MCP_VERSION = "0.12.
|
|
116227
|
+
var OKO_MCP_VERSION = "0.12.7";
|
|
116227
116228
|
|
|
116228
116229
|
// build/auth.js
|
|
116229
116230
|
var state = null;
|
|
116230
116231
|
var latestPublishedVersion = null;
|
|
116232
|
+
function recordLatestPublishedVersion(version9) {
|
|
116233
|
+
latestPublishedVersion = version9 && parseVersion(version9) ? version9.trim() : null;
|
|
116234
|
+
}
|
|
116231
116235
|
var OkoScopeError = class extends Error {
|
|
116232
116236
|
scope;
|
|
116233
116237
|
constructor(scope) {
|
|
@@ -116258,7 +116262,7 @@ function isNewerVersion(candidate, current) {
|
|
|
116258
116262
|
var MCP_UPDATE_HOW_TO = [
|
|
116259
116263
|
"Restart the MCP client. With the default `npx -y @okostream/mcp@latest` command the restart installs the newest version automatically.",
|
|
116260
116264
|
"Global install: run `npm install -g @okostream/mcp@latest`, then restart the client.",
|
|
116261
|
-
|
|
116265
|
+
'Claude Desktop with the extension bundle: the bundle is discontinued and never updated itself; switch to Claude Code, Codex, or the "Other MCP" configuration from https://okostream.app/app/mcp.'
|
|
116262
116266
|
];
|
|
116263
116267
|
function updateStatus() {
|
|
116264
116268
|
const latest = latestPublishedVersion;
|
|
@@ -116279,13 +116283,28 @@ function currentUid() {
|
|
|
116279
116283
|
var OkoAuthError = class extends Error {
|
|
116280
116284
|
status;
|
|
116281
116285
|
minimumVersion;
|
|
116282
|
-
|
|
116286
|
+
latestVersion;
|
|
116287
|
+
serverMessage;
|
|
116288
|
+
constructor(status, message, details = {}) {
|
|
116283
116289
|
super(message);
|
|
116284
116290
|
this.status = status;
|
|
116285
|
-
this.minimumVersion = minimumVersion;
|
|
116286
116291
|
this.name = "OkoAuthError";
|
|
116292
|
+
this.minimumVersion = details.minimumVersion;
|
|
116293
|
+
this.latestVersion = details.latestVersion;
|
|
116294
|
+
this.serverMessage = details.serverMessage;
|
|
116287
116295
|
}
|
|
116288
116296
|
};
|
|
116297
|
+
function versionField(value) {
|
|
116298
|
+
return typeof value === "string" && parseVersion(value) ? value.trim() : void 0;
|
|
116299
|
+
}
|
|
116300
|
+
function upgradeRequiredError(body) {
|
|
116301
|
+
const parsed = body && typeof body === "object" ? body : {};
|
|
116302
|
+
const minimumVersion = versionField(parsed.minimumVersion);
|
|
116303
|
+
const latestVersion = versionField(parsed.latestVersion);
|
|
116304
|
+
const serverMessage = typeof parsed.message === "string" && parsed.message.trim() ? parsed.message.trim() : void 0;
|
|
116305
|
+
const fallback = `OKO MCP ${OKO_MCP_VERSION} is no longer supported. Update to @okostream/mcp@latest (minimum ${minimumVersion ?? "the current release"}${latestVersion ? `, latest ${latestVersion}` : ""}) and restart the MCP client.`;
|
|
116306
|
+
return new OkoAuthError("update_required", serverMessage ?? fallback, { minimumVersion, latestVersion, serverMessage });
|
|
116307
|
+
}
|
|
116289
116308
|
async function exchangeApiKey() {
|
|
116290
116309
|
if (!env.apiKey) {
|
|
116291
116310
|
throw new OkoAuthError("not_configured", "OKO MCP is installed but not connected. Configure OKO_API_KEY, then restart or reconnect the MCP server.");
|
|
@@ -116304,8 +116323,10 @@ async function exchangeApiKey() {
|
|
|
116304
116323
|
const status = response.status;
|
|
116305
116324
|
const errorBody = await response.json().catch(() => ({}));
|
|
116306
116325
|
if (status === 426) {
|
|
116307
|
-
const
|
|
116308
|
-
|
|
116326
|
+
const error3 = upgradeRequiredError(errorBody);
|
|
116327
|
+
if (error3.latestVersion)
|
|
116328
|
+
recordLatestPublishedVersion(error3.latestVersion);
|
|
116329
|
+
throw error3;
|
|
116309
116330
|
}
|
|
116310
116331
|
if (status === 429) {
|
|
116311
116332
|
throw new OkoAuthError("rate_limited", "OKO API key exchange is temporarily rate-limited. Wait one minute, then restart the MCP client.");
|
|
@@ -116342,7 +116363,7 @@ async function ensureAuth(requiredScopes = []) {
|
|
|
116342
116363
|
expiresAt: now + exchanged.expiresIn * 1e3
|
|
116343
116364
|
};
|
|
116344
116365
|
if (exchanged.latestVersion)
|
|
116345
|
-
|
|
116366
|
+
recordLatestPublishedVersion(exchanged.latestVersion);
|
|
116346
116367
|
}
|
|
116347
116368
|
for (const scope of requiredScopes) {
|
|
116348
116369
|
if (!state.scopes.includes(scope)) {
|
|
@@ -116366,16 +116387,21 @@ async function getConnectionStatus() {
|
|
|
116366
116387
|
});
|
|
116367
116388
|
} catch (error3) {
|
|
116368
116389
|
if (error3 instanceof OkoAuthError) {
|
|
116369
|
-
return buildConnectionStatus(error3.status,
|
|
116390
|
+
return buildConnectionStatus(error3.status, authErrorOptions(error3));
|
|
116370
116391
|
}
|
|
116371
116392
|
return buildConnectionStatus("unavailable");
|
|
116372
116393
|
}
|
|
116373
116394
|
}
|
|
116395
|
+
function authErrorOptions(error3) {
|
|
116396
|
+
return {
|
|
116397
|
+
minimumVersion: error3.minimumVersion,
|
|
116398
|
+
latestVersion: error3.latestVersion,
|
|
116399
|
+
serverMessage: error3.serverMessage
|
|
116400
|
+
};
|
|
116401
|
+
}
|
|
116374
116402
|
function authErrorResult(error3) {
|
|
116375
116403
|
return {
|
|
116376
|
-
...textResult(buildConnectionStatus(error3.status,
|
|
116377
|
-
minimumVersion: error3.minimumVersion
|
|
116378
|
-
})),
|
|
116404
|
+
...textResult(buildConnectionStatus(error3.status, authErrorOptions(error3))),
|
|
116379
116405
|
isError: true
|
|
116380
116406
|
};
|
|
116381
116407
|
}
|
|
@@ -119052,26 +119078,28 @@ function platformRejectionResult(toolName, args, readOnly) {
|
|
|
119052
119078
|
isError: true
|
|
119053
119079
|
};
|
|
119054
119080
|
}
|
|
119055
|
-
var
|
|
119081
|
+
var UPDATE_NOTICE_FULL_LIMIT = 3;
|
|
119056
119082
|
var updateNoticesShown = 0;
|
|
119083
|
+
function updateNoticeText(status, shownSoFar) {
|
|
119084
|
+
if (shownSoFar < UPDATE_NOTICE_FULL_LIMIT) {
|
|
119085
|
+
return `UPDATE AVAILABLE: ${status.message} How to update: ${(status.howTo ?? []).join(" ")}`;
|
|
119086
|
+
}
|
|
119087
|
+
return `UPDATE AVAILABLE: OKO MCP ${status.current} \u2192 ${status.latest}. Restart the MCP client to install it (npx does it automatically); see oko_connection_status for the steps.`;
|
|
119088
|
+
}
|
|
119057
119089
|
function withUpdateNotice(result) {
|
|
119058
|
-
if (updateNoticesShown >= UPDATE_NOTICE_LIMIT)
|
|
119059
|
-
return result;
|
|
119060
119090
|
const status = updateStatus();
|
|
119061
119091
|
if (!status.updateAvailable || !result || typeof result !== "object")
|
|
119062
119092
|
return result;
|
|
119063
119093
|
const typed = result;
|
|
119064
119094
|
if (!Array.isArray(typed.content))
|
|
119065
119095
|
return result;
|
|
119096
|
+
const text = updateNoticeText(status, updateNoticesShown);
|
|
119066
119097
|
updateNoticesShown += 1;
|
|
119067
119098
|
return {
|
|
119068
119099
|
...typed,
|
|
119069
119100
|
content: [
|
|
119070
119101
|
...typed.content,
|
|
119071
|
-
{
|
|
119072
|
-
type: "text",
|
|
119073
|
-
text: `UPDATE AVAILABLE: ${status.message} How to update: ${(status.howTo ?? []).join(" ")}`
|
|
119074
|
-
}
|
|
119102
|
+
{ type: "text", text }
|
|
119075
119103
|
]
|
|
119076
119104
|
};
|
|
119077
119105
|
}
|