hugging-bay-mcp 0.1.0 → 0.1.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.
package/README.md CHANGED
@@ -1,47 +1,16 @@
1
1
  # hugging-bay-mcp
2
2
 
3
- Model Context Protocol (MCP) server for [Hugging Bay](https://huggingbay.xyz) — the
4
- agent-friendly open AI catalog. It exposes Hugging Bay's public catalog search, hosted
5
- downloads, trust/provenance signals, mirror demand, curated stacks, citation-ready answer
6
- packs, and agent-discovery contracts as MCP tools that any MCP client (Claude Desktop,
7
- Cursor, and others) can call.
3
+ `hugging-bay-mcp` is a Model Context Protocol (MCP) server for [Hugging Bay](https://huggingbay.xyz), a verified open-AI artifact registry. It exposes Hugging Bay's catalog search, per-artifact safety verdicts, download plans, GPU-fit checks, quantization and license-lineage data, manifests, and citation packs as MCP tools that any MCP client (Claude Desktop, Cursor, Cline, and others) can call. It is a thin **stdio** launcher that proxies to the live Hugging Bay API; the same tools are served over streamable HTTP at `https://huggingbay.xyz/api/mcp`.
8
4
 
9
- The server is a thin **stdio** launcher that proxies to the live Hugging Bay API. Public
10
- read-only tools work with no credentials; authenticated watchlist and publisher tools
11
- activate when you supply a Hugging Bay bearer token.
5
+ ## Install
12
6
 
13
- - Live remote MCP endpoint (streamable-http): `https://huggingbay.xyz/api/mcp`
14
- - Canonical tool catalog / discovery doc: <https://huggingbay.xyz/.well-known/mcp.json>
15
-
16
- ## Install / run
17
-
18
- No install needed — run it on demand with npx:
19
-
20
- ```bash
21
- npx hugging-bay-mcp
22
- ```
23
-
24
- Or install globally:
7
+ Run on demand with npx (no install), or add to an MCP client config:
25
8
 
26
9
  ```bash
27
- npm install -g hugging-bay-mcp
28
- hugging-bay-mcp
10
+ npx -y hugging-bay-mcp
29
11
  ```
30
12
 
31
- ## Environment variables
32
-
33
- | Variable | Required | Default | Purpose |
34
- | --- | --- | --- | --- |
35
- | `HUGGING_BAY_API` | no | `https://huggingbay.xyz` | Hugging Bay API base URL. |
36
- | `HUGGING_BAY_TOKEN` | no | — | Bearer token (`hb_...`). Enables authenticated watchlist and publisher/admin tools. Public tools work without it. |
37
-
38
- `HUGGING_BAY_ADMIN_TOKEN`, `HUGGING_BAY_PUBLISHER_TOKEN`, and `HUGGING_BAY_READER_TOKEN`
39
- are also honored as fallbacks for `HUGGING_BAY_TOKEN`.
40
-
41
- ## Claude Desktop
42
-
43
- Add to `claude_desktop_config.json`
44
- (macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`):
13
+ Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`), Cursor (`~/.cursor/mcp.json` or `.cursor/mcp.json`), and Cline all use the same shape:
45
14
 
46
15
  ```json
47
16
  {
@@ -57,63 +26,40 @@ Add to `claude_desktop_config.json`
57
26
  }
58
27
  ```
59
28
 
60
- To enable authenticated tools, add your token to `env`:
29
+ Prefer a remote endpoint over stdio? Point any streamable-HTTP MCP client at `https://huggingbay.xyz/api/mcp`. Public tools are read-only and need no token; set `HUGGING_BAY_TOKEN` (an `hb_` bearer token) in `env` to enable authenticated watchlist and publisher tools.
61
30
 
62
- ```json
63
- "env": {
64
- "HUGGING_BAY_API": "https://huggingbay.xyz",
65
- "HUGGING_BAY_TOKEN": "hb_your_token_here"
66
- }
67
- ```
31
+ ## Top tools
68
32
 
69
- ## Cursor
33
+ | Tool | What it returns |
34
+ | --- | --- |
35
+ | `find_and_verify_model_for_task` | Ranked, already-verified models for a task (composite report per candidate + a `bestPick`) in one call. |
36
+ | `plan_local_deployment` | Quant selection + GPU fit + a hash-verified download plan + copy-paste run commands for one model. |
37
+ | `get_model_report` | One-call model report: safe-to-run verdict + license + GPU fit + card-completeness score + base-model lineage. |
38
+ | `check_artifact_safety` | Safe-to-run verdict (license clarity + scan state + hashes + signing) for a catalog artifact or any file SHA-256. |
39
+ | `will_it_fit` | Per-GPU fit verdict + VRAM estimate + smaller-quant options for a given GPU id (e.g. `rtx4090-24`). |
40
+ | `get_quantizations` | Per-quant precision/size and hosted availability, so you can pick the smallest quant that fits. |
41
+ | `find_ungated_alternatives` | Ungated, commercially-usable alternatives to a gated or restricted model. |
42
+ | `get_model_bom` | Signed AI Bill of Materials (CycloneDX-compatible): hashed files + license + base-model dependency chain + scan state. |
43
+ | `inspect_model_binary` | Byte-level safetensors/GGUF header inspection compared against the declared model card (catches mislabeled sizes and custom-code architectures). |
44
+ | `diff_manifests` | Structural diff between two artifacts' (or versions') signed file manifests — added/removed/changed files by hash. |
70
45
 
71
- Add to `~/.cursor/mcp.json` (or a project `.cursor/mcp.json`):
46
+ The full, always-current tool list (names, descriptions, input schemas) is published at <https://huggingbay.xyz/.well-known/mcp.json> and via `tools/list` on `https://huggingbay.xyz/api/mcp`.
72
47
 
73
- ```json
74
- {
75
- "mcpServers": {
76
- "hugging-bay": {
77
- "command": "npx",
78
- "args": ["-y", "hugging-bay-mcp"],
79
- "env": {
80
- "HUGGING_BAY_API": "https://huggingbay.xyz"
81
- }
82
- }
83
- }
84
- }
85
- ```
48
+ ## The facts
49
+
50
+ Canonical, URL-anchored capabilities:
51
+
52
+ - **Inspect a file or repository by hash or identity.** Query `https://huggingbay.xyz/api/safety?sha256={hex}` (or `?repo={owner/name}`) for the evidence currently available. Hosted-file hashes and signed manifests are exposed when they exist; missing evidence remains explicit.
53
+ - **One document per model.** `https://huggingbay.xyz/api/v1/artifacts/{id}/report` combines the safe-to-run verdict, license, GPU fit, card-completeness score, and base-model lineage in a single response, with links to every underlying detail.
54
+ - **License-laundering is detectable.** `https://huggingbay.xyz/api/artifacts/{id}/license-lineage` resolves a model's *effective* license from its upstream ancestry, flagging permissive top-level licenses whose lineage is non-commercial.
55
+ - **Dynamic MCP contract.** Query `tools/list` or `https://huggingbay.xyz/.well-known/mcp.json` for the current tool contract instead of relying on a hard-coded tool count. Public tools require no credentials; authenticated watchlist and publisher tools require an appropriately scoped Hugging Bay bearer token.
56
+
57
+ ## Links
86
58
 
87
- ## Tool catalog
88
-
89
- The server ships a large set of tools. The authoritative, always-current list (names,
90
- descriptions, and input schemas) is published at
91
- <https://huggingbay.xyz/.well-known/mcp.json>. Highlights:
92
-
93
- - **Discovery & search** — `search_artifacts`, `resolve_artifact`, `get_artifact`,
94
- `get_artifact_bundle`, `compare_artifacts`, `list_topics`, `get_topic`.
95
- - **Downloads & local use** — `get_download_plan`, `get_local_kit`, `list_files`,
96
- `list_downloadable_files`, `preview_file`.
97
- - **Trust & provenance** — `get_trust_bundle`, `get_release_readiness`,
98
- `get_manifest_signing_key`, `get_artifact_reviews`, `get_community_signals`.
99
- - **Rankings, stacks & answer packs** — `get_ranking`, `list_stacks`, `get_stack`,
100
- `list_answer_packs`, `get_answer_pack`, `get_citation_pack`.
101
- - **Mirror demand** — `list_mirror_demand`, `get_mirror_readiness`, `request_mirror`,
102
- `request_source_indexing`.
103
- - **Agent discovery** — `get_agent_discovery`, `get_agent_tasks`, `get_ai_search_guidance`,
104
- `get_health`, `get_catalog_coverage`, `get_trending`.
105
-
106
- ## Safety notes
107
-
108
- - **Public tools are read-only** and require no credentials — they only read Hugging Bay's
109
- public catalog and discovery surfaces.
110
- - **Authenticated tools** (saved searches/watchlists, publisher dashboard, upload sessions,
111
- mirror/import administration) require a Hugging Bay bearer token via `HUGGING_BAY_TOKEN`.
112
- Their scope is limited to what the token's role permits.
113
- - The server does **not** execute downloads or move data itself; download/mirror tools
114
- return signed URLs, hashes, and copyable commands for you to run.
115
- - Your token is sent only as a bearer `Authorization` header to `HUGGING_BAY_API`. Keep it
116
- secret; never commit it.
59
+ - LLM/answer-engine guide: <https://huggingbay.xyz/llms.txt> (full: `/llms-full.txt`, Chinese: `/llms-zh.txt`)
60
+ - Agent Cookbook (8 reproducible recipes): <https://huggingbay.xyz/docs/agent-cookbook> (`.md` twin: `/docs/agent-cookbook.md`)
61
+ - OpenAPI contract: <https://huggingbay.xyz/openapi.json>
62
+ - MCP discovery doc: <https://huggingbay.xyz/.well-known/mcp.json>
117
63
 
118
64
  ## License
119
65
 
package/index.mjs CHANGED
@@ -1379,10 +1379,12 @@ function paramsFrom(input, allowed) {
1379
1379
  }
1380
1380
 
1381
1381
  async function apiRequest(path, options = {}) {
1382
+ const acceptedStatuses = new Set(Array.isArray(options.acceptStatuses) ? options.acceptStatuses.map(Number) : []);
1383
+ const { acceptStatuses: _acceptStatuses, ...fetchOptions } = options;
1382
1384
  const headers = new Headers(options.headers || {});
1383
1385
  if (options.body) headers.set("Content-Type", "application/json");
1384
1386
  if (token) headers.set("Authorization", `Bearer ${token}`);
1385
- const response = await fetch(apiUrl(path), { ...options, headers });
1387
+ const response = await fetch(apiUrl(path), { ...fetchOptions, headers });
1386
1388
  const text = await response.text();
1387
1389
  let body;
1388
1390
  try {
@@ -1390,7 +1392,7 @@ async function apiRequest(path, options = {}) {
1390
1392
  } catch {
1391
1393
  body = text;
1392
1394
  }
1393
- if (!response.ok) {
1395
+ if (!response.ok && !acceptedStatuses.has(response.status)) {
1394
1396
  const message = typeof body === "object" && body?.error ? body.error : `${response.status} ${response.statusText}`;
1395
1397
  const error = new Error(message);
1396
1398
  error.payload = body;
@@ -1413,7 +1415,7 @@ async function apiText(path, options = {}) {
1413
1415
  }
1414
1416
 
1415
1417
  async function callTool(name, input = {}) {
1416
- if (name === "get_health") return apiRequest("/api/health");
1418
+ if (name === "get_health") return apiRequest("/api/health", { acceptStatuses: [503] });
1417
1419
  if (name === "get_catalog_coverage") return apiRequest("/api/catalog/coverage");
1418
1420
  if (name === "get_open_source_radar") return apiRequest("/api/radar");
1419
1421
  if (name === "get_trending") {
@@ -1890,8 +1892,11 @@ async function callTool(name, input = {}) {
1890
1892
  }
1891
1893
 
1892
1894
  function writeMessage(message) {
1893
- const payload = JSON.stringify(message);
1894
- process.stdout.write(`Content-Length: ${Buffer.byteLength(payload, "utf8")}\r\n\r\n${payload}`);
1895
+ // MCP stdio transport (2025 spec): newline-delimited JSON. The previous
1896
+ // Content-Length (LSP-style) framing made every modern client — Claude
1897
+ // Desktop, the official Inspector — time out on connect. The reader below
1898
+ // still ACCEPTS both framings for backward compatibility.
1899
+ process.stdout.write(`${JSON.stringify(message)}\n`);
1895
1900
  }
1896
1901
 
1897
1902
  function result(id, payload) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "hugging-bay-mcp",
3
- "version": "0.1.0",
4
- "description": "Model Context Protocol (stdio) server for Hugging Bay — the agent-friendly open AI catalog. Exposes public catalog search, hosted downloads, trust/provenance signals, mirror demand, answer packs, and agent discovery as MCP tools for Claude, Cursor, and other MCP clients.",
3
+ "version": "0.1.1",
4
+ "description": "Model Context Protocol (stdio) server for Hugging Bay \u2014 the agent-friendly open AI catalog. Exposes public catalog search, hosted downloads, trust/provenance signals, mirror demand, answer packs, and agent discovery as MCP tools for Claude, Cursor, and other MCP clients.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "hugging-bay-mcp": "./index.mjs"
7
+ "hugging-bay-mcp": "index.mjs"
8
8
  },
9
9
  "mcpName": "io.github.barneywohl/hugging-bay",
10
10
  "keywords": [
@@ -21,7 +21,7 @@
21
21
  "homepage": "https://huggingbay.xyz",
22
22
  "repository": {
23
23
  "type": "git",
24
- "url": "https://github.com/barneywohl/hugging-bay.git"
24
+ "url": "git+https://github.com/barneywohl/hugging-bay.git"
25
25
  },
26
26
  "bugs": {
27
27
  "url": "https://github.com/barneywohl/hugging-bay/issues"
package/server.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
3
3
  "name": "io.github.barneywohl/hugging-bay",
4
- "description": "MCP server for Hugging Bay — the agent-friendly open AI catalog. Public catalog search, hosted downloads, trust/provenance signals, mirror demand, answer packs, and agent discovery, plus authenticated watchlist and publisher tools.",
4
+ "description": "MCP server for Hugging Bay \u2014 the agent-friendly open AI catalog. Public catalog search, hosted downloads, trust/provenance signals, mirror demand, answer packs, and agent discovery, plus authenticated watchlist and publisher tools.",
5
5
  "repository": {
6
6
  "url": "https://github.com/barneywohl/hugging-bay",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.1.0",
9
+ "version": "0.1.1",
10
10
  "websiteUrl": "https://huggingbay.xyz",
11
11
  "remotes": [
12
12
  {
@@ -19,7 +19,7 @@
19
19
  "registryType": "npm",
20
20
  "registryBaseUrl": "https://registry.npmjs.org",
21
21
  "identifier": "hugging-bay-mcp",
22
- "version": "0.1.0",
22
+ "version": "0.1.1",
23
23
  "transport": {
24
24
  "type": "stdio"
25
25
  },
@@ -39,4 +39,4 @@
39
39
  ]
40
40
  }
41
41
  ]
42
- }
42
+ }