@scorehub/mcp-server 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -43,7 +43,8 @@ async function fetchRemoteTools(token) {
43
43
  await client.close();
44
44
  }
45
45
  }
46
- catch {
46
+ catch (e) {
47
+ console.error("Warning: fetchRemoteTools failed:", e instanceof Error ? e.message : String(e));
47
48
  return [];
48
49
  }
49
50
  }
@@ -74,7 +75,8 @@ const server = new index_js_1.Server({ name: "scorehub-mcp", version: "0.1.0" },
74
75
  server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
75
76
  // Refresh remote tools on each list
76
77
  try {
77
- remoteTools = await fetchRemoteTools();
78
+ const tokenResult = await (0, auth_js_1.getValidAccessToken)(HOST, TOKEN_ENDPOINT, CLIENT_ID);
79
+ remoteTools = await fetchRemoteTools(tokenResult?.access_token);
78
80
  }
79
81
  catch { /* keep stale */ }
80
82
  const tools = [
@@ -216,7 +218,8 @@ async function main() {
216
218
  }
217
219
  catch { /* ignore PID file write errors */ }
218
220
  try {
219
- remoteTools = await fetchRemoteTools();
221
+ const tokenResult = await (0, auth_js_1.getValidAccessToken)(HOST, TOKEN_ENDPOINT, CLIENT_ID);
222
+ remoteTools = await fetchRemoteTools(tokenResult?.access_token);
220
223
  }
221
224
  catch {
222
225
  console.error("Warning: Could not fetch remote tools on startup. Retrying on first ListTools request.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scorehub/mcp-server",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "ScoreHub local MCP proxy — OAuth login, token caching, and tool forwarding to remote MCP endpoint",
5
5
  "main": "dist/index.js",
6
6
  "bin": {