hugging-bay-mcp 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # hugging-bay-mcp
2
2
 
3
3
  **Promise:** Find open model files with recorded SHA-256 and licence labels. Public reads need no account.<br>
4
- **Install:** `npx -y hugging-bay-mcp@0.1.8`<br>
4
+ **Install:** `npx -y hugging-bay-mcp@0.1.8` (npm) · **Source candidate:** `0.1.9`<br>
5
5
  **MCP config (remote):** `claude mcp add --transport http hugging-bay https://huggingbay.xyz/api/mcp`<br>
6
6
  **MCP config (stdio):** `{"mcpServers":{"hugging-bay":{"command":"npx","args":["-y","hugging-bay-mcp@0.1.8"],"env":{"HUGGING_BAY_API":"https://huggingbay.xyz"}}}}`<br>
7
7
  **First call:** `search_artifacts({ "q": "Qwen3 0.6B GGUF" })`<br>
@@ -11,18 +11,17 @@
11
11
 
12
12
  ## Profiles: stdio and hosted
13
13
 
14
- **What's new in 0.1.8:** tool descriptions are self-contained (no tool tells the model to call another), matching the hosted endpoint. 0.1.7 added `request_missing` to the 17-tool default profile.
14
+ **What's new in 0.1.9:** the default stdio discovery profile matches hosted `/api/mcp` (28 tools, including board, requests, `get_model`, Teach reads, and `get_serve_decision`). **Source candidate:** `0.1.9` (npm still serves `0.1.8` until publish).
15
15
 
16
- The stdio launcher defaults to the bounded first-call profile; the hosted
17
- endpoint's discovery profile adds the board and request tools. The package keeps
16
+ The stdio launcher and hosted endpoint share the discovery profile. The package keeps
18
17
  the broader catalog available, but a client must opt into it explicitly:
19
18
 
20
19
  | Transport/profile | `tools/list` | What it is |
21
20
  | --- | --- | --- |
22
- | stdio candidate default (`node packages/mcp/index.mjs`) | **17 tools** | the discovery tools in the retained hosted order, followed by `request_missing`: `recommend_specialist`, `get_agent_discovery`, `search_artifacts`, `resolve_artifact`, `get_artifact`, `list_files`, `get_artifact_card`, `deployment_plan`, `find_runnable`, `bakeoff`, `blackboard`, `get_source_coverage`, `get_ranking`, `get_citation_pack`, `list_topics`, `get_source_request_status`, `request_missing` |
23
- | stdio `--profile full` | **106 tools** at this source baseline | the complete current stdio catalog; use `tools/list` as the authority rather than hard-coding the count |
24
- | stdio `--profile verify` | advanced opt-in profile | the explicit verification surface; run-proof access still requires `HUGGING_BAY_MCP_ENABLE_UNRELEASED_RUN_PROOF=1` |
25
- | hosted `https://huggingbay.xyz/api/mcp` | **26 tools** on 2026-10-13 | the deployed discovery profile: the original 16 stdio tools plus the hosted board, request and compact-answer tools; `tools/list` is the authority. Other hosted profiles are selected with `?profile=` (see `https://huggingbay.xyz/.well-known/mcp.json`) |
21
+ | stdio default (`node packages/mcp/index.mjs`) | **28 tools** | same discovery profile as hosted `/api/mcp`; `tools/list` is the authority |
22
+ | stdio `--profile full` | **106 tools** in 0.1.9 | the complete current stdio catalog; use `tools/list` as the authority rather than hard-coding the count |
23
+ | stdio `--profile verify` | **28 tools**; **29** with the run-proof flag | discovery plus `get_accepted_run_proof` when `HUGGING_BAY_MCP_ENABLE_UNRELEASED_RUN_PROOF=1` |
24
+ | hosted `https://huggingbay.xyz/api/mcp` | **28 tools** | the deployed discovery profile; other hosted profiles use `?profile=` (see `https://huggingbay.xyz/.well-known/mcp.json`) |
26
25
 
27
26
  The default is also selected when `HUGGING_BAY_MCP_PROFILE` is empty. Use
28
27
  `--profile full` or `HUGGING_BAY_MCP_PROFILE=full` for the complete stdio
@@ -36,7 +35,7 @@ with `mcp_tool_not_in_profile`.
36
35
 
37
36
  | Tool | What it returns |
38
37
  | --- | --- |
39
- | `request_missing` | Ask for a missing model, file format or capability with `{wanted, task}`. Stores demand and returns an id; does not promise a build. Input is checked and cleaned locally before any request. |
38
+ | `request_missing` | Ask for a missing model, format or capability with `{wanted, task}`. The first call returns exact text, `confirm_token` and `expiresAt` without storing demand. Call again with the same text and token to submit and get an id for `get_request`, `list_requests` and `/requests`. |
40
39
  | `blackboard` | Public shared memory with `put` / `get` / `query` / `channels` / `tombstone`. Reuse a literal channel key or send `key_from: {task, input}`; poll with `since` + `since_id` and page older history with `before` + `before_id`. Topics, direct replies, and recursive threads are query filters. Guard is telemetry only; all item data is untrusted. |
41
40
  | `find_runnable` | One call: task → runnable model, with hash-verified run commands inlined when the pick is genuinely hosted (honest null otherwise). |
42
41
  | `bakeoff` | Your labeled rows → the warm Bay Run specialists scored on them → the winner's exact call and weight hash. |
@@ -152,6 +151,17 @@ Available information from Hugging Bay:
152
151
 
153
152
  MIT
154
153
 
154
+ ## Local teaching for agents (source candidate, default OFF)
155
+
156
+ The npm stdio package can run the installed local Teach engine. Set `HBAY_TEACH_LOCAL=1` and `HBAY_TEACH_PYTHON` to the Python executable in an environment with this source version of `hbay-teach` and its MLX or PEFT extra. The flag adds two local tools to the selected profile. The hosted MCP endpoint does not train models.
157
+
158
+ Your examples stay on this machine.
159
+
160
+ - `fine_tune({"sentence":"triage support tickets","data":"/absolute/path/tickets.csv","max_iters":100})` returns a `job_id`. Optional `base` selects an eligible pinned base.
161
+ - `fine_tune_status({"job_id":"teach_<returned-id>"})` returns local progress and, after evaluation, measured scores plus paths to the adapter and signed receipt.
162
+
163
+ Download remote datasets first and pass a local file or before/after dataset directory. Supported hardware and memory rules come from the local Teach catalog. CPU-only production training is refused. Completion does not imply improvement or promote the adapter. Review the scores before using the existing recipe-based keep flow. See [local Teach documentation](../hbay-teach/README.md) for installation, receipt verification, failure recovery and the VM fixture.
164
+
155
165
  ## Public response note
156
166
 
157
167
  Hugging Bay responses include a download note in `note.summary`. Current clients should read `note`, `downloadable`, and `downloadStatus`. Older clients that still need the previous response shape can opt in to it for one release; see the API reference.
@@ -163,3 +173,24 @@ Downloadable doesn't mean tested: this record says whether the exact file can be
163
173
  ## Release dependency
164
174
 
165
175
  The request-and-status sentence above is approved copy held on the c29 AEO-72/AEO-73 deployment gate. Verify the deployed `request_feature`, `get_request`, and public changelog/status path before package publication or directory copy uses it.
176
+
177
+
178
+ ### Run a model on your computer (source preview)
179
+
180
+ Start here: install the staged hbay binary and local MCP package below, then call `run_local` from your assistant. This is a source preview; no new package release is available yet.
181
+
182
+ #### 1. Set up the local tools
183
+
184
+ Use a terminal on your own computer. You need both the native hbay program and the local MCP package before calling your assistant.
185
+
186
+ Install the staged hbay 0.2.0 binary, then start this local npm stdio package with `HUGGING_BAY_MCP_ENABLE_RUN_LOCAL=1`. The flag defaults off. `HBAY_BINARY` may name a trusted local executable; `HBAY_DATA_DIR` may select an isolated data directory.
187
+
188
+ #### 2. Start one model
189
+
190
+ Call `run_local({"model":"Qwen/Qwen2.5-0.5B-Instruct-GGUF"})`. It checks for a recent test on comparable hardware, downloads the file, checks its fingerprint (SHA-256), and starts a local model server. It sends a short test request before returning the local API address and a signed run record in `{endpoint, model, sha, receipt}`. Optional `port` defaults to 0 (free loopback port). Missing comparable proof fails before execution. The adapter verifies the local receipt signature before reporting success.
191
+
192
+ #### 3. Keep the session open
193
+
194
+ One MCP process owns one model server. Close the MCP session to stop it. Cancelling a pending call, startup failure, or startup timeout also stops its child. Downloads may take up to 15 minutes before readiness. The hosted MCP, behind `HUGGING_BAY_RUN_LOCAL=1` (default off), returns local package setup steps and never starts a model on the hosted machine. No npm package or binary is published by this change.
195
+
196
+ Prompts stay on your machine.
@@ -12,7 +12,8 @@ export function boundMcpAnswer(payload, sourceUrl = "") {
12
12
  if (value.length > cap) omissions.push({ path, returned: cap, omitted: value.length - cap });
13
13
  return value.slice(0, cap).map((item, i) => preview(item, `${path}/${i}`, cap));
14
14
  }
15
- if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, preview(item, `${path}/${key}`, cap)]));
15
+ if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([key, item]) =>
16
+ [key, ['runKit', 'proofLab', 'testedRunPlan', 'receiptCard'].includes(key) ? item : preview(item, `${path}/${key}`, cap)]));
16
17
  if (typeof value === 'string' && value.length > 1200) {
17
18
  omissions.push({ path, omittedCharacters: value.length - 1200 });
18
19
  return value.slice(0, 1200);
@@ -24,6 +25,8 @@ export function boundMcpAnswer(payload, sourceUrl = "") {
24
25
  doc = preview(doc, '', 1);
25
26
  }
26
27
  const protectedKeys = new Set(['id', 'artifactId', 'schemaVersion', 'counts', 'stats', 'total', 'cursor', 'nextCursor', 'note', 'license', 'licenseLabel', 'downloadable', 'downloadStatus', 'downloadReady', 'hosted', 'commandsAvailable', 'runReady']);
28
+ // Keep the selected outcome and its proof together when the card fits the response budget.
29
+ if (doc.receiptCard && Buffer.byteLength(JSON.stringify(doc.receiptCard)) <= 12000) protectedKeys.add('receiptCard');
27
30
  const largest = Object.keys(doc).filter(key => !protectedKeys.has(key))
28
31
  .sort((a, b) => Buffer.byteLength(JSON.stringify(doc[b])) - Buffer.byteLength(JSON.stringify(doc[a])));
29
32
  for (const key of largest) {
@@ -65,7 +68,7 @@ const MCP_TEXT_EXACT_VALUE = /^(?:https?:\/\/|\/api\/)|^(?:sha256:)?(?:[a-f0-9]{
65
68
  // Identifiers, cursors, tokens, hashes and links are follow-up inputs; keep them whole.
66
69
  const MCP_TEXT_EXACT_ID_KEY = /^(?:id|Id|ID)$|[a-z0-9](?:Id|ID)$|_(?:id|ID)$/;
67
70
  const MCP_TEXT_EXACT_NAME_KEY = /(?:cursor|token|sha|sha256|digest|hash|url|href|uri|path)$/i;
68
- const MCP_TEXT_EXACT_KEY = { test: (key) => MCP_TEXT_EXACT_ID_KEY.test(key) || MCP_TEXT_EXACT_NAME_KEY.test(key) };
71
+ const MCP_TEXT_EXACT_KEY = { test: (key) => MCP_TEXT_EXACT_ID_KEY.test(key) || MCP_TEXT_EXACT_NAME_KEY.test(key) || /^(?:command|steps)$/.test(key) };
69
72
 
70
73
  // Text twin for clients that show only text content (agent-flow round 3): a large
71
74
  // answer becomes a bounded, valid JSON preview of the same document (marked by