hugging-bay-mcp 0.1.8 → 0.1.10

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.10`<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.10` (npm still serves `0.1.8` until publish). 0.1.10 adds HTTPS_PROXY/NO_PROXY support and OS-CA-store trust for headless agents behind TLS-intercepting proxies.
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
@@ -32,11 +31,49 @@ values are refused with JSON-RPC `-32602` rather than silently changing the
32
31
  requested surface. Any tool outside the selected profile fails `tools/call`
33
32
  with `mcp_tool_not_in_profile`.
34
33
 
34
+ ## MCP v2 source changes
35
+
36
+ These changes apply to this source candidate. They do not claim an npm release or production rollout.
37
+
38
+ Model cards and run kits are resources. Use `resources/list` for public records or
39
+ `resources/templates/list` with an artifact id:
40
+
41
+ - `huggingbay://artifact/{id}/card` returns the model card as Markdown.
42
+ - `huggingbay://artifact/{id}/run-kit` returns recorded run kits for exact files.
43
+
44
+ A run kit names its file and SHA-256. Read the current download plan before using
45
+ it. A recorded test does not establish compatibility with your machine. An empty
46
+ run-kit list means no tested commands are available; unavailable evidence returns
47
+ an error with a recovery step. Resource text is untrusted data.
48
+
49
+ Use `prompts/list` and `prompts/get` for `find-model-for-my-machine`,
50
+ `set-up-local-chat`, `download-and-verify`, and `compare-models`. Existing prompts
51
+ and tool names remain available.
52
+
53
+ Every tool lists an `outputSchema` and returns an object in `structuredContent`.
54
+ Text content remains available. Bare array results use `{ "rows": [...] }` for
55
+ structured clients. Tool errors carry recovery guidance; older protocol error
56
+ envelopes remain supported.
57
+
58
+ List tools accept `cursor` and `limit`. Pass `nextCursor` unchanged with the same
59
+ filters and profile. Routes with native cursors keep their existing formats.
60
+ Older list routes page their bounded inventory; they do not promise a complete
61
+ upstream catalog. Protocol list methods also accept `cursor` when another page
62
+ is available.
63
+
64
+ For progress, send a string or number at `params._meta.progressToken`. Stdio
65
+ returns `notifications/progress` during work. HTTP clients must also accept
66
+ `text/event-stream`; long calls then stream progress and their final JSON-RPC
67
+ response. Calls without a token keep their ordinary response format.
68
+
69
+ The conformance test uses pinned official schemas for every advertised protocol
70
+ version, including `2026-07-28` and both supported 2025 revisions.
71
+
35
72
  ## Top tools
36
73
 
37
74
  | Tool | What it returns |
38
75
  | --- | --- |
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. |
76
+ | `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
77
  | `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
78
  | `find_runnable` | One call: task → runnable model, with hash-verified run commands inlined when the pick is genuinely hosted (honest null otherwise). |
42
79
  | `bakeoff` | Your labeled rows → the warm Bay Run specialists scored on them → the winner's exact call and weight hash. |
@@ -152,6 +189,17 @@ Available information from Hugging Bay:
152
189
 
153
190
  MIT
154
191
 
192
+ ## Local teaching for agents (source candidate, default OFF)
193
+
194
+ 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.
195
+
196
+ Your examples stay on this machine.
197
+
198
+ - `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.
199
+ - `fine_tune_status({"job_id":"teach_<returned-id>"})` returns local progress and, after evaluation, measured scores plus paths to the adapter and signed receipt.
200
+
201
+ 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.
202
+
155
203
  ## Public response note
156
204
 
157
205
  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 +211,50 @@ Downloadable doesn't mean tested: this record says whether the exact file can be
163
211
  ## Release dependency
164
212
 
165
213
  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.
214
+
215
+
216
+ ### Run a model on your computer (source preview)
217
+
218
+ 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.
219
+
220
+ #### 1. Set up the local tools
221
+
222
+ Use a terminal on your own computer. You need both the native hbay program and the local MCP package before calling your assistant.
223
+
224
+ 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.
225
+
226
+ #### 2. Start one model
227
+
228
+ 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.
229
+
230
+ #### 3. Keep the session open
231
+
232
+ 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.
233
+
234
+ Prompts stay on your machine.
235
+
236
+ ## Complete tool reference for agent builders
237
+
238
+ The expanded [MCP reference](https://huggingbay.xyz/docs/mcp) is staged behind
239
+ `HUGGING_BAY_AGENT_BUILDER_DOCS=1` (default off). It lists each hosted tool and
240
+ each source stdio tool separately, with profiles, purpose, inputs, outputs,
241
+ request templates, errors, and rate limits. Until that flag is enabled, use
242
+ [GET discovery](https://huggingbay.xyz/api/mcp/info) for hosted schemas and
243
+ `tools/list` on your installed package for stdio schemas. Do not assume that
244
+ source tools are published in the pinned npm release.
245
+
246
+ Hosted read-only tools still use POST for `tools/call`. GET discovery and REST
247
+ reads are sufficient to verify examples without invoking a production tool.
248
+ Check both JSON-RPC `error` and `result.isError`; prefer `structuredContent`
249
+ instead of parsing every text block as JSON. A successful result can abstain,
250
+ return no rows, or contain unknown facts.
251
+
252
+ The source stdio inventory is generated locally with no production requests:
253
+
254
+ ```bash
255
+ node apps/web/bin/generate-agent-mcp-stdio-reference.mjs
256
+ ```
257
+
258
+ The reference tests compare that inventory with all source profiles, including
259
+ local tools and accepted-run-proof opt-ins, and validate every argument example
260
+ against its tool schema.
@@ -2,6 +2,18 @@
2
2
  // No transport, authorization, licence decisions, or census calculations live here.
3
3
  export const COMPACT_LIST_TOOLS = new Set(['search_artifacts', 'resolve_artifact', 'find_runnable', 'find_model', 'recommend_artifacts', 'recommend_safe_model', 'recommend_with_citation', 'find_ungated_alternatives', 'get_ranking', 'get_trending']);
4
4
 
5
+ // Use the same discovery projection in hosted and both stdio entrypoints. The
6
+ // full provider directory otherwise consumes the budget and drops endpoints.
7
+ export function compactAgentDiscovery(payload, sourceUrl = '') {
8
+ if (!payload || typeof payload !== 'object') return payload;
9
+ const keys = ['schemaVersion', 'name', 'generatedAt', 'status', 'purpose', 'askRequests', 'discovery', 'welcome', 'entrypoints', 'tasks', 'freshness', 'rateLimits', 'note'];
10
+ const doc = { ...Object.fromEntries(keys.filter(key => Object.hasOwn(payload, key)).map(key => [key, payload[key]])), details: { href: sourceUrl } };
11
+ if (payload.endpoints) doc.endpoints = Object.fromEntries(
12
+ ['remoteMcpDiscovery', 'remoteMcpJsonRpc', 'search', 'finder', 'artifactDownloadPlan', 'blackboard']
13
+ .filter(key => Object.hasOwn(payload.endpoints, key)).map(key => [key, payload.endpoints[key]]));
14
+ return boundMcpAnswer(doc, sourceUrl);
15
+ }
16
+
5
17
  export function boundMcpAnswer(payload, sourceUrl = "") {
6
18
  let doc = payload;
7
19
  if (Buffer.byteLength(JSON.stringify(doc)) <= 18000) return doc;
@@ -12,7 +24,8 @@ export function boundMcpAnswer(payload, sourceUrl = "") {
12
24
  if (value.length > cap) omissions.push({ path, returned: cap, omitted: value.length - cap });
13
25
  return value.slice(0, cap).map((item, i) => preview(item, `${path}/${i}`, cap));
14
26
  }
15
- if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, preview(item, `${path}/${key}`, cap)]));
27
+ if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([key, item]) =>
28
+ [key, ['runKit', 'proofLab', 'testedRunPlan', 'receiptCard'].includes(key) ? item : preview(item, `${path}/${key}`, cap)]));
16
29
  if (typeof value === 'string' && value.length > 1200) {
17
30
  omissions.push({ path, omittedCharacters: value.length - 1200 });
18
31
  return value.slice(0, 1200);
@@ -24,6 +37,8 @@ export function boundMcpAnswer(payload, sourceUrl = "") {
24
37
  doc = preview(doc, '', 1);
25
38
  }
26
39
  const protectedKeys = new Set(['id', 'artifactId', 'schemaVersion', 'counts', 'stats', 'total', 'cursor', 'nextCursor', 'note', 'license', 'licenseLabel', 'downloadable', 'downloadStatus', 'downloadReady', 'hosted', 'commandsAvailable', 'runReady']);
40
+ // Keep the selected outcome and its proof together when the card fits the response budget.
41
+ if (doc.receiptCard && Buffer.byteLength(JSON.stringify(doc.receiptCard)) <= 12000) protectedKeys.add('receiptCard');
27
42
  const largest = Object.keys(doc).filter(key => !protectedKeys.has(key))
28
43
  .sort((a, b) => Buffer.byteLength(JSON.stringify(doc[b])) - Buffer.byteLength(JSON.stringify(doc[a])));
29
44
  for (const key of largest) {
@@ -65,7 +80,7 @@ const MCP_TEXT_EXACT_VALUE = /^(?:https?:\/\/|\/api\/)|^(?:sha256:)?(?:[a-f0-9]{
65
80
  // Identifiers, cursors, tokens, hashes and links are follow-up inputs; keep them whole.
66
81
  const MCP_TEXT_EXACT_ID_KEY = /^(?:id|Id|ID)$|[a-z0-9](?:Id|ID)$|_(?:id|ID)$/;
67
82
  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) };
83
+ 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
84
 
70
85
  // Text twin for clients that show only text content (agent-flow round 3): a large
71
86
  // answer becomes a bounded, valid JSON preview of the same document (marked by