@scorehub/mcp-server 0.3.2 → 0.4.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.en.md CHANGED
@@ -10,7 +10,7 @@ Chinese version: [README.md](./README.md)
10
10
 
11
11
  ## Overview
12
12
 
13
- `@scorehub/mcp-server` runs on your computer between MCP clients such as Claude Code, Claude Desktop, and WorkBuddy and the ScoreHub remote MCP server. It provides:
13
+ `@scorehub/mcp-server` runs on your computer between MCP clients such as WorkBuddy and Codex and the ScoreHub remote MCP server. It provides:
14
14
 
15
15
  - **OAuth login**: Opens a browser for authorization when needed and caches ScoreHub tokens locally.
16
16
  - **Token lifecycle management**: Checks token validity before calls, refreshes tokens within five minutes of expiry, and keeps long-running sessions alive every four hours.
@@ -19,7 +19,7 @@ Chinese version: [README.md](./README.md)
19
19
  ```
20
20
  ┌─────────────┐ stdio ┌──────────────────┐ Streamable HTTP ┌─────────────────┐
21
21
  │ AI client │ ◄────────────► │ @scorehub/ │ ◄─────────────────► │ ScoreHub │
22
- │ Claude etc.│ │ mcp-server │ │ Remote MCP │
22
+ │ WorkBuddy etc│ │ mcp-server │ │ Remote MCP │
23
23
  └─────────────┘ └──────────────────┘ └────────┬────────┘
24
24
  │
25
25
  TikTok Shop
@@ -59,12 +59,22 @@ Common configuration locations are:
59
59
 
60
60
  | Client | Configuration file |
61
61
  |---|---|
62
- | Claude Code / Claude Desktop | The MCP configuration file used by the client, such as `claude_desktop_config.json` or `.claude/mcp.json` |
62
+ | Other MCP clients | The MCP configuration file used by that client |
63
63
  | WorkBuddy | `mcp.json` |
64
64
 
65
65
  On the first launch, `npx` downloads `@scorehub/mcp-server` and connects it to the remote endpoint. When you first call a remote tool, invoke `authorize` when prompted by your client. A browser opens the ScoreHub login page; after authorization it returns to a random `127.0.0.1` port and stores the token locally. Later calls reuse the cached token and do not require another login.
66
66
 
67
- > When you install Tiky through `@scorehub/creator-outreach`, its installer writes this MCP configuration automatically. Manual setup is not required.
67
+ > After you install Tiky through the WorkBuddy share link, Tiky's first-turn bootstrap gate writes or repairs this MCP configuration after the user's one-time confirmation. Manual editing is not required.
68
+
69
+ ### Startup self-check
70
+
71
+ Before writing the WorkBuddy configuration, creator-outreach prefetches npm latest and runs:
72
+
73
+ ```bash
74
+ npx -y @scorehub/mcp-server@latest --self-check --json
75
+ ```
76
+
77
+ The command reports the package version, Node.js version, and executable entrypoint status, then exits immediately. It does not start stdio, contact the remote MCP endpoint, enter OAuth, or write tokens.
68
78
 
69
79
  ## Windows
70
80
 
@@ -76,7 +86,7 @@ Windows uses the same MCP JSON configuration as macOS and Linux. You do not need
76
86
  4. Authorization uses PowerShell `Start-Process` to open your default browser, so OAuth URL parameters such as `redirect_uri` are preserved. If system policy blocks it, copy the authorization URL printed in the terminal and open it on the **same Windows computer that runs mcp-server**.
77
87
  5. The callback always uses a random `127.0.0.1` port. Do not open the authorization URL on another computer. If local security software blocks the loopback callback, allow local loopback connections and try again.
78
88
 
79
- If WorkBuddy uses its bundled Node.js, install through `@scorehub/creator-outreach`. The installer handles `npx` / `npx.cmd` and PATH differences for each platform.
89
+ If WorkBuddy uses its bundled Node.js, install Tiky through the share link first, then let Tiky run `npx -y @scorehub/creator-outreach@latest` to complete the local bootstrap. That flow handles `npx` / `npx.cmd` and PATH differences for each platform.
80
90
 
81
91
  ## Optional: Global Installation
82
92
 
@@ -131,7 +141,7 @@ By default, `authorize` reuses a valid access token or refresh token and does no
131
141
  | Tool | Description |
132
142
  |---|---|
133
143
  | `authorize` | Checks ScoreHub OAuth. Use `force: true` to log in as another account or `switch_shop: true` to open the current account's shop picker. |
134
- | `status` | Returns the remote address, authorization state, current account/shop, and available tool count. |
144
+ | `status` | Returns the local proxy version, runtime state, authorization state, remote-tool availability, current account/shop, and host-installation metadata. |
135
145
 
136
146
  ### Remote Tools
137
147
 
@@ -175,6 +185,16 @@ Local mcp-server ScoreHub Remote MCP
175
185
  | Browser does not open automatically | Use the authorization URL printed in the terminal and complete the callback on the same machine that runs mcp-server. |
176
186
  | The authorization page says the link is invalid, or the browser URL has no `redirect_uri` | Fully quit and restart WorkBuddy, and confirm `~/.workbuddy/mcp.json` still uses `npx -y @scorehub/mcp-server@latest`. Newer versions open the OAuth URL through PowerShell to avoid truncating query parameters. |
177
187
 
188
+ Key `status` fields:
189
+
190
+ - `server_version`: the local `@scorehub/mcp-server` version
191
+ - `local_state`:
192
+ - `running_ready`: the local proxy is running, authorized, and remote tools are available
193
+ - `running_unauthorized`: the local proxy is running but ScoreHub OAuth is not complete yet
194
+ - `running_authorized_remote_unavailable`: the local proxy is running and authorized, but remote tool discovery is temporarily unavailable
195
+ - `running_authorized_no_remote_tools`: the local proxy is running and authorized, but no remote tools are currently discovered and no explicit remote error was captured
196
+ - `config_source`: host and installation-source metadata. When it shows `client_host = "workbuddy"` and `managed_by = "@scorehub/creator-outreach"`, the configuration comes from Tiky's public WorkBuddy installation path; typically Tiky is first installed through the share link and then runs `npx -y @scorehub/creator-outreach@latest` to complete the local bootstrap
197
+
178
198
  ## FAQ
179
199
 
180
200
  ### Why do I need this package?
@@ -193,6 +213,8 @@ With `npx -y ...@latest`, every launch resolves npm's current `latest` tag. For
193
213
  npm update -g @scorehub/mcp-server
194
214
  ```
195
215
 
216
+ Because the public WorkBuddy configuration always follows `@latest`, releases under this package name must preserve backward compatibility for tool names, parameters, OAuth, and the `status` contract. An incompatible protocol must use a new package name.
217
+
196
218
  ## Related Packages
197
219
 
198
220
  | Package | Description |
package/README.md CHANGED
@@ -10,7 +10,7 @@ English version: [README.en.md](./README.en.md)
10
10
 
11
11
  ## 概览
12
12
 
13
- `@scorehub/mcp-server` 运行在你的电脑上,位于 Claude Code、Claude Desktop、WorkBuddy 等 MCP 客户端与 ScoreHub 远程 MCP 之间,负责:
13
+ `@scorehub/mcp-server` 运行在你的电脑上,位于 WorkBuddy、Codex 等 MCP 客户端与 ScoreHub 远程 MCP 之间,负责:
14
14
 
15
15
  - **账号与店铺切换**:`authorize(force=true)` 可重新登录切换账号;`authorize(switch_shop=true)` 可在当前账号下切换店铺,无需重新登录。
16
16
  - **Token 生命周期**:调用前检查 Token 有效期;距过期不足 5 分钟时自动刷新,并为长会话每 4 小时主动保活一次。
@@ -19,7 +19,7 @@ English version: [README.en.md](./README.en.md)
19
19
  ```
20
20
  ┌─────────────┐ stdio ┌──────────────────┐ Streamable HTTP ┌─────────────────┐
21
21
  │ AI 客户端 │ ◄────────────► │ @scorehub/ │ ◄─────────────────► │ ScoreHub │
22
- │ Claude 等 │ │ mcp-server │ │ 远程 MCP │
22
+ │ WorkBuddy 等│ │ mcp-server │ │ 远程 MCP │
23
23
  └─────────────┘ └──────────────────┘ └────────┬────────┘
24
24
  │
25
25
  TikTok Shop
@@ -59,12 +59,22 @@ npx --version
59
59
 
60
60
  | 客户端 | 配置文件 |
61
61
  |---|---|
62
- | Claude Code / Claude Desktop | 客户端使用的 MCP 配置文件,例如 `claude_desktop_config.json` 或 `.claude/mcp.json` |
62
+ | 其他 MCP 客户端 | 该客户端使用的 MCP 配置文件 |
63
63
  | WorkBuddy | `mcp.json` |
64
64
 
65
65
  首次启动时,`npx` 会下载 `@scorehub/mcp-server` 并连接远程端点。首次调用远程工具时,按客户端提示调用 `authorize`:浏览器会打开 ScoreHub 登录页,授权完成后回调到 `127.0.0.1` 的随机端口并写入本地 Token。之后会复用缓存,不需要每次登录。
66
66
 
67
- > 使用 `@scorehub/creator-outreach` 安装 Tiky 时,安装器会自动写入这份 MCP 配置;无需手动配置。
67
+ > 通过 WorkBuddy 分享链接安装 Tiky 后,Tiky 会在首轮 bootstrap 门禁中经用户首次确认后自动写入或修复这份 MCP 配置;无需手动编辑。
68
+
69
+ ### 启动前自检
70
+
71
+ 在写入 WorkBuddy 配置前,creator-outreach 会预拉取 npm latest 并执行:
72
+
73
+ ```bash
74
+ npx -y @scorehub/mcp-server@latest --self-check --json
75
+ ```
76
+
77
+ 该命令返回包版本、Node.js 版本和可执行入口状态,然后立即退出。它不启动 stdio 服务、不访问远端 MCP、不进入 OAuth,也不写入 Token。
68
78
 
69
79
  ## Windows 使用说明
70
80
 
@@ -76,7 +86,7 @@ Windows 与 macOS、Linux 使用同一份 MCP JSON 配置,不需要改成 `npx
76
86
  4. 授权时会优先使用 `cmd.exe /c start` 打开默认浏览器。被系统策略拦截时,复制终端输出的授权 URL,在**运行 mcp-server 的同一台 Windows 电脑**上打开并完成授权。
77
87
  5. 回调固定使用 `127.0.0.1` 随机端口。不要在另一台电脑打开授权 URL;本机安全软件若拦截回环回调,应允许本地回环连接后重试。
78
88
 
79
- WorkBuddy 若使用其捆绑的 Node.js,建议通过 `@scorehub/creator-outreach` 安装器完成配置;该安装器会按平台处理 `npx` / `npx.cmd` 与 PATH。
89
+ WorkBuddy 若使用其捆绑的 Node.js,建议先通过分享链接安装 Tiky,再由 Tiky 执行 `npx -y @scorehub/creator-outreach@latest` 完成本地引导;该流程会按平台处理 `npx` / `npx.cmd` 与 PATH。
80
90
 
81
91
  ## 可选:全局安装
82
92
 
@@ -131,7 +141,7 @@ Token 持久化在本机文件中;调用默认 ScoreHub 生产端点时,mcp-
131
141
  | 工具 | 说明 |
132
142
  |---|---|
133
143
  | `authorize` | 检查 ScoreHub OAuth 状态;`force: true` 重新登录以切换账号,`switch_shop: true` 打开当前账号的店铺选择页。 |
134
- | `status` | 返回远程地址、授权状态、当前账号/店铺和当前可用工具数量。 |
144
+ | `status` | 返回本地代理版本、运行状态、授权状态、远端工具可用性、当前账号/店铺和宿主安装来源元数据。 |
135
145
 
136
146
  ### 远程工具
137
147
 
@@ -175,6 +185,16 @@ Token 持久化在本机文件中;调用默认 ScoreHub 生产端点时,mcp-
175
185
  | 浏览器无法自动打开 | 使用终端输出的授权 URL,并在运行 mcp-server 的同一台机器上完成回调。 |
176
186
  | Windows 授权页提示授权链接无效,或浏览器地址栏缺少 `redirect_uri` | 完全退出并重启 WorkBuddy,确认 `~/.workbuddy/mcp.json` 仍使用 `npx -y @scorehub/mcp-server@latest`;新版会通过 PowerShell 打开授权 URL,避免 `cmd.exe start` 截断带 `&` 的参数。 |
177
187
 
188
+ `status` 的关键字段说明:
189
+
190
+ - `server_version`:当前本地 `@scorehub/mcp-server` 版本
191
+ - `local_state`:
192
+ - `running_ready`:本地代理已启动、已授权,且远端工具可用
193
+ - `running_unauthorized`:本地代理已启动,但尚未完成 ScoreHub OAuth
194
+ - `running_authorized_remote_unavailable`:本地代理已启动且已授权,但远端工具发现暂时不可用
195
+ - `running_authorized_no_remote_tools`:本地代理已启动且已授权,但当前尚未发现远端工具,且没有明确抓到远端错误
196
+ - `config_source`:宿主与安装来源元数据。若显示 `client_host = "workbuddy"` 且 `managed_by = "@scorehub/creator-outreach"`,表示当前配置来自 Tiky 的 WorkBuddy 公开安装路径;通常先由分享链接把 Tiky 装入 WorkBuddy,再由 Tiky 执行 `npx -y @scorehub/creator-outreach@latest` 完成本地引导
197
+
178
198
  ## 常见问题
179
199
 
180
200
  ### 为什么需要这个包?
@@ -193,6 +213,8 @@ Token 持久化在本机文件中;调用默认 ScoreHub 生产端点时,mcp-
193
213
  npm update -g @scorehub/mcp-server
194
214
  ```
195
215
 
216
+ 由于 WorkBuddy 公开配置始终跟随 `@latest`,同一包名下的 latest 发布必须保持工具名、参数、OAuth 和 `status` 契约向后兼容。无法兼容的新协议必须使用新包名。
217
+
196
218
  ## 相关包
197
219
 
198
220
  | 包 | 说明 |
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  * ScoreHub MCP Server — Local MCP Proxy
6
6
  *
7
7
  * Architecture (mirrors @lessie/mcp-server):
8
- * Agent (WorkBuddy/Claude) ──stdio── Local MCP Server ──Streamable HTTP── Remote MCP Server
8
+ * Agent (WorkBuddy/other MCP client) ──stdio── Local MCP Server ──Streamable HTTP── Remote MCP Server
9
9
  *
10
10
  * The local server handles:
11
11
  * 1. OAuth 2.1 Authorization Code + PKCE — browser-based login to ScoreHub
@@ -18,11 +18,12 @@ const index_js_2 = require("@modelcontextprotocol/sdk/client/index.js");
18
18
  const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
19
19
  const node_fs_1 = require("node:fs");
20
20
  const node_path_1 = require("node:path");
21
- function readPackageVersion() {
22
- const packageJson = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, "../package.json"), "utf-8"));
23
- return packageJson.version;
21
+ const self_check_js_1 = require("./self-check.js");
22
+ function readPackageMetadata() {
23
+ return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, "../package.json"), "utf-8"));
24
24
  }
25
- const SERVER_VERSION = readPackageVersion();
25
+ const PACKAGE_METADATA = readPackageMetadata();
26
+ const SERVER_VERSION = PACKAGE_METADATA.version;
26
27
  const DEFAULT_SCOREHUB_BASE_URL = "https://app.scorehub.cn/mcp";
27
28
  const SCOREHUB_BASE_URL = normalizeBaseUrl(process.env.SCOREHUB_REMOTE_MCP_URL || DEFAULT_SCOREHUB_BASE_URL);
28
29
  // OAuth endpoints are at the root path
@@ -45,6 +46,7 @@ function endpointTokenKey(baseUrl) {
45
46
  }
46
47
  // ── Auth State ──────────────────────────────────────────────
47
48
  const auth_js_1 = require("./auth.js");
49
+ const status_js_1 = require("./status.js");
48
50
  const TOKEN_STORE_KEY = endpointTokenKey(SCOREHUB_BASE_URL);
49
51
  const CLIENT_ID = "scorehub-mcp";
50
52
  // Proactively refresh token every 4 hours to prevent expiry during long sessions
@@ -292,19 +294,20 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
292
294
  case "status": {
293
295
  const tokenResult = await (0, auth_js_1.getValidAccessToken)(TOKEN_STORE_KEY, TOKEN_ENDPOINT, CLIENT_ID);
294
296
  const tokenStore = (0, auth_js_1.loadTokens)(TOKEN_STORE_KEY);
297
+ const payload = (0, status_js_1.buildStatusPayload)({
298
+ serverVersion: SERVER_VERSION,
299
+ remoteUrl: REMOTE_MCP_URL,
300
+ tokenStoreKey: TOKEN_STORE_KEY,
301
+ tokenResult,
302
+ tokenStore,
303
+ remoteToolsCount: remoteTools.length,
304
+ lastFetchError,
305
+ });
295
306
  return {
296
307
  content: [
297
308
  {
298
309
  type: "text",
299
- text: JSON.stringify({
300
- remote_url: REMOTE_MCP_URL,
301
- token_store_key: TOKEN_STORE_KEY,
302
- authorized: !!tokenResult,
303
- ...(tokenStore?.account ? { account: tokenStore.account } : {}),
304
- ...(tokenStore?.selected_shop ? { selected_shop: tokenStore.selected_shop } : {}),
305
- tools_count: remoteTools.length,
306
- ...(lastFetchError ? { error: lastFetchError } : {}),
307
- }, null, 2),
310
+ text: JSON.stringify(payload, null, 2),
308
311
  },
309
312
  ],
310
313
  };
@@ -376,6 +379,23 @@ function startTokenKeepAlive() {
376
379
  }
377
380
  // ── Start ───────────────────────────────────────────────────
378
381
  async function main() {
382
+ if (process.argv.includes("--self-check")) {
383
+ const payload = (0, self_check_js_1.buildSelfCheckPayload)({
384
+ packageName: PACKAGE_METADATA.name,
385
+ serverVersion: SERVER_VERSION,
386
+ });
387
+ if (process.argv.includes("--json")) {
388
+ process.stdout.write(`${JSON.stringify(payload)}\n`);
389
+ }
390
+ else {
391
+ process.stdout.write(payload.ok
392
+ ? `ScoreHub MCP Server v${payload.server_version} is ready (Node.js ${payload.node_version}).\n`
393
+ : `Node.js ${payload.minimum_node_major}+ is required. Detected ${payload.node_version}.\n`);
394
+ }
395
+ if (!payload.ok)
396
+ process.exitCode = 1;
397
+ return;
398
+ }
379
399
  // Set process title for easy identification in ps/task manager
380
400
  process.title = 'scorehub-mcp';
381
401
  // Gracefully exit when parent AI agent closes stdin (normal shutdown or crash).
@@ -0,0 +1,18 @@
1
+ export declare const MIN_NODE_MAJOR = 18;
2
+ export interface SelfCheckPayload {
3
+ schema_version: 1;
4
+ ok: boolean;
5
+ package_name: string;
6
+ server_version: string;
7
+ node_version: string;
8
+ node_supported: boolean;
9
+ minimum_node_major: number;
10
+ entrypoint: "scorehub-mcp";
11
+ }
12
+ export interface SelfCheckInput {
13
+ packageName: string;
14
+ serverVersion: string;
15
+ nodeVersion?: string;
16
+ }
17
+ export declare function getNodeMajorVersion(nodeVersion: string): number;
18
+ export declare function buildSelfCheckPayload(input: SelfCheckInput): SelfCheckPayload;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MIN_NODE_MAJOR = void 0;
4
+ exports.getNodeMajorVersion = getNodeMajorVersion;
5
+ exports.buildSelfCheckPayload = buildSelfCheckPayload;
6
+ exports.MIN_NODE_MAJOR = 18;
7
+ function getNodeMajorVersion(nodeVersion) {
8
+ return Number.parseInt(nodeVersion.split(".")[0], 10);
9
+ }
10
+ function buildSelfCheckPayload(input) {
11
+ const nodeVersion = input.nodeVersion ?? process.versions.node;
12
+ const nodeSupported = getNodeMajorVersion(nodeVersion) >= exports.MIN_NODE_MAJOR;
13
+ return {
14
+ schema_version: 1,
15
+ ok: nodeSupported,
16
+ package_name: input.packageName,
17
+ server_version: input.serverVersion,
18
+ node_version: nodeVersion,
19
+ node_supported: nodeSupported,
20
+ minimum_node_major: exports.MIN_NODE_MAJOR,
21
+ entrypoint: "scorehub-mcp",
22
+ };
23
+ }
@@ -0,0 +1,35 @@
1
+ import type { OAuthAccount, OAuthShop, TokenStore } from "./auth.js";
2
+ export type LocalStatusState = "running_ready" | "running_unauthorized" | "running_authorized_remote_unavailable" | "running_authorized_no_remote_tools";
3
+ export type AuthorizationState = "authorized" | "unauthorized";
4
+ export type RemoteToolsState = "available" | "unavailable";
5
+ export interface StatusPayload {
6
+ server_version: string;
7
+ remote_url: string;
8
+ token_store_key: string;
9
+ local_state: LocalStatusState;
10
+ authorization_state: AuthorizationState;
11
+ remote_tools_state: RemoteToolsState;
12
+ authorized: boolean;
13
+ tools_count: number;
14
+ config_source: {
15
+ client_host: string;
16
+ managed_by: string;
17
+ creator_outreach_version?: string;
18
+ };
19
+ account?: OAuthAccount;
20
+ selected_shop?: OAuthShop;
21
+ error?: string;
22
+ }
23
+ export interface StatusInput {
24
+ serverVersion: string;
25
+ remoteUrl: string;
26
+ tokenStoreKey: string;
27
+ tokenResult: {
28
+ access_token: string;
29
+ } | null;
30
+ tokenStore: Pick<TokenStore, "account" | "selected_shop"> | null;
31
+ remoteToolsCount: number;
32
+ lastFetchError: string | null;
33
+ env?: NodeJS.ProcessEnv;
34
+ }
35
+ export declare function buildStatusPayload(input: StatusInput): StatusPayload;
package/dist/status.js ADDED
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildStatusPayload = buildStatusPayload;
4
+ function getLocalState(authorized, remoteToolsCount, lastFetchError) {
5
+ if (!authorized) {
6
+ return "running_unauthorized";
7
+ }
8
+ if (lastFetchError) {
9
+ return "running_authorized_remote_unavailable";
10
+ }
11
+ if (remoteToolsCount === 0) {
12
+ return "running_authorized_no_remote_tools";
13
+ }
14
+ return "running_ready";
15
+ }
16
+ function buildStatusPayload(input) {
17
+ const env = input.env ?? process.env;
18
+ const authorized = !!input.tokenResult;
19
+ const remoteToolsState = input.remoteToolsCount > 0 && !input.lastFetchError
20
+ ? "available"
21
+ : "unavailable";
22
+ return {
23
+ server_version: input.serverVersion,
24
+ remote_url: input.remoteUrl,
25
+ token_store_key: input.tokenStoreKey,
26
+ local_state: getLocalState(authorized, input.remoteToolsCount, input.lastFetchError),
27
+ authorization_state: authorized ? "authorized" : "unauthorized",
28
+ remote_tools_state: remoteToolsState,
29
+ authorized,
30
+ tools_count: input.remoteToolsCount,
31
+ config_source: {
32
+ client_host: env.SCOREHUB_CLIENT_HOST || "unknown",
33
+ managed_by: env.SCOREHUB_MANAGED_BY || "direct",
34
+ ...(env.SCOREHUB_CREATOR_OUTREACH_VERSION
35
+ ? { creator_outreach_version: env.SCOREHUB_CREATOR_OUTREACH_VERSION }
36
+ : {}),
37
+ },
38
+ ...(input.tokenStore?.account ? { account: input.tokenStore.account } : {}),
39
+ ...(input.tokenStore?.selected_shop ? { selected_shop: input.tokenStore.selected_shop } : {}),
40
+ ...(input.lastFetchError ? { error: input.lastFetchError } : {}),
41
+ };
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scorehub/mcp-server",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "ScoreHub local MCP proxy — OAuth login, token caching, and tool forwarding to remote MCP endpoint",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -18,7 +18,7 @@
18
18
  "access": "public"
19
19
  },
20
20
  "scripts": {
21
- "build": "tsc && node -e \"const fs=require('fs');const f='dist/index.js';fs.writeFileSync(f,'#!/usr/bin/env node\\n'+fs.readFileSync(f,'utf8'));fs.chmodSync(f,0o755)\"",
21
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && node -e \"const fs=require('fs');const f='dist/index.js';fs.writeFileSync(f,'#!/usr/bin/env node\\n'+fs.readFileSync(f,'utf8'));fs.chmodSync(f,0o755)\"",
22
22
  "dev": "tsx src/index.ts",
23
23
  "start": "node dist/index.js",
24
24
  "test": "tsx --test test/*.test.ts"