Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(grok): finish /grok as the Grok Bot landing page, sharing the /connect connector card

nirholasdd1c8e12f151
diff --git a/STRUCTURE.md b/STRUCTURE.md
index 9fd12e97e..8eb7d7f57 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -230,7 +230,7 @@ bottom.
| On-chain agent invocation | [contracts/agent-invocation/](contracts/agent-invocation) | In-repo | Anchor program: verifiable agent-to-agent skill invocation events. SDK: [agent-protocol-sdk/](agent-protocol-sdk) |
| Escrowed knocks (pay-per-reply) | [contracts/knock-escrow/](contracts/knock-escrow) | In-repo | Anchor program making a knock's payment conditional instead of final: `knock` parks the price in a vault owned by the knock's own PDA, and only three things can happen to it. `answer` pays the owner minus a fee capped at 10% in the program itself, `refuse` refunds the sender in full and takes no fee, and `reclaim` refunds the sender once the reply window closes and can be called by anyone. Each `KnockRecord` snapshots the fee that was in force when it was made, so an authority cannot reprice money already in escrow, and it stores only the SHA-256 of the message and the reply, never their text. The trust-me version of this settles straight to the owner at [api/knock/](api/knock) (row above); this is the version that works between strangers. Both sides are reachable from a browser: senders escrow and crank their own refund from the door page, owners open their on-chain door, answer for payment or refuse for a refund from [/knock](pages/knock.html), all signed by their own wallet ([src/knock/escrow-checkout.js](src/knock/escrow-checkout.js)). Docs: [contracts/knock-escrow/README.md](contracts/knock-escrow/README.md), [docs/knock.md](docs/knock.md). Tests: [tests/knock-escrow-program.test.js](tests/knock-escrow-program.test.js), [tests/knock-escrow-pda.test.js](tests/knock-escrow-pda.test.js), [tests/api-knock-escrowed.test.js](tests/api-knock-escrowed.test.js), [tests/api-knock-escrow-sync.test.js](tests/api-knock-escrow-sync.test.js) |
| Cross-chain SDKs | [sdk/](sdk), [solana-agent-sdk/](solana-agent-sdk), [agent-payments-sdk/](agent-payments-sdk), [agent-protocol-sdk/](agent-protocol-sdk) | Published | Cross-chain agent SDKs |
-| MCP integration | [mcp-server/](mcp-server), [mcp-bridge/](mcp-bridge), [packages/*-mcp/](packages) | 43 npm servers + 8 hosted remote (51 total, incl. the free `/api/mcp-studio` 3D Studio, whose ChatGPT plugin surface [api/mcp-chatgpt.js](api/mcp-chatgpt.js) `→ /api/mcp-chatgpt` serves the eight 3D tools and the model viewer without the persona tools or any `frameDomains`, and whose Grok surface [api/mcp-grok.js](api/mcp-grok.js) `→ /api/mcp-grok` serves every studio tool with no widget templates plus, for a caller signed in with OAuth 2.1 or a connector key, the account's agent tools from the core server ([api/_mcp-studio/account-tools.js](api/_mcp-studio/account-tools.js), never a value-moving tool; docs [docs/grok.md](docs/grok.md), test [tests/mcp-grok-accounts.test.js](tests/mcp-grok-accounts.test.js)); all three doors share [api/_mcp-studio/handler.js](api/_mcp-studio/handler.js), and `SURFACES` in [api/_mcp-studio/dispatch.js](api/_mcp-studio/dispatch.js) defines what each advertises), all in the [MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas). Canonical metadata: [prompts/store-submissions/_generated/mcp-listing-source.json](prompts/store-submissions/_generated/mcp-listing-source.json), generated from the manifests by [scripts/build-mcp-listing-source.mjs](scripts/build-mcp-listing-source.mjs) (`npm run audit:mcp-listing` fails when it drifts) | Model Context Protocol surface, full server list in [docs/mcp.md](docs/mcp.md). One-click client setup: [pages/connect.html](pages/connect.html) `→ /connect` (Claude, Cursor and VS Code install links plus ChatGPT, Claude Code and generic steps, built live from [public/.well-known/mcp.json](public/.well-known/mcp.json) with tool counts from the catalog; config names match the CLI's `slugForPath`). CLI: [packages/three-ws-cli/](packages/three-ws-cli) (`npx three-ws setup`), docs [docs/cli.md](docs/cli.md) `→ /docs/cli`. Searchable index of every tool: [pages/mcp-tools.html](pages/mcp-tools.html) `→ /mcp-tools`, rendered from the generated [public/mcp-catalog.json](public/mcp-catalog.json) ([scripts/build-mcp-catalog.mjs](scripts/build-mcp-catalog.mjs), `npm run build:mcp-catalog`, staleness gated by `npm run audit:mcp-catalog`). Tool safety annotations are verified against each handler by [scripts/audit-mcp-safety.mjs](scripts/audit-mcp-safety.mjs) (`npm run audit:mcp-safety`, rules in [scripts/lib/mcp-safety-check.mjs](scripts/lib/mcp-safety-check.mjs), guarded-file list shared with the golden snapshot via [scripts/lib/mcp-tool-sources.mjs](scripts/lib/mcp-tool-sources.mjs)); docs [docs/mcp-safety.md](docs/mcp-safety.md) `→ /docs/mcp-safety`. Trust policy: [api/mcp-policy.js](api/mcp-policy.js) `-> GET /api/mcp-policy` turns those verified labels into a ready-to-paste client allowlist (profiles strict/balanced/open x formats claude/vscode/json), surfaced by the builder panel on `/mcp-tools`. Connector-review readiness (every paid stdio tool answers a clean x402 challenge, and the reviewer entitlement lifts it): [scripts/audit-mcp-reviewer-path.mjs](scripts/audit-mcp-reviewer-path.mjs), `npm run audit:mcp-reviewer`. Tests: [tests/mcp-safety-audit.test.js](tests/mcp-safety-audit.test.js), [tests/mcp-catalog.test.js](tests/mcp-catalog.test.js), [tests/api/mcp-policy.test.js](tests/api/mcp-policy.test.js) |
+| MCP integration | [mcp-server/](mcp-server), [mcp-bridge/](mcp-bridge), [packages/*-mcp/](packages) | 43 npm servers + 8 hosted remote (51 total, incl. the free `/api/mcp-studio` 3D Studio, whose ChatGPT plugin surface [api/mcp-chatgpt.js](api/mcp-chatgpt.js) `→ /api/mcp-chatgpt` serves the eight 3D tools and the model viewer without the persona tools or any `frameDomains`, and whose Grok surface [api/mcp-grok.js](api/mcp-grok.js) `→ /api/mcp-grok` serves every studio tool with no widget templates plus, for a caller signed in with OAuth 2.1 or a connector key, the account's agent tools from the core server ([api/_mcp-studio/account-tools.js](api/_mcp-studio/account-tools.js), never a value-moving tool; docs [docs/grok.md](docs/grok.md), test [tests/mcp-grok-accounts.test.js](tests/mcp-grok-accounts.test.js)); all three doors share [api/_mcp-studio/handler.js](api/_mcp-studio/handler.js), and `SURFACES` in [api/_mcp-studio/dispatch.js](api/_mcp-studio/dispatch.js) defines what each advertises), all in the [MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas). Canonical metadata: [prompts/store-submissions/_generated/mcp-listing-source.json](prompts/store-submissions/_generated/mcp-listing-source.json), generated from the manifests by [scripts/build-mcp-listing-source.mjs](scripts/build-mcp-listing-source.mjs) (`npm run audit:mcp-listing` fails when it drifts) | Model Context Protocol surface, full server list in [docs/mcp.md](docs/mcp.md). One-click client setup: [pages/connect.html](pages/connect.html) `→ /connect` (Claude, Cursor and VS Code install links plus ChatGPT, Grok Bot, Claude Code and generic steps; the Grok Bot tab is the shared connector card [src/grok-connector.js](src/grok-connector.js), also mounted on the Grok landing page [pages/grok.html](pages/grok.html) `→ /grok` ([src/grok-page.js](src/grok-page.js): capabilities, a live strip of recent gallery creations, an in-page MCP demo against `/api/mcp-grok`, three scheduled recipes, the skill file); /connect is built live from [public/.well-known/mcp.json](public/.well-known/mcp.json) with tool counts from the catalog; config names match the CLI's `slugForPath`). CLI: [packages/three-ws-cli/](packages/three-ws-cli) (`npx three-ws setup`), docs [docs/cli.md](docs/cli.md) `→ /docs/cli`. Searchable index of every tool: [pages/mcp-tools.html](pages/mcp-tools.html) `→ /mcp-tools`, rendered from the generated [public/mcp-catalog.json](public/mcp-catalog.json) ([scripts/build-mcp-catalog.mjs](scripts/build-mcp-catalog.mjs), `npm run build:mcp-catalog`, staleness gated by `npm run audit:mcp-catalog`). Tool safety annotations are verified against each handler by [scripts/audit-mcp-safety.mjs](scripts/audit-mcp-safety.mjs) (`npm run audit:mcp-safety`, rules in [scripts/lib/mcp-safety-check.mjs](scripts/lib/mcp-safety-check.mjs), guarded-file list shared with the golden snapshot via [scripts/lib/mcp-tool-sources.mjs](scripts/lib/mcp-tool-sources.mjs)); docs [docs/mcp-safety.md](docs/mcp-safety.md) `→ /docs/mcp-safety`. Trust policy: [api/mcp-policy.js](api/mcp-policy.js) `-> GET /api/mcp-policy` turns those verified labels into a ready-to-paste client allowlist (profiles strict/balanced/open x formats claude/vscode/json), surfaced by the builder panel on `/mcp-tools`. Connector-review readiness (every paid stdio tool answers a clean x402 challenge, and the reviewer entitlement lifts it): [scripts/audit-mcp-reviewer-path.mjs](scripts/audit-mcp-reviewer-path.mjs), `npm run audit:mcp-reviewer`. Tests: [tests/mcp-safety-audit.test.js](tests/mcp-safety-audit.test.js), [tests/mcp-catalog.test.js](tests/mcp-catalog.test.js), [tests/api/mcp-policy.test.js](tests/api/mcp-policy.test.js) |
| Awesome 3D Agents (curated list) | Source [data/awesome.json](data/awesome.json), generator [scripts/build-awesome.mjs](scripts/build-awesome.mjs) (`npm run build:awesome`, drift-gated by `npm run check:awesome`, publishable mirror via `npm run awesome:standalone`), outputs [awesome/README.md](awesome/README.md) + [public/awesome.json](public/awesome.json), page [pages/awesome.html](pages/awesome.html) `-> /awesome`, link checker [scripts/check-awesome-links.mjs](scripts/check-awesome-links.mjs) (`npm run awesome:links`) | Live | An awesome-list of everything needed to give an AI agent a body: text-to-3D, capture and splatting, avatars, rigging, motion, lipsync and voice, web renderers, asset pipelines, physics and networking, agent frameworks, datasets, free assets, learning. One JSON source produces both the GitHub-facing list and the searchable page, so they cannot disagree. Every url is fetched and classified (ok / moved / bot-filtered / broken) before it ships; the checker stays out of the deploy path so a third-party outage cannot redden someone else's build. The README is written to pass `npx awesome-lint`: badge on the heading line, no License section, no Contributing entry in the contents, and every description capitalised and ended with a period, all enforced by the generator and by [tests/awesome-list.test.js](tests/awesome-list.test.js). Its last two lint rules read GitHub repository topics, which a list inside a product repo cannot satisfy, so `--standalone` emits a ready-to-publish mirror repo (readme, contributing, code of conduct, license) outside this checkout. Contributing: [awesome/CONTRIBUTING.md](awesome/CONTRIBUTING.md) |
| Agent Skills pack | [.agents/skills/](.agents/skills) (canonical) → manifest [.agents/skills/SKILLS.md](.agents/skills/SKILLS.md), [.agents/skills/skills-pack.json](.agents/skills/skills-pack.json); published 3D subset [public/skills/3d-studio/](public/skills/3d-studio) `→ /skills/3d-studio/` | In-repo; bundled in the `three-ws-core` [plugin](.claude-plugin/marketplace.json); 3D subset live on the site | Portable `SKILL.md` folders (Agent Skills open standard) for any Claude surface, in five categories: 3d/creative (cross-platform-safe), platform/agents (create an agent, author and sell its skills, hire other agents, connect a client to the MCP servers), wallet/payments, intel/trading, ops/production. Counts live in the generated manifest, never here. The 3d/creative ones are also published as a public, downloadable bundle at `/skills/3d-studio/` (`three-ws-3d-skills.zip`), which is what an OpenAI Plugin Directory submission uploads on its Skills tab; a skill referencing a tool [api/_mcp-studio/](api/_mcp-studio) does not declare is dropped rather than shipped as a dead path. The same build renders the two entry-point skills from shared facts ([scripts/lib/skill-md-facts.mjs](scripts/lib/skill-md-facts.mjs)): [public/skill.md](public/skill.md) `→ /skill.md` from [data/skill-md.template.md](data/skill-md.template.md), and the Grok variant [public/grok-skill.md](public/grok-skill.md) `→ /grok-skill.md` from [data/grok-skill-md.template.md](data/grok-skill-md.template.md) (links and example calls checked by [tests/grok-skill-file.test.js](tests/grok-skill-file.test.js)). Regenerate manifest: `npm run build:skills-pack` (drift gate `npm run check:skills-pack`); regenerate the published bundle: `npm run build:openai-skills` (drift gate `npm run check:openai-skills`, wired into `npm run gate`). Docs: [docs/agent-skills.md](docs/agent-skills.md) |
| Standalone skill repos | [scripts/build-standalone-skill-repos.mjs](scripts/build-standalone-skill-repos.mjs) → `.data/standalone-repos/<repo>/` (gitignored) | Generated on demand; publishing is owner-gated | Assembles the three.ws-origin skills into small, publishable repos so an external user installs with one `/plugin marketplace add nirholas/<repo>` instead of cloning this monorepo: `three-ws-skills` (everything), `three-ws-3d-skills` (the crypto-free 3d/creative subset), `three-ws-agent-economy-skills` (wallet/payments + platform/agents). Each output is a complete one-plugin marketplace (`.claude-plugin/{marketplace,plugin}.json`, `skills/`, generated `README.md` with every trigger, `LICENSE`). Built from the same `collectSkills()` the manifest uses, so a copy cannot drift; nothing is committed here. `npm run build:skill-repos`, validate with `npm run check:skill-repos` (wired into `npm run gate`). Docs: [docs/agent-skills.md](docs/agent-skills.md) |
diff --git a/data/grok-skill-md.template.md b/data/grok-skill-md.template.md
index 0b15aca25..8d6224d90 100644
--- a/data/grok-skill-md.template.md
+++ b/data/grok-skill-md.template.md
@@ -17,10 +17,10 @@ three.ws is a free 3D studio for Grok. From one sentence or one photo it makes a
Send Grok Bot this sentence:
```
-Add a custom MCP server called three-ws at {{GROK_MCP}}
+Add a custom MCP server called three-ws-grok at {{GROK_MCP}}
```
-Say "custom server", as the sentence does, or Grok Bot may look for a marketplace plugin instead. It shows the name and URL and asks you to confirm. Transport is Streamable HTTP and authentication is None, so no sign-in card appears. Then ask for 3D in any task, or attach the server with `@three-ws`.
+Say "custom server", as the sentence does, or Grok Bot may look for a marketplace plugin instead. It shows the name and URL and asks you to confirm. Transport is Streamable HTTP and authentication is None, so no sign-in card appears. Then ask for 3D in any task, or attach the server with `@three-ws-grok`.
On a paid Grok plan, a custom connector in **Connectors** takes the same URL with authentication off. In the xAI Responses API, pass it as a remote MCP tool: `{"type": "mcp", "server_url": "{{GROK_MCP}}", "server_label": "three-ws"}`.
@@ -42,7 +42,7 @@ What the connector does:
**Retries never generate twice.** Pass your own `idempotency_key` on every generation (for a scheduled task: the task id plus the date). Calling again with the same key within 24 hours returns the first call's job instead of starting another model.
-**Scheduled tasks.** The connector serves guided MCP prompts written for runs with nobody watching: `{{prompt:agent-get-started}}`, `{{prompt:daily-3d-brief}}`, `{{prompt:asset-pack}}`, `{{prompt:avatar-from-photo}}`, and, signed in, `{{prompt:agent-report}}`. "Every morning, run the {{prompt:daily-3d-brief}} prompt from three-ws and send me the links" is a complete schedule.
+**Scheduled tasks.** The connector serves guided MCP prompts written for runs with nobody watching: `{{prompt:agent-get-started}}`, `{{prompt:daily-3d-brief}}`, `{{prompt:asset-pack}}`, `{{prompt:avatar-from-photo}}`, and, signed in, `{{prompt:agent-report}}`. "Every morning, run the {{prompt:daily-3d-brief}} prompt from three-ws-grok and send me the links" is a complete schedule.
## No connector: plain HTTPS
diff --git a/data/pages.json b/data/pages.json
index 900c91d6b..c1cade065 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -31,7 +31,7 @@
},
{
"title": "Developers",
- "paths": ["/connect", "/mcp-tools", "/docs/start-here", "/docs/mcp", "/docs/cli", "/docs/api-reference", "/avatar-sdk", "/3d", "/crypto-api", "/docs/x402", "/x402", "/docs/skills", "/prompts"]
+ "paths": ["/connect", "/grok", "/mcp-tools", "/docs/start-here", "/docs/mcp", "/docs/cli", "/docs/api-reference", "/avatar-sdk", "/3d", "/crypto-api", "/docs/x402", "/x402", "/docs/skills", "/prompts"]
},
{
"title": "Economy and $THREE",
@@ -5700,6 +5700,14 @@
"changefreq": "weekly",
"added": "2026-09-29"
},
+ {
+ "path": "/grok",
+ "title": "three.ws for Grok Bot: a free 3D studio and a body for Grok",
+ "description": "Everything Grok Bot can do with three.ws on one page: generate textured 3D models, rig avatars, find ready-made CC0 assets and run your agents through one custom MCP connector. Real models made minutes ago, the exact connector settings, three recipes to schedule and the Grok skill file. Free, no account, no key.",
+ "priority": 0.8,
+ "changefreq": "weekly",
+ "added": "2026-10-09"
+ },
{
"path": "/mcp-tools",
"title": "MCP Tool Catalog",
diff --git a/docs/grok.md b/docs/grok.md
index fab6c45d8..e31be4a38 100644
--- a/docs/grok.md
+++ b/docs/grok.md
@@ -22,13 +22,13 @@ without ever being able to spend.
Grok Bot adds a custom MCP server from chat. Send:
```
-Add a custom MCP server called three-ws at https://three.ws/api/mcp-grok
+Add a custom MCP server called three-ws-grok at https://three.ws/api/mcp-grok
```
Say "custom server" (the sentence above does), or Grok Bot may look for a
marketplace plugin instead. It shows the name and URL and asks you to confirm.
No sign-in card appears, because there is nothing to sign in to. Then ask for 3D
-in any task, or attach the server with `@three-ws`:
+in any task, or attach the server with `@three-ws-grok`:
- "Make a 3D model of a reusable rocket booster with grid fins, then send me the viewer link and the GLB."
- "Give yourself a body: forge a friendly white robot, save it as your persona, and say hello to me with it."
@@ -190,7 +190,8 @@ stops to ask, and ends with the plain links Grok hands back.
| `agent-report` | `agentId` (optional) | Signed in only: a read-only status of your agents (activity, runs, cost, earnings, wallet state) and what needs attention. |
A schedule such as "every morning, run the `daily-3d-brief` prompt from
-three-ws and send me the links" is all it takes. Anonymous, the connector lists
+three-ws-grok and send me the links" is all it takes. [three.ws/grok](/grok#gk-recipes-h)
+has three of these as copy-ready recipes, each with the calls it makes in order. Anonymous, the connector lists
the first four; signed in, it adds `agent-report`. Each prompt is written out as
its calls in [MCP use cases](./mcp.md#use-cases), and
[`api/_mcp/prompts.js`](../api/_mcp/prompts.js) renders them against the
diff --git a/pages/connect.html b/pages/connect.html
index baaf5f291..4422ebfb3 100644
--- a/pages/connect.html
+++ b/pages/connect.html
@@ -168,36 +168,6 @@
border: 1px solid var(--stroke); border-radius: var(--radius-md, 10px);
}
- /* ── connector settings (clients with a form, not a link) ───────── */
- .cn-settings { margin: 0 0 14px; display: grid; border: 1px solid var(--stroke); border-radius: var(--radius-md, 10px); overflow: hidden; max-width: 760px; }
- .cn-settings > div { display: grid; grid-template-columns: 150px 1fr; align-items: center; border-top: 1px solid var(--stroke); }
- .cn-settings > div:first-child { border-top: 0; }
- .cn-settings dt { align-self: stretch; display: flex; align-items: center; padding: 11px 14px; font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); background: var(--surface-1, rgba(255,255,255,0.03)); border-right: 1px solid var(--stroke); }
- .cn-settings dd { margin: 0; min-width: 0; padding: 10px 14px; font-size: 0.9rem; line-height: 1.5; color: var(--ink); }
- .cn-settings dd strong { color: var(--ink-bright, var(--ink)); font-weight: 650; }
- .cn-settings dd a { text-decoration: underline; text-underline-offset: 3px; }
- .cn-settings dd a:hover { color: var(--ink-bright, var(--ink)); }
- .cn-settings code { font-size: 0.88rem; color: var(--ink-bright, var(--ink)); }
- .cn-settings-url { display: flex; align-items: center; gap: 10px; }
- .cn-settings-url code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
- .cn-settings-url .cn-btn { flex: none; font-size: 0.78rem; padding: 6px 12px; }
- .cn-grok-account { margin: 0 0 14px; max-width: 760px; }
- .cn-grok-account .cn-note { margin: 0; }
- .cn-grok-account .cn-url { margin-top: 10px; }
- .cn-panel > .cn-note { margin: 0 0 14px; max-width: 72ch; }
- .cn-panel .cn-note a { text-decoration: underline; text-underline-offset: 3px; }
- .cn-panel .cn-note a:hover { color: var(--ink); }
- .cn-panel .cn-note[hidden], .cn-grok-account[hidden] { display: none; }
- .cn-grok-say { max-width: 760px; }
- .cn-grok-say pre { white-space: pre-wrap; word-break: break-word; }
- .cn-callout {
- margin: 16px 0 0; max-width: 72ch; padding: 11px 14px; font-size: 0.86rem; line-height: 1.55; color: var(--ink);
- border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-left-width: 3px; border-radius: var(--radius-md, 10px);
- background: color-mix(in srgb, var(--warn) 8%, transparent);
- }
- .cn-callout strong { color: var(--ink-bright, var(--ink)); }
- .cn-callout code { font-size: 0.84rem; padding: 1px 5px; border-radius: 5px; background: var(--surface-1, rgba(255,255,255,0.05)); }
-
/* ── worth knowing ──────────────────────────────────────────────── */
.cn-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.cn-fact { padding: 15px 16px; border: 1px solid var(--stroke); border-radius: var(--radius-md, 10px); background: var(--surface-1, rgba(255,255,255,0.03)); }
@@ -217,9 +187,6 @@
.cn-cloud .cn-url-label { display: block; flex-basis: 100%; padding: 9px 14px 0; border-right: 0; }
.cn-cloud .cn-url code { padding-top: 6px; }
.cn-panel { padding: 16px 14px 18px; }
- .cn-settings > div { grid-template-columns: 1fr; }
- .cn-settings dt { padding: 8px 14px 0; background: none; border-right: 0; }
- .cn-settings dd { padding-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
.cn-skel, .cn-panel { animation: none; }
@@ -334,56 +301,7 @@
</div>
<div class="cn-panel" role="tabpanel" id="panel-grok" aria-labelledby="tab-grok" tabindex="0" hidden>
- <p class="cn-panel-lede" data-i18n-html="connect.grok_bot_adds_three_ws_as_a_custom">Grok Bot adds three.ws as a <strong>custom MCP</strong> connector. There is no pre-filled link, so enter these settings in its connector form, or send Grok Bot the sentence below and confirm what it shows.</p>
- <p class="cn-note" id="cn-grok-suggest" hidden>
- <span data-i18n-html="connect.grok_server_is_built_for_grok_bot">The <strong>Grok</strong> server is built for Grok Bot: the free 3D studio with no sign-in, plus your own agents when you sign in, on one URL.</span>
- <button type="button" id="cn-grok-use" data-i18n="connect.use_the_grok_server">Use the Grok server</button>
- </p>
- <dl class="cn-settings">
- <div>
- <dt data-i18n="connect.name">Name</dt>
- <dd><code id="cn-grok-name">three-ws-main</code></dd>
- </div>
- <div>
- <dt data-i18n="connect.transport">Transport</dt>
- <dd data-i18n="connect.streamable_http">Streamable HTTP</dd>
- </div>
- <div>
- <dt data-i18n="connect.url">URL</dt>
- <dd class="cn-settings-url">
- <code id="cn-grok-url">https://three.ws/api/mcp</code>
- <button type="button" class="cn-btn" id="cn-grok-copy" data-copy-target="cn-grok-url"><span data-i18n="connect.copy">Copy</span></button>
- </dd>
- </div>
- <div>
- <dt data-i18n="connect.authentication">Authentication</dt>
- <dd>
- <span data-grok-auth="none" hidden data-i18n-html="connect.grok_auth_none"><strong>None.</strong> These tools are free and need no account, so no sign-in card appears.</span>
- <span data-grok-auth="oauth" data-i18n-html="connect.grok_auth_oauth"><strong>OAuth.</strong> Grok Bot opens three.ws sign-in once. Read the permissions before you approve.</span>
- <span data-grok-auth="key" hidden data-i18n-html="connect.grok_auth_key"><strong>API key.</strong> Make a key at <a href="/dashboard/api">Dashboard → API</a> and store it as a Bot secret. Signed-in calls skip the per-call payment.</span>
- </dd>
- </div>
- </dl>
- <div class="cn-grok-account" id="cn-grok-account" hidden>
- <p class="cn-note" data-i18n-html="connect.grok_account_on_the_same_server">To let Grok Bot also work with <strong>your</strong> agents, their memory and skills, connect this URL with <strong>OAuth</strong> instead. Or keep the URL above and give it a connector key from <a href="/dashboard/api">Dashboard → API</a> (choose <strong>For an AI agent</strong>), stored as a Bot secret. It never lists a tool that spends.</p>
- <div class="cn-url">
- <span class="cn-url-label" data-i18n="connect.oauth">OAuth</span>
- <code id="cn-grok-signin-url"></code>
- <button type="button" class="cn-btn" data-copy-target="cn-grok-signin-url"><span data-i18n="connect.copy">Copy</span></button>
- </div>
- </div>
- <p class="cn-note" id="cn-grok-keyalt" data-i18n-html="connect.grok_key_alternative">Running it unattended, on a schedule? A connector key from <a href="/dashboard/api">Dashboard → API</a> (choose <strong>For an AI agent</strong>), stored as a Bot secret, works on this URL too and can never spend.</p>
- <div class="cn-snippet cn-grok-say">
- <div class="cn-snippet-head"><span data-i18n="connect.or_send_this_to_grok_bot">Or send this to Grok Bot</span><button type="button" class="cn-btn" data-copy-target="cn-grok-say"><span data-i18n="connect.copy">Copy</span></button></div>
- <pre><code id="cn-grok-say">Add a custom MCP server called three-ws-main at https://three.ws/api/mcp with OAuth authentication</code></pre>
- </div>
- <ol class="cn-list">
- <li data-i18n-html="connect.grok_step_add_custom">In Grok Bot, open <strong>Connectors</strong> and add a <strong>custom MCP</strong> server with the settings above. Asking in chat works too: say "custom server", or Grok Bot may look for a marketplace plugin instead.</li>
- <li data-i18n="connect.grok_step_confirm">Grok Bot shows the name and URL. Check both, then confirm.</li>
- <li data-i18n-html="connect.grok_step_use">Ask for 3D in any task, or attach the server with <code>@</code> and its name. Grok Bot runs on its own cloud computer, so it can save the GLB to its files or run the request on a schedule.</li>
- </ol>
- <p class="cn-callout" role="note" data-i18n-html="connect.grok_localhost_never_works"><strong>Use the public URL.</strong> Grok Bot connects from xAI's cloud, not from your computer, so a <code>localhost</code> or private-network URL never works. The three.ws URLs above are public.</p>
- <p class="cn-src" data-i18n-html="connect.grok_source">Grok Bot is in beta and its connector screen still changes: if these steps drift, <a href="https://github.com/nirholas/three.ws/issues" target="_blank" rel="noopener">tell us</a>. The full guide, with the xAI API and Grok connectors, is <a href="/docs/grok">three.ws for Grok</a>.</p>
+ <div id="cn-grok-card"></div>
</div>
<div class="cn-panel" role="tabpanel" id="panel-claude-code" aria-labelledby="tab-claude-code" tabindex="0" hidden>
@@ -481,10 +399,11 @@
<script src="/brand.js" defer></script>
<script type="module">
+ import { GROK_ENDPOINT, mountGrokConnector, slugForEndpoint } from '/src/grok-connector.js';
+
const PROD_ORIGIN = 'https://three.ws';
const DEFAULT_ENDPOINT = `${PROD_ORIGIN}/api/mcp`;
const CLIENTS = ['claude', 'chatgpt', 'grok', 'claude-code', 'cursor', 'vscode', 'other'];
- const GROK_ENDPOINT = `${PROD_ORIGIN}/api/mcp-grok`;
const serversEl = document.getElementById('cn-servers');
const noteEl = document.getElementById('cn-servers-note');
@@ -492,17 +411,9 @@
const state = { servers: [], selected: null };
- // The config key each client stores the server under. Same rule as the
- // three-ws CLI (packages/three-ws-cli/src/servers.js slugForPath), so a
- // server added here and by `npx three-ws setup` never lands twice:
- // /mcp -> three-ws, /api/mcp -> three-ws-main, /api/mcp-3d -> three-ws-3d.
- function slugFor(server) {
- const pathname = new URL(server.endpoint).pathname;
- if (pathname === '/mcp') return 'three-ws';
- if (pathname === '/api/mcp') return 'three-ws-main';
- const rest = pathname.replace(/^\/(api\/)?/, '').split('-').filter((part) => part && part !== 'mcp').join('-');
- return rest ? `three-ws-${rest}` : 'three-ws';
- }
+ // The config key each client stores the server under: the three-ws CLI's
+ // rule, shared with the Grok Bot card (src/grok-connector.js).
+ const slugFor = (server) => slugForEndpoint(server.endpoint);
function displayName(server) {
return server.endpoint === DEFAULT_ENDPOINT ? 'three.ws' : `three.ws ${server.name}`;
}
@@ -603,37 +514,20 @@
document.getElementById('cn-vscode-json').textContent = JSON.stringify({ servers: { [slug]: { type: 'http', url } } }, null, 2);
document.getElementById('cn-other-json').textContent = JSON.stringify({ mcpServers: { [slug]: { type: 'http', url } } }, null, 2);
for (const el of document.querySelectorAll('.cn-name')) el.textContent = name;
- applyGrok(server, slug);
+ grokCard.update(server, { grokAvailable: state.servers.some((s) => s.endpoint === GROK_ENDPOINT) });
}
- // Grok Bot takes a custom MCP connector as a form (name, transport, URL,
- // authentication), so its panel shows those fields for the picked server.
- // Anonymous servers connect with None; a server with a sign-in URL also
- // offers that URL for OAuth; x402-first servers take a three.ws API key.
- function grokAuthFor(server) {
- const tone = authPill(server).tone;
- return tone === 'free' ? 'none' : tone === 'x402' ? 'key' : 'oauth';
- }
- function applyGrok(server, slug) {
- const url = server.endpoint;
- const auth = grokAuthFor(server);
- document.getElementById('cn-grok-name').textContent = slug;
- document.getElementById('cn-grok-url').textContent = url;
- for (const el of document.querySelectorAll('[data-grok-auth]')) el.hidden = el.dataset.grokAuth !== auth;
- document.getElementById('cn-grok-keyalt').hidden = auth !== 'oauth';
- document.getElementById('cn-grok-account').hidden = !server.signIn;
- document.getElementById('cn-grok-signin-url').textContent = server.signIn || '';
- const how = auth === 'oauth' ? ' with OAuth authentication' : auth === 'key' ? ' with API key authentication' : '';
- document.getElementById('cn-grok-say').textContent = `Add a custom MCP server called ${slug} at ${url}${how}`;
- const grokServer = state.servers.find((s) => s.endpoint === GROK_ENDPOINT);
- document.getElementById('cn-grok-suggest').hidden = !grokServer || grokServer === server;
- }
- document.getElementById('cn-grok-use').addEventListener('click', () => {
- const grokServer = state.servers.find((s) => s.endpoint === GROK_ENDPOINT);
- if (!grokServer) return;
- select(grokServer, true);
- document.getElementById('cn-grok-url').scrollIntoView({ block: 'nearest', behavior: 'smooth' });
+ // Grok Bot takes a custom MCP connector as a form, so its panel is the
+ // shared connector card, kept on whichever server is picked above.
+ const grokCard = mountGrokConnector(document.getElementById('cn-grok-card'), {
+ onUseGrok() {
+ const grokServer = state.servers.find((s) => s.endpoint === GROK_ENDPOINT);
+ if (!grokServer) return;
+ select(grokServer, true);
+ document.getElementById('gc-url').scrollIntoView({ block: 'nearest', behavior: 'smooth' });
+ },
});
+ grokCard.update({ endpoint: DEFAULT_ENDPOINT, auth: 'oauth' });
// ── cloud-agent connector URL ───────────────────────────────────────
// Keyless studio servers accept ?install=<token>, which keys their free
diff --git a/pages/grok.html b/pages/grok.html
index dd6862ad1..7b934fb86 100644
--- a/pages/grok.html
+++ b/pages/grok.html
@@ -35,7 +35,7 @@
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg-0) 82%, transparent); backdrop-filter: blur(10px); }
a { color: inherit; }
code, pre, kbd { font-family: var(--font-mono, ui-monospace, monospace); }
- .gk-wrap { max-width: var(--gk-maxw); margin: 0 auto; padding: 0 18px 96px; }
+ .gk-wrap { width: 100%; min-width: 0; max-width: var(--gk-maxw); margin: 0 auto; padding: 0 18px 96px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* ── hero ───────────────────────────────────────────────────────── */
@@ -72,9 +72,7 @@
.gk-btn svg { width: 16px; height: 16px; flex: none; }
.gk-btn-sm { font-size: 0.76rem; padding: 4px 10px; }
- /* ── ask chips ──────────────────────────────────────────────────── */
- .gk-then { margin: 18px 0 0; font-size: 0.86rem; color: var(--ink-dim); }
- .gk-asks { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px; margin-top: 10px; }
+ /* ── ask buttons (copy an instruction for Grok Bot) ──────────────── */
.gk-ask {
display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; cursor: pointer;
padding: 12px 14px; color: var(--ink); background: var(--surface-1, rgba(255,255,255,0.03));
@@ -96,6 +94,43 @@
.gk-sec-head p { margin: 0; font-size: 0.92rem; color: var(--ink-dim); line-height: 1.55; max-width: 72ch; }
.gk-sec-head p code { font-size: 0.84rem; }
+ /* ── capabilities ───────────────────────────────────────────────── */
+ .gk-caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
+ .gk-cap { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--stroke); border-radius: var(--radius-lg, 14px); background: linear-gradient(180deg, var(--surface-2, rgba(255,255,255,0.05)), transparent 75%); transition: border-color var(--duration-fast) var(--ease-standard); }
+ .gk-cap:hover { border-color: var(--stroke-strong); }
+ .gk-cap h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--ink-bright, var(--ink)); }
+ .gk-cap > p { margin: 0; font-size: 0.86rem; line-height: 1.55; color: var(--ink-dim); }
+ .gk-cap .gk-ask { margin-top: auto; }
+ .gk-tag { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
+ .gk-chips { display: flex; flex-wrap: wrap; gap: 5px; }
+ .gk-chips code, .gk-steps code { font-size: 0.74rem; padding: 2px 7px; border-radius: 6px; color: var(--ink-bright, var(--ink)); background: var(--surface-1, rgba(255,255,255,0.05)); border: 1px solid var(--stroke); }
+
+ /* ── recipes ────────────────────────────────────────────────────── */
+ .gk-recipes { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; }
+ .gk-recipe { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--stroke); border-radius: var(--radius-lg, 14px); background: var(--surface-1, rgba(255,255,255,0.03)); transition: border-color var(--duration-fast) var(--ease-standard); }
+ .gk-recipe:hover { border-color: var(--stroke-strong); }
+ .gk-recipe-kind { margin: 0; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); }
+ .gk-recipe h3 { margin: -4px 0 0; font-size: 1rem; color: var(--ink-bright, var(--ink)); }
+ .gk-recipe > p:not(.gk-recipe-kind) { margin: 0; font-size: 0.86rem; line-height: 1.55; color: var(--ink-dim); }
+ .gk-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
+ .gk-steps li { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; color: var(--ink-faint, var(--ink-dim)); }
+ .gk-steps li + li::before { content: '→'; margin-right: 2px; }
+ .gk-recipe-link { margin-top: auto; align-self: flex-start; font-size: 0.84rem; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; transition: color var(--duration-fast) var(--ease-standard); }
+ .gk-recipe-link:hover { color: var(--accent); }
+ .gk-recipe-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
+
+ /* ── skill file ─────────────────────────────────────────────────── */
+ .gk-skill { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
+ .gk-skill .gk-say { margin-top: 0; }
+ .gk-skill-toc { padding: 14px 16px; border: 1px solid var(--stroke); border-radius: var(--radius-lg, 14px); background: var(--surface-1, rgba(255,255,255,0.03)); }
+ .gk-skill-toc-h { margin: 0 0 8px; font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); }
+ .gk-skill-toc-h code { text-transform: none; letter-spacing: 0; color: var(--ink-bright, var(--ink)); }
+ .gk-skill-list { margin: 0; padding: 0 0 0 20px; display: grid; gap: 5px; font-size: 0.86rem; line-height: 1.45; color: var(--ink); }
+ .gk-skill-list li::marker { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
+ .gk-skill-list .gk-skel-line { list-style: none; height: 14px; margin-left: -20px; border-radius: 6px; }
+ .gk-skill-list[hidden] { display: none; }
+ .gk-skill-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
+
/* ── live demo ──────────────────────────────────────────────────── */
.gk-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; }
.gk-card { border: 1px solid var(--stroke); border-radius: var(--radius-lg, 14px); background: linear-gradient(180deg, var(--surface-2, rgba(255,255,255,0.05)), transparent 70%); padding: 16px; min-width: 0; }
@@ -201,7 +236,7 @@
.gk-next { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
@media (max-width: 860px) {
- .gk-demo { grid-template-columns: minmax(0, 1fr); }
+ .gk-demo, .gk-skill { grid-template-columns: minmax(0, 1fr); }
.gk-stage { min-height: 360px; }
}
@media (max-width: 640px) {
@@ -213,11 +248,11 @@
}
@media (prefers-reduced-motion: reduce) {
.gk-skel, .gk-panel, .gk-log li, .gk-stage-wait .gk-orb { animation: none; }
- .gk-made { transition: none; }
+ .gk-made, .gk-cap, .gk-recipe, .gk-recipe-link { transition: none; }
.gk-btn, .gk-tab, .gk-ask, .gk-progress span { transition: none; }
}
</style>
- <script type="application/ld+json">{"@context":"https://schema.org","@type":"HowTo","name":"Add three.ws to Grok Bot","description":"Give Grok Bot a free 3D studio: text and images to textured 3D models, rigged avatars and a talking 3D body, through one custom MCP server.","url":"https://three.ws/grok","step":[{"@type":"HowToStep","name":"Add the server","text":"Tell Grok Bot: Add a custom MCP server called three-ws at https://three.ws/api/mcp-grok"},{"@type":"HowToStep","name":"Confirm","text":"Grok Bot shows the name and URL. Accept. There is no sign-in and no key."},{"@type":"HowToStep","name":"Ask for 3D","text":"Ask for a model, an avatar, or a body. Grok returns a viewer link and a downloadable GLB."}]}</script>
+ <script type="application/ld+json">{"@context":"https://schema.org","@type":"HowTo","name":"Add three.ws to Grok Bot","description":"Give Grok Bot a free 3D studio: text and images to textured 3D models, rigged avatars and a talking 3D body, through one custom MCP server.","url":"https://three.ws/grok","step":[{"@type":"HowToStep","name":"Add the server","text":"Tell Grok Bot: Add a custom MCP server called three-ws-grok at https://three.ws/api/mcp-grok"},{"@type":"HowToStep","name":"Confirm","text":"Grok Bot shows the name and URL. Accept. There is no sign-in and no key."},{"@type":"HowToStep","name":"Ask for 3D","text":"Ask for a model, an avatar, or a body. Grok returns a viewer link and a downloadable GLB."}]}</script>
</head>
<body>
<script src="/nav.js"></script>
@@ -234,7 +269,7 @@
<div class="gk-say" role="group" aria-labelledby="gk-say-label">
<div class="gk-say-label"><span id="gk-say-label">Say this to Grok Bot</span><span>No sign-in, no key</span></div>
<div class="gk-say-row">
- <p class="gk-say-text" id="gk-say-text">Add a custom MCP server called three-ws at <code>https://three.ws/api/mcp-grok</code></p>
+ <p class="gk-say-text" id="gk-say-text">Add a custom MCP server called three-ws-grok at <code>https://three.ws/api/mcp-grok</code></p>
<button type="button" class="gk-btn" data-variant="primary" data-copy-target="gk-say-text" aria-label="Copy the sentence for Grok Bot">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg>
<span>Copy</span>
@@ -242,21 +277,62 @@
</div>
</div>
- <p class="gk-then">Then ask for something. Click one to copy it.</p>
- <div class="gk-asks" id="gk-asks">
- <button type="button" class="gk-ask" data-ask="Use three-ws to make a 3D model of a reusable rocket booster with grid fins, then send me the viewer link and the GLB.">
- <span class="gk-ask-kind"><span>Model</span><span>Copy</span></span>
- <span class="gk-ask-text">Make a 3D model of a reusable rocket booster with grid fins, then send me the viewer link and the GLB.</span>
- </button>
- <button type="button" class="gk-ask" data-ask="Use three-ws to give yourself a body: forge_avatar a friendly white robot, save it as your persona named Grok, and say hello to me with it.">
- <span class="gk-ask-kind"><span>Body</span><span>Copy</span></span>
- <span class="gk-ask-text">Give yourself a body: forge a friendly white robot, save it as your persona, and say hello to me with it.</span>
- </button>
- <button type="button" class="gk-ask" data-ask="Use three-ws to turn this photo into a rigged, animation-ready 3D avatar and save the GLB to my files.">
- <span class="gk-ask-kind"><span>Avatar</span><span>Copy</span></span>
- <span class="gk-ask-text">Turn this photo into a rigged, animation-ready 3D avatar and save the GLB to my files.</span>
- </button>
+ </section>
+
+ <section class="gk-sec" aria-labelledby="gk-caps-h">
+ <div class="gk-sec-head">
+ <h2 id="gk-caps-h">What Grok Bot can do with three.ws</h2>
+ <p>Four jobs, one connector. Each card names the tools Grok Bot calls for it. Click an ask to copy it, then paste it into any Grok Bot task.</p>
+ </div>
+ <div class="gk-caps">
+ <article class="gk-cap">
+ <h3>Generate</h3>
+ <p>Text or a photo becomes a textured 3D model with a viewer link, a GLB, a rendered poster and embed code. Grok can look at what it made and fix it in words.</p>
+ <p class="gk-chips" aria-label="Tools"><code data-tool="forge_free">forge_free</code><code data-tool="mesh_forge">mesh_forge</code><code data-tool="look_at_model">look_at_model</code><code data-tool="refine_model">refine_model</code></p>
+ <button type="button" class="gk-ask" data-ask="Use three-ws-grok to make a 3D model of a reusable rocket booster with grid fins, then send me the viewer link and the GLB.">
+ <span class="gk-ask-kind"><span>Ask</span><span>Copy</span></span>
+ <span class="gk-ask-text">Make a 3D model of a reusable rocket booster with grid fins, then send me the viewer link and the GLB.</span>
+ </button>
+ </article>
+ <article class="gk-cap">
+ <h3>Rig</h3>
+ <p>Any humanoid becomes an animation-ready avatar with a skeleton, from text, a photo or a GLB you already have. Save it as a body that speaks with lip-sync.</p>
+ <p class="gk-chips" aria-label="Tools"><code data-tool="forge_avatar">forge_avatar</code><code data-tool="rig_mesh">rig_mesh</code><code data-tool="create_agent_persona">create_agent_persona</code><code data-tool="persona_say">persona_say</code></p>
+ <button type="button" class="gk-ask" data-ask="Use three-ws-grok to turn this photo into a rigged, animation-ready 3D avatar and save the GLB to my files.">
+ <span class="gk-ask-kind"><span>Ask</span><span>Copy</span></span>
+ <span class="gk-ask-text">Turn this photo into a rigged, animation-ready 3D avatar and save the GLB to my files.</span>
+ </button>
+ </article>
+ <article class="gk-cap">
+ <h3>Find assets</h3>
+ <p>Thousands of ready-made CC0 props, rigged characters and motion clips. Grok searches them before generating, so common asks come back instantly with paste-ready code.</p>
+ <p class="gk-chips" aria-label="Tools"><code data-tool="search_catalog">search_catalog</code><code data-tool="get_catalog_item">get_catalog_item</code><code data-tool="get_item_source">get_item_source</code></p>
+ <button type="button" class="gk-ask" data-ask="Use three-ws-grok to find a ready-made 3D armchair in the catalog and give me the code to put it on a web page.">
+ <span class="gk-ask-kind"><span>Ask</span><span>Copy</span></span>
+ <span class="gk-ask-text">Find a ready-made 3D armchair in the catalog and give me the code to put it on a web page.</span>
+ </button>
+ </article>
+ <article class="gk-cap">
+ <h3>Run your agents <span class="gk-tag">Signed in</span></h3>
+ <p>Sign the same URL in with OAuth or a connector key and Grok Bot works with your three.ws agents: create and call them, give them memory and skills, report on them. It never gets a tool that spends.</p>
+ <p class="gk-chips" aria-label="Tools"><code data-tool="create_agent">create_agent</code><code data-tool="call_agent">call_agent</code><code data-tool="remember">remember</code><code data-tool="create_custom_skill">create_custom_skill</code><code data-tool="read_resource">read_resource</code></p>
+ <button type="button" class="gk-ask" data-ask="Use three-ws-grok to run the agent-report prompt for all my agents and tell me what needs attention.">
+ <span class="gk-ask-kind"><span>Ask</span><span>Copy</span></span>
+ <span class="gk-ask-text">Run the agent-report prompt for all my agents and tell me what needs attention.</span>
+ </button>
+ </article>
+ </div>
+ </section>
+
+ <section class="gk-sec" aria-labelledby="gk-made-h">
+ <div class="gk-sec-head">
+ <h2 id="gk-made-h">Made on three.ws, just now</h2>
+ <p>The latest models anyone generated on the free studio, the same pipeline Grok calls. Open one to spin it, download it, or put it on a page.</p>
+ </div>
+ <div class="gk-strip" id="gk-strip" aria-busy="true">
+ <div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div>
</div>
+ <p class="gk-note" id="gk-strip-note" hidden></p>
</section>
<section class="gk-sec" aria-labelledby="gk-demo-h">
@@ -313,32 +389,10 @@
</div>
</section>
- <section class="gk-sec" aria-labelledby="gk-made-h">
- <div class="gk-sec-head">
- <h2 id="gk-made-h">Made on three.ws, just now</h2>
- <p>The latest models anyone generated on the free studio, the same pipeline Grok calls. Open one to spin it, download it, or put it on a page.</p>
- </div>
- <div class="gk-strip" id="gk-strip" aria-busy="true">
- <div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div>
- </div>
- <p class="gk-note" id="gk-strip-note" hidden></p>
- </section>
-
- <section class="gk-sec" aria-labelledby="gk-tools-h">
- <div class="gk-sec-head">
- <h2 id="gk-tools-h">What Grok gets</h2>
- <p>Read live from the server's <code>tools/list</code>, so this is always the real catalog.</p>
- </div>
- <div class="gk-tools" id="gk-tools" aria-busy="true">
- <div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div>
- </div>
- <p class="gk-note" id="gk-tools-note" hidden></p>
- </section>
-
<section class="gk-sec" aria-labelledby="gk-setup-h">
<div class="gk-sec-head">
<h2 id="gk-setup-h">Set it up anywhere Grok runs</h2>
- <p>One URL, <code>https://three.ws/api/mcp-grok</code>. Streamable HTTP, authentication none.</p>
+ <p>One URL, <code>https://three.ws/api/mcp-grok</code>. Streamable HTTP. The free studio needs no sign-in; sign the same URL in to add your agents.</p>
</div>
<div class="gk-tabs" role="tablist" aria-label="Where you use Grok">
<button type="button" class="gk-tab" role="tab" id="tab-bot" aria-controls="panel-bot" aria-selected="true" data-tab="bot">Grok Bot</button>
@@ -347,13 +401,7 @@
</div>
<div class="gk-panel" role="tabpanel" id="panel-bot" aria-labelledby="tab-bot">
- <p class="gk-panel-lede">Grok Bot adds a custom MCP server from chat. Say <strong>custom server</strong>, or it may go looking for a marketplace plugin instead.</p>
- <ol class="gk-list">
- <li>Send: <code>Add a custom MCP server called three-ws at https://three.ws/api/mcp-grok</code></li>
- <li>Grok Bot shows the name and URL. Check the URL and accept. No sign-in card appears, because there is nothing to sign in to.</li>
- <li>Ask for 3D in any task, or attach the server with <code>@three-ws</code>. Scheduled tasks can use it too.</li>
- </ol>
- <p class="gk-src-note">Grok Bot runs on its own cloud computer, so it can also save the GLB to its files or hand it to another tool in the same task.</p>
+ <div id="gk-grok-card"></div>
</div>
<div class="gk-panel" role="tabpanel" id="panel-app" aria-labelledby="tab-app" hidden>
@@ -402,6 +450,89 @@ print(chat.sample().content)</pre>
</div>
</section>
+ <section class="gk-sec" aria-labelledby="gk-recipes-h">
+ <div class="gk-sec-head">
+ <h2 id="gk-recipes-h">Three recipes to schedule</h2>
+ <p>Grok Bot runs tasks on a schedule with nobody watching. Each recipe is a guided MCP prompt the connector serves: it names the calls, never stops to ask, and ends with plain links. Copy the instruction into a Grok Bot task and set how often it runs.</p>
+ </div>
+ <div class="gk-recipes">
+ <article class="gk-recipe">
+ <p class="gk-recipe-kind">Every morning</p>
+ <h3>Daily 3D brief</h3>
+ <p>Picks the day's top topic, or yours, turns it into a model, checks it from two angles and hands back the viewer, GLB, poster and embed.</p>
+ <button type="button" class="gk-ask" data-ask="Every morning at 9, run the daily-3d-brief prompt from three-ws-grok with the topic &quot;trending&quot; and send me the viewer link, the GLB and the poster.">
+ <span class="gk-ask-kind"><span>Instruction</span><span>Copy</span></span>
+ <span class="gk-ask-text">Every morning at 9, run the daily-3d-brief prompt from three-ws-grok with the topic "trending" and send me the viewer link, the GLB and the poster.</span>
+ </button>
+ <ol class="gk-steps" aria-label="Calls, in order"><li><code data-tool="forge_free">forge_free</code></li><li><code data-tool="get_job">get_job</code></li><li><code data-tool="look_at_model">look_at_model</code></li></ol>
+ <a class="gk-recipe-link" href="/docs/grok#scheduled-tasks-guided-prompts" data-prompt="daily-3d-brief">How the daily-3d-brief prompt runs</a>
+ </article>
+ <article class="gk-recipe">
+ <p class="gk-recipe-kind">Game jam</p>
+ <h3>Themed asset pack</h3>
+ <p>Lists what a theme needs, takes ready-made CC0 catalog items first, generates only the gaps and returns one row of links per asset.</p>
+ <button type="button" class="gk-ask" data-ask="Run the asset-pack prompt from three-ws-grok for the theme &quot;cozy cabin interior&quot; with 6 assets, and put every link in a table.">
+ <span class="gk-ask-kind"><span>Instruction</span><span>Copy</span></span>
+ <span class="gk-ask-text">Run the asset-pack prompt from three-ws-grok for the theme "cozy cabin interior" with 6 assets, and put every link in a table.</span>
+ </button>
+ <ol class="gk-steps" aria-label="Calls, in order"><li><code data-tool="search_catalog">search_catalog</code></li><li><code data-tool="get_catalog_item">get_catalog_item</code></li><li><code data-tool="forge_free">forge_free</code></li><li><code data-tool="get_job">get_job</code></li></ol>
+ <a class="gk-recipe-link" href="/docs/grok#scheduled-tasks-guided-prompts" data-prompt="asset-pack">How the asset-pack prompt runs</a>
+ </article>
+ <article class="gk-recipe">
+ <p class="gk-recipe-kind">From a photo</p>
+ <h3>Avatar from a photo</h3>
+ <p>Builds and rigs an animation-ready avatar from a photo you own, checks the limbs and face, and adds a pose studio link to animate it.</p>
+ <button type="button" class="gk-ask" data-ask="Run the avatar-from-photo prompt from three-ws-grok with the photo I attach, then send me the GLB and the pose studio link.">
+ <span class="gk-ask-kind"><span>Instruction</span><span>Copy</span></span>
+ <span class="gk-ask-text">Run the avatar-from-photo prompt from three-ws-grok with the photo I attach, then send me the GLB and the pose studio link.</span>
+ </button>
+ <ol class="gk-steps" aria-label="Calls, in order"><li><code data-tool="forge_avatar">forge_avatar</code></li><li><code data-tool="get_job">get_job</code></li><li><code data-tool="look_at_model">look_at_model</code></li></ol>
+ <a class="gk-recipe-link" href="/docs/grok#scheduled-tasks-guided-prompts" data-prompt="avatar-from-photo">How the avatar-from-photo prompt runs</a>
+ </article>
+ </div>
+ </section>
+
+ <section class="gk-sec" aria-labelledby="gk-skill-h">
+ <div class="gk-sec-head">
+ <h2 id="gk-skill-h">The Grok skill file</h2>
+ <p>One Markdown file teaches Grok the whole toolbox: the connector, a curl fallback when no connector is attached, the free limits and the rule that it never spends. It is generated from the same code that serves the tools, so it never names one that does not exist.</p>
+ </div>
+ <div class="gk-skill">
+ <div class="gk-say" role="group" aria-labelledby="gk-skill-say-label">
+ <div class="gk-say-label"><span id="gk-skill-say-label">Say this to Grok Bot</span><span>Saved to its files</span></div>
+ <div class="gk-say-row">
+ <p class="gk-say-text" id="gk-skill-say">Download https://three.ws/grok-skill.md to your files and follow it whenever I ask for 3D.</p>
+ <button type="button" class="gk-btn" data-copy-target="gk-skill-say" aria-label="Copy the skill sentence for Grok Bot">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg>
+ <span>Copy</span>
+ </button>
+ </div>
+ </div>
+ <div class="gk-skill-toc">
+ <p class="gk-skill-toc-h">Inside <code>grok-skill.md</code></p>
+ <ol class="gk-skill-list" id="gk-skill-list" aria-busy="true">
+ <li class="gk-skel gk-skel-line"></li><li class="gk-skel gk-skel-line"></li><li class="gk-skel gk-skel-line"></li><li class="gk-skel gk-skel-line"></li>
+ </ol>
+ <p class="gk-note" id="gk-skill-note" hidden></p>
+ <div class="gk-skill-actions">
+ <a class="gk-btn gk-btn-sm" href="/grok-skill.md" target="_blank" rel="noopener">Open the file</a>
+ <a class="gk-btn gk-btn-sm" href="/grok-skill.md" download="three-ws-grok-skill.md">Download</a>
+ </div>
+ </div>
+ </div>
+ </section>
+
+ <section class="gk-sec" aria-labelledby="gk-tools-h">
+ <div class="gk-sec-head">
+ <h2 id="gk-tools-h">What Grok gets</h2>
+ <p>Read live from the server's <code>tools/list</code>, so this is always the real catalog.</p>
+ </div>
+ <div class="gk-tools" id="gk-tools" aria-busy="true">
+ <div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div><div class="gk-skel"></div>
+ </div>
+ <p class="gk-note" id="gk-tools-note" hidden></p>
+ </section>
+
<section class="gk-sec" aria-labelledby="gk-facts-h">
<div class="gk-sec-head"><h2 id="gk-facts-h">Built for an agent that works while you sleep</h2></div>
<div class="gk-facts">
@@ -424,7 +555,6 @@ print(chat.sample().content)</pre>
</div>
<div class="gk-next">
<a class="gk-btn" href="/docs/grok">Read the Grok guide</a>
- <a class="gk-btn" href="/grok-skill.md" download="three-ws-grok-skill.md">Get the Grok skill file</a>
<a class="gk-btn" href="/connect">Connect other AI clients</a>
<a class="gk-btn" href="/forge">Open the 3D studio</a>
</div>
diff --git a/public/grok-skill.md b/public/grok-skill.md
index 761097b96..40c905815 100644
--- a/public/grok-skill.md
+++ b/public/grok-skill.md
@@ -17,10 +17,10 @@ three.ws is a free 3D studio for Grok. From one sentence or one photo it makes a
Send Grok Bot this sentence:
```
-Add a custom MCP server called three-ws at https://three.ws/api/mcp-grok
+Add a custom MCP server called three-ws-grok at https://three.ws/api/mcp-grok
```
-Say "custom server", as the sentence does, or Grok Bot may look for a marketplace plugin instead. It shows the name and URL and asks you to confirm. Transport is Streamable HTTP and authentication is None, so no sign-in card appears. Then ask for 3D in any task, or attach the server with `@three-ws`.
+Say "custom server", as the sentence does, or Grok Bot may look for a marketplace plugin instead. It shows the name and URL and asks you to confirm. Transport is Streamable HTTP and authentication is None, so no sign-in card appears. Then ask for 3D in any task, or attach the server with `@three-ws-grok`.
On a paid Grok plan, a custom connector in **Connectors** takes the same URL with authentication off. In the xAI Responses API, pass it as a remote MCP tool: `{"type": "mcp", "server_url": "https://three.ws/api/mcp-grok", "server_label": "three-ws"}`.
@@ -42,7 +42,7 @@ What the connector does:
**Retries never generate twice.** Pass your own `idempotency_key` on every generation (for a scheduled task: the task id plus the date). Calling again with the same key within 24 hours returns the first call's job instead of starting another model.
-**Scheduled tasks.** The connector serves guided MCP prompts written for runs with nobody watching: `agent-get-started`, `daily-3d-brief`, `asset-pack`, `avatar-from-photo`, and, signed in, `agent-report`. "Every morning, run the daily-3d-brief prompt from three-ws and send me the links" is a complete schedule.
+**Scheduled tasks.** The connector serves guided MCP prompts written for runs with nobody watching: `agent-get-started`, `daily-3d-brief`, `asset-pack`, `avatar-from-photo`, and, signed in, `agent-report`. "Every morning, run the daily-3d-brief prompt from three-ws-grok and send me the links" is a complete schedule.
## No connector: plain HTTPS
diff --git a/public/llms.txt b/public/llms.txt
index 4777820db..948aa20c7 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -31,6 +31,7 @@ Machine-readable entry points. Fetch these instead of scraping HTML.
- [llms.txt](https://three.ws/llms.txt): Curated AI-agent index (llmstxt.org convention): the official domain, accounts and $THREE mint, the machine-readable entry points, and the key pages, with llms-full.txt for the complete list.
- [llms-full.txt](https://three.ws/llms-full.txt): Expanded llms.txt with full descriptions and content hints.
- [skill.md](https://three.ws/skill.md): The three.ws Agent Skill: how an AI agent connects to three.ws, the rules it follows around money and official addresses, and an index of the focused skills for 3D generation, avatars and agents. Load it like any SKILL.md.
+- [grok-skill.md](https://three.ws/grok-skill.md): The three.ws skill for Grok and Grok Bot: the connector that adds a free 3D studio, runnable curl calls for a Grok with no connector, the links every model comes back with, what needs an account, and the rule that it never spends. Upload it to Grok's Skills.
- [robots.txt](https://three.ws/robots.txt): Crawler directives.
- [OpenAPI](https://three.ws/openapi.json): Machine-readable HTTP API spec.
- [.well-known/x402](https://three.ws/.well-known/x402): x402 paid-API discovery document.
@@ -56,7 +57,8 @@ Machine-readable entry points. Fetch these instead of scraping HTML.
## Developers
-- [Connect three.ws to Claude, ChatGPT, Cursor & VS Code](https://three.ws/connect): Add three.ws to your AI client in two clicks: one connector URL gives Claude, ChatGPT, Cursor, VS Code or Claude Code the three.ws MCP tools for 3D generation, agents, wallets and x402 payments. Sign in once in your browser, with no API key to copy.
+- [Connect three.ws to Claude, ChatGPT, Grok Bot, Cursor & VS Code](https://three.ws/connect): Add three.ws to your AI client in two clicks: one connector URL gives Claude, ChatGPT, Grok Bot, Cursor, VS Code or Claude Code the three.ws MCP tools for 3D generation, agents, wallets and x402 payments. Sign in once in your browser, with no API key to copy.
+- [three.ws for Grok Bot: a free 3D studio and a body for Grok](https://three.ws/grok): Everything Grok Bot can do with three.ws on one page: generate textured 3D models, rig avatars, find ready-made CC0 assets and run your agents through one custom MCP connector. Real models made minutes ago, the exact connector settings, three recipes to schedule and the Grok skill file. Free, no account, no key.
- [MCP Tool Catalog](https://three.ws/mcp-tools): Every MCP tool three.ws publishes, searchable in one place: what it does, which server hosts it, what it costs in USDC, and whether an AI client can run it unattended. Generated from the source of each tool, so it never drifts from what the servers serve.
- [Docs · Start Here](https://three.ws/docs/start-here): Plain-language introduction to three.ws for creators and non-developers: what it is, who it’s for, and where to begin.
- [Docs · MCP](https://three.ws/docs/mcp): Expose your agent as an MCP server for Claude, ChatGPT, and other clients.
@@ -96,6 +98,6 @@ Machine-readable entry points. Fetch these instead of scraping HTML.
## Optional
-- [llms-full.txt](https://three.ws/llms-full.txt): Every public page (925), grouped by section, with full descriptions.
+- [llms-full.txt](https://three.ws/llms-full.txt): Every public page (929), grouped by section, with full descriptions.
- [Sitemap](https://three.ws/sitemap): The same index for people, with search.
- [sitemap.xml](https://three.ws/sitemap.xml): XML sitemap for crawlers, including every agent and avatar page.
diff --git a/public/locales/en.json b/public/locales/en.json
index 4d633301c..29f00261d 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -3451,7 +3451,7 @@
"grok_key_alternative": "Running it unattended, on a schedule? A connector key from <a href=\"/dashboard/api\">Dashboard → API</a> (choose <strong>For an AI agent</strong>), stored as a Bot secret, works on this URL too and can never spend.",
"grok_localhost_never_works": "<strong>Use the public URL.</strong> Grok Bot connects from xAI's cloud, not from your computer, so a <code>localhost</code> or private-network URL never works. The three.ws URLs above are public.",
"grok_server_is_built_for_grok_bot": "The <strong>Grok</strong> server is built for Grok Bot: the free 3D studio with no sign-in, plus your own agents when you sign in, on one URL.",
- "grok_source": "Grok Bot is in beta and its connector screen still changes: if these steps drift, <a href=\"https://github.com/nirholas/three.ws/issues\" target=\"_blank\" rel=\"noopener\">tell us</a>. The full guide, with the xAI API and Grok connectors, is <a href=\"/docs/grok\">three.ws for Grok</a>.",
+ "grok_source": "Grok Bot is in beta and its connector screen still changes: if these steps drift, <a href=\"https://github.com/nirholas/three.ws/issues\" target=\"_blank\" rel=\"noopener\">tell us</a>. See what Grok Bot can do with it, live, at <a href=\"/grok\">three.ws/grok</a>, and read the full guide, with the xAI API and Grok connectors, at <a href=\"/docs/grok\">three.ws for Grok</a>.",
"grok_step_add_custom": "In Grok Bot, open <strong>Connectors</strong> and add a <strong>custom MCP</strong> server with the settings above. Asking in chat works too: say \"custom server\", or Grok Bot may look for a marketplace plugin instead.",
"grok_step_confirm": "Grok Bot shows the name and URL. Check both, then confirm.",
"grok_step_use": "Ask for 3D in any task, or attach the server with <code>@</code> and its name. Grok Bot runs on its own cloud computer, so it can save the GLB to its files or run the request on a schedule.",
diff --git a/public/nav-data.js b/public/nav-data.js
index df5f7a0c0..8924d5e3c 100644
--- a/public/nav-data.js
+++ b/public/nav-data.js
@@ -841,6 +841,12 @@ export const NAV_GROUPS = [
tier: 'advanced',
desc: 'One URL adds three.ws to Claude, ChatGPT, Cursor or VS Code',
},
+ {
+ title: 'three.ws for Grok Bot',
+ href: '/grok',
+ tier: 'advanced',
+ desc: 'Give Grok Bot a 3D studio: models, rigged avatars, assets and your agents',
+ },
{
title: 'MCP Tool Catalog',
href: '/mcp-tools',
diff --git a/src/grok-connector.css b/src/grok-connector.css
new file mode 100644
index 000000000..7cc1a62c0
--- /dev/null
+++ b/src/grok-connector.css
@@ -0,0 +1,90 @@
+/* The Grok Bot custom MCP connector card (src/grok-connector.js), shared by
+ /connect's Grok Bot tab and /grok. Everything it renders is styled here, so
+ it looks the same inside either page's panel. Tokens from public/tokens.css. */
+
+.gc { display: block; }
+.gc [hidden] { display: none !important; }
+.gc a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
+.gc a:hover { color: var(--ink-bright, var(--ink)); }
+.gc code { font-family: var(--font-mono, ui-monospace, monospace); }
+
+.gc-lede { margin: 0 0 14px; font-size: 0.92rem; line-height: 1.6; color: var(--ink-dim); max-width: 72ch; }
+.gc-lede strong { color: var(--ink-bright, var(--ink)); font-weight: 650; }
+
+.gc-note { margin: 0 0 14px; font-size: 0.84rem; line-height: 1.55; color: var(--ink-dim); max-width: 72ch; }
+.gc-note strong { color: var(--ink-bright, var(--ink)); font-weight: 650; }
+.gc-link {
+ font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
+ text-decoration: underline; text-underline-offset: 3px; font-weight: 650;
+}
+.gc-link:hover { color: var(--ink-bright, var(--ink)); }
+.gc-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
+
+.gc-btn {
+ display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
+ font: inherit; font-size: 0.78rem; font-weight: 650; padding: 6px 12px; cursor: pointer;
+ color: var(--btn-secondary-fg, var(--ink)); background: var(--btn-secondary-bg, var(--surface-3));
+ border: 1px solid var(--btn-secondary-border, var(--stroke-strong)); border-radius: var(--radius-md, 10px);
+ transition: background var(--duration-fast) var(--ease-standard), transform var(--duration-instant, 80ms) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
+}
+.gc-btn:hover { background: var(--btn-secondary-bg-hover, rgba(255,255,255,0.12)); }
+.gc-btn:active { transform: translateY(1px); }
+.gc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+.gc-btn[data-copied="true"] { color: var(--success); }
+
+.gc-settings { margin: 0 0 14px; display: grid; border: 1px solid var(--stroke); border-radius: var(--radius-md, 10px); overflow: hidden; max-width: 760px; }
+.gc-settings > div { display: grid; grid-template-columns: 150px 1fr; align-items: center; border-top: 1px solid var(--stroke); }
+.gc-settings > div:first-child { border-top: 0; }
+.gc-settings dt { align-self: stretch; display: flex; align-items: center; padding: 11px 14px; font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); background: var(--surface-1, rgba(255,255,255,0.03)); border-right: 1px solid var(--stroke); }
+.gc-settings dd { margin: 0; min-width: 0; padding: 10px 14px; font-size: 0.9rem; line-height: 1.5; color: var(--ink); }
+.gc-settings dd strong { color: var(--ink-bright, var(--ink)); font-weight: 650; }
+.gc-settings code { font-size: 0.88rem; color: var(--ink-bright, var(--ink)); }
+.gc-settings-url { display: flex; align-items: center; gap: 10px; }
+.gc-settings-url code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
+
+.gc-account { margin: 0 0 14px; max-width: 760px; }
+.gc-account .gc-note { margin: 0; }
+.gc-url {
+ display: flex; align-items: stretch; margin-top: 10px; overflow: hidden;
+ border: 1px solid var(--stroke-strong); border-radius: var(--radius-md, 10px); background: var(--surface-2, rgba(255,255,255,0.05));
+}
+.gc-url-label { flex: none; display: grid; place-items: center; min-width: 76px; padding: 0 12px; font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); border-right: 1px solid var(--stroke); }
+.gc-url code { flex: 1; min-width: 0; padding: 11px 14px; font-size: 0.88rem; color: var(--ink-bright, var(--ink)); overflow-x: auto; white-space: nowrap; }
+.gc-url .gc-btn { border-radius: 0; border-width: 0 0 0 1px; padding: 0 14px; }
+
+.gc-say { margin: 0 0 14px; max-width: 760px; }
+.gc-say-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); }
+.gc-say-head .gc-btn { text-transform: none; letter-spacing: 0; }
+.gc-say pre {
+ margin: 0; padding: 13px 14px; font-size: 0.84rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
+ color: var(--ink-bright, var(--ink)); background: var(--bg-1, rgba(0,0,0,0.3)); border: 1px solid var(--stroke); border-radius: var(--radius-md, 10px);
+}
+
+.gc-list { margin: 0; padding: 0 0 0 20px; display: grid; gap: 8px; font-size: 0.9rem; line-height: 1.55; color: var(--ink); max-width: 72ch; }
+.gc-list li::marker { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
+.gc-list strong { color: var(--ink-bright, var(--ink)); font-weight: 650; }
+.gc-list code { font-size: 0.84rem; padding: 1px 5px; border-radius: 5px; background: var(--surface-1, rgba(255,255,255,0.05)); }
+
+.gc-callout {
+ margin: 16px 0 0; max-width: 72ch; padding: 11px 14px; font-size: 0.86rem; line-height: 1.55; color: var(--ink);
+ border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-left-width: 3px; border-radius: var(--radius-md, 10px);
+ background: color-mix(in srgb, var(--warn) 8%, transparent);
+}
+.gc-callout strong { color: var(--ink-bright, var(--ink)); }
+.gc-callout code { font-size: 0.84rem; padding: 1px 5px; border-radius: 5px; background: var(--surface-1, rgba(255,255,255,0.05)); }
+
+.gc-src { margin: 14px 0 0; font-size: 0.78rem; line-height: 1.55; color: var(--ink-faint, var(--ink-dim)); max-width: 72ch; }
+
+@media (max-width: 640px) {
+ .gc-settings > div { grid-template-columns: 1fr; }
+ .gc-settings dt { padding: 8px 14px 0; background: none; border-right: 0; }
+ .gc-settings dd { padding-top: 4px; }
+ .gc-settings-url { flex-wrap: wrap; }
+ .gc-url { flex-wrap: wrap; }
+ .gc-url-label { flex-basis: 100%; place-items: start; padding: 9px 14px 0; border-right: 0; }
+ .gc-url code { padding-top: 6px; }
+ .gc-url .gc-btn { flex-basis: 100%; padding: 10px; border-width: 1px 0 0 0; }
+}
+@media (prefers-reduced-motion: reduce) {
+ .gc-btn { transition: none; }
+}
diff --git a/src/grok-connector.js b/src/grok-connector.js
new file mode 100644
index 000000000..37873d43c
--- /dev/null
+++ b/src/grok-connector.js
@@ -0,0 +1,158 @@
+// The Grok Bot custom MCP connector card: the one setup component behind
+// /connect's Grok Bot tab and the setup section of /grok.
+//
+// Grok Bot has no install link. It adds a server through a "custom MCP"
+// connector form (name, transport, URL, authentication), or from one sentence
+// in chat, and it connects from xAI's cloud, so the URL must be public. This
+// card shows exactly those fields for one hosted server and keeps them in step
+// when the page picks another. Copy is English, keyed into the `connect`
+// namespace of public/locales so i18n.js translates the card on either page.
+
+import './grok-connector.css';
+
+export const GROK_ENDPOINT = 'https://three.ws/api/mcp-grok';
+
+// The config key a client stores a server under. Same rule as the three-ws CLI
+// (packages/three-ws-cli/src/servers.js slugForPath), so a server added from
+// /connect, /grok and `npx three-ws setup` never lands twice:
+// /mcp -> three-ws, /api/mcp -> three-ws-main, /api/mcp-grok -> three-ws-grok.
+export function slugForEndpoint(endpoint) {
+ const pathname = new URL(endpoint).pathname;
+ if (pathname === '/mcp') return 'three-ws';
+ if (pathname === '/api/mcp') return 'three-ws-main';
+ const rest = pathname.replace(/^\/(api\/)?/, '').split('-').filter((part) => part && part !== 'mcp').join('-');
+ return rest ? `three-ws-${rest}` : 'three-ws';
+}
+
+// Which authentication the connector form takes for a directory entry
+// (/.well-known/mcp.json). A server with a sign-in URL also serves anonymous
+// callers, and signing in only adds the account's tools, so it connects with
+// None. An x402-first server takes a three.ws API key. The rest sign in with OAuth.
+export function grokAuthFor(server) {
+ if (server.signIn) return 'none';
+ const auth = String(server.auth || '').toLowerCase();
+ if (auth === 'none' || auth.startsWith('none ')) return 'none';
+ if (auth.startsWith('x402')) return 'key';
+ return 'oauth';
+}
+
+/** The sentence that adds a server from Grok Bot's chat. */
+export function grokSentence(server) {
+ const auth = grokAuthFor(server);
+ const how = auth === 'oauth' ? ' with OAuth authentication' : auth === 'key' ? ' with API key authentication' : '';
+ return `Add a custom MCP server called ${slugForEndpoint(server.endpoint)} at ${server.endpoint}${how}`;
+}
+
+const TEMPLATE = `
+ <p class="gc-lede" data-i18n-html="connect.grok_bot_adds_three_ws_as_a_custom">Grok Bot adds three.ws as a <strong>custom MCP</strong> connector. There is no pre-filled link, so enter these settings in its connector form, or send Grok Bot the sentence below and confirm what it shows.</p>
+ <p class="gc-note" id="gc-suggest" hidden>
+ <span data-i18n-html="connect.grok_server_is_built_for_grok_bot">The <strong>Grok</strong> server is built for Grok Bot: the free 3D studio with no sign-in, plus your own agents when you sign in, on one URL.</span>
+ <button type="button" class="gc-link" id="gc-use" data-i18n="connect.use_the_grok_server">Use the Grok server</button>
+ </p>
+ <dl class="gc-settings">
+ <div>
+ <dt data-i18n="connect.name">Name</dt>
+ <dd><code id="gc-name"></code></dd>
+ </div>
+ <div>
+ <dt data-i18n="connect.transport">Transport</dt>
+ <dd data-i18n="connect.streamable_http">Streamable HTTP</dd>
+ </div>
+ <div>
+ <dt data-i18n="connect.url">URL</dt>
+ <dd class="gc-settings-url">
+ <code id="gc-url"></code>
+ <button type="button" class="gc-btn" id="gc-copy" data-gc-copy="gc-url"><span data-i18n="connect.copy">Copy</span></button>
+ </dd>
+ </div>
+ <div>
+ <dt data-i18n="connect.authentication">Authentication</dt>
+ <dd>
+ <span data-grok-auth="none" hidden data-i18n-html="connect.grok_auth_none"><strong>None.</strong> These tools are free and need no account, so no sign-in card appears.</span>
+ <span data-grok-auth="oauth" hidden data-i18n-html="connect.grok_auth_oauth"><strong>OAuth.</strong> Grok Bot opens three.ws sign-in once. Read the permissions before you approve.</span>
+ <span data-grok-auth="key" hidden data-i18n-html="connect.grok_auth_key"><strong>API key.</strong> Make a key at <a href="/dashboard/api">Dashboard → API</a> and store it as a Bot secret. Signed-in calls skip the per-call payment.</span>
+ </dd>
+ </div>
+ </dl>
+ <div class="gc-account" id="gc-account" hidden>
+ <p class="gc-note" data-i18n-html="connect.grok_account_on_the_same_server">To let Grok Bot also work with <strong>your</strong> agents, their memory and skills, connect this URL with <strong>OAuth</strong> instead. Or keep the URL above and give it a connector key from <a href="/dashboard/api">Dashboard → API</a> (choose <strong>For an AI agent</strong>), stored as a Bot secret. It never lists a tool that spends.</p>
+ <div class="gc-url">
+ <span class="gc-url-label" data-i18n="connect.oauth">OAuth</span>
+ <code id="gc-signin-url"></code>
+ <button type="button" class="gc-btn" data-gc-copy="gc-signin-url"><span data-i18n="connect.copy">Copy</span></button>
+ </div>
+ </div>
+ <p class="gc-note" id="gc-keyalt" hidden data-i18n-html="connect.grok_key_alternative">Running it unattended, on a schedule? A connector key from <a href="/dashboard/api">Dashboard → API</a> (choose <strong>For an AI agent</strong>), stored as a Bot secret, works on this URL too and can never spend.</p>
+ <div class="gc-say">
+ <div class="gc-say-head"><span data-i18n="connect.or_send_this_to_grok_bot">Or send this to Grok Bot</span><button type="button" class="gc-btn" data-gc-copy="gc-say"><span data-i18n="connect.copy">Copy</span></button></div>
+ <pre><code id="gc-say"></code></pre>
+ </div>
+ <ol class="gc-list">
+ <li data-i18n-html="connect.grok_step_add_custom">In Grok Bot, open <strong>Connectors</strong> and add a <strong>custom MCP</strong> server with the settings above. Asking in chat works too: say "custom server", or Grok Bot may look for a marketplace plugin instead.</li>
+ <li data-i18n="connect.grok_step_confirm">Grok Bot shows the name and URL. Check both, then confirm.</li>
+ <li data-i18n-html="connect.grok_step_use">Ask for 3D in any task, or attach the server with <code>@</code> and its name. Grok Bot runs on its own cloud computer, so it can save the GLB to its files or run the request on a schedule.</li>
+ </ol>
+ <p class="gc-callout" role="note" data-i18n-html="connect.grok_localhost_never_works"><strong>Use the public URL.</strong> Grok Bot connects from xAI's cloud, not from your computer, so a <code>localhost</code> or private-network URL never works. The three.ws URLs above are public.</p>
+ <p class="gc-src" id="gc-source" data-i18n-html="connect.grok_source">Grok Bot is in beta and its connector screen still changes: if these steps drift, <a href="https://github.com/nirholas/three.ws/issues" target="_blank" rel="noopener">tell us</a>. See what Grok Bot can do with it, live, at <a href="/grok">three.ws/grok</a>, and read the full guide, with the xAI API and Grok connectors, at <a href="/docs/grok">three.ws for Grok</a>.</p>
+`;
+
+async function copyFrom(btn, source) {
+ const label = btn.querySelector('span') || btn;
+ const original = label.textContent;
+ try {
+ await navigator.clipboard.writeText(source.textContent);
+ label.textContent = 'Copied';
+ btn.dataset.copied = 'true';
+ } catch {
+ // No clipboard permission: select the text so one keystroke copies it.
+ label.textContent = 'Press Ctrl+C';
+ const range = document.createRange();
+ range.selectNodeContents(source);
+ const sel = getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+ }
+ clearTimeout(btn._gcTimer);
+ btn._gcTimer = setTimeout(() => {
+ label.textContent = original;
+ delete btn.dataset.copied;
+ }, 1600);
+}
+
+/**
+ * Render the card into `root` and return a handle that points it at a server.
+ *
+ * @param {HTMLElement} root
+ * @param {object} [opts]
+ * @param {() => void} [opts.onUseGrok] Switch the page to the Grok server. The
+ * suggestion to do so only shows when this is given.
+ * @param {boolean} [opts.source=true] Show the "steps drift? tell us" note and
+ * its links to /grok and /docs/grok.
+ * @returns {{ update(server: {endpoint: string, auth?: string, signIn?: string|null}, opts?: {grokAvailable?: boolean}): void }}
+ */
+export function mountGrokConnector(root, { onUseGrok, source = true } = {}) {
+ root.classList.add('gc');
+ root.innerHTML = TEMPLATE;
+ const el = (id) => root.querySelector(`#${id}`);
+ el('gc-source').hidden = !source;
+
+ root.addEventListener('click', (e) => {
+ const btn = e.target.closest('[data-gc-copy]');
+ if (btn) copyFrom(btn, el(btn.dataset.gcCopy));
+ });
+ if (onUseGrok) el('gc-use').addEventListener('click', () => onUseGrok());
+
+ return {
+ update(server, { grokAvailable = false } = {}) {
+ const auth = grokAuthFor(server);
+ el('gc-name').textContent = slugForEndpoint(server.endpoint);
+ el('gc-url').textContent = server.endpoint;
+ for (const span of root.querySelectorAll('[data-grok-auth]')) span.hidden = span.dataset.grokAuth !== auth;
+ el('gc-keyalt').hidden = auth !== 'oauth';
+ el('gc-account').hidden = !server.signIn;
+ el('gc-signin-url').textContent = server.signIn || '';
+ el('gc-say').textContent = grokSentence(server);
+ el('gc-suggest').hidden = !onUseGrok || !grokAvailable || server.endpoint === GROK_ENDPOINT;
+ },
+ };
+}
diff --git a/src/grok-page.js b/src/grok-page.js
index ab6b57b94..1ae9e293c 100644
--- a/src/grok-page.js
+++ b/src/grok-page.js
@@ -5,6 +5,11 @@
// issues the Mcp-Session-Id the server keys its quota on), tools/call, then
// check_job until the model lands. Every request and answer goes into the
// visible transcript, so what you watch is what Grok sees.
+//
+// The Grok Bot setup tab is the shared connector card (src/grok-connector.js),
+// the same component /connect shows in its Grok Bot tab.
+
+import { GROK_ENDPOINT, mountGrokConnector } from './grok-connector.js';
const ENDPOINT = '/api/mcp-grok';
const POLL_MIN_S = 5;
@@ -385,9 +390,13 @@ async function loadTools() {
const STRIP_COUNT = 6;
+// The render endpoint fetches the GLB itself, so it can only draw a public
+// https one. Anything else (a dev server's same-origin proxy path) shows the
+// concept image the model was sculpted from.
function posterFor(item) {
- const glb = item.web_glb_url || item.glb_url;
- return `/api/render/glb?glbUrl=${encodeURIComponent(glb)}`;
+ const glb = new URL(item.web_glb_url || item.glb_url, location.href);
+ if (glb.protocol === 'https:') return `/api/render/glb?glbUrl=${encodeURIComponent(glb.href)}`;
+ return item.preview_image_url || '';
}
async function loadStrip() {
@@ -410,7 +419,7 @@ async function loadStrip() {
strip.replaceChildren();
note.hidden = false;
note.removeAttribute('data-tone');
- note.textContent = 'Nothing has been generated in a while. Be the first: try the demo above.';
+ note.textContent = 'Nothing has been generated in a while. Be the first: try the demo below.';
return;
}
strip.replaceChildren(
@@ -424,7 +433,8 @@ async function loadStrip() {
img.width = 240;
img.height = 240;
img.alt = item.prompt ? `3D model: ${item.prompt}` : 'A 3D model made on three.ws';
- img.src = posterFor(item);
+ const poster = posterFor(item);
+ if (poster) img.src = poster;
// The render endpoint draws the GLB itself; if it cannot, the concept
// image the model was sculpted from is the next best picture of it.
img.addEventListener('error', () => {
@@ -451,8 +461,73 @@ async function loadStrip() {
}
}
+// ── Grok Bot connector card ──────────────────────────────────────────────
+
+// The card renders at once for the Grok server, anonymous, which is how it
+// connects with no credential. The server directory then supplies its sign-in
+// URL, which adds the card's "your agents on the same URL" block. If the
+// directory is unreachable the anonymous settings shown are still correct.
+async function mountConnector() {
+ const card = mountGrokConnector($('gk-grok-card'), { source: false });
+ card.update({ endpoint: GROK_ENDPOINT, auth: 'none' });
+ try {
+ const res = await fetch('/.well-known/mcp.json', { headers: { accept: 'application/json' } });
+ if (!res.ok) return;
+ const dir = await res.json();
+ const entry = (dir?.servers || []).find((s) => s.endpoint === GROK_ENDPOINT);
+ if (!entry) return;
+ const signIn = typeof entry.signIn === 'string' && entry.signIn.startsWith('https://') ? entry.signIn : null;
+ card.update({ endpoint: entry.endpoint, auth: entry.auth, signIn });
+ } catch {
+ // Offline or blocked: keep the anonymous settings already on screen.
+ }
+}
+
+// ── skill file contents ──────────────────────────────────────────────────
+
+async function loadSkill() {
+ const list = $('gk-skill-list');
+ const note = $('gk-skill-note');
+ list.hidden = false;
+ list.setAttribute('aria-busy', 'true');
+ note.hidden = true;
+ try {
+ const res = await fetch('/grok-skill.md', { headers: { accept: 'text/markdown, text/plain' } });
+ if (!res.ok) throw new Error(`the file answered ${res.status}`);
+ const headings = (await res.text()).split('\n').filter((line) => line.startsWith('## ')).map((line) => line.slice(3).trim());
+ if (!headings.length) {
+ list.hidden = true;
+ note.hidden = false;
+ note.removeAttribute('data-tone');
+ note.textContent = 'The file has no sections to preview. Open it to read it whole.';
+ return;
+ }
+ list.replaceChildren(
+ ...headings.map((text) => {
+ const li = document.createElement('li');
+ li.textContent = text;
+ return li;
+ }),
+ );
+ } catch (err) {
+ list.hidden = true;
+ note.hidden = false;
+ note.dataset.tone = 'error';
+ note.textContent = `Could not preview the file (${err?.message || 'network error'}). The links below still work. `;
+ const retry = document.createElement('button');
+ retry.type = 'button';
+ retry.textContent = 'Try again';
+ retry.addEventListener('click', loadSkill, { once: true });
+ note.append(retry);
+ } finally {
+ list.setAttribute('aria-busy', 'false');
+ }
+}
+
wireCopy();
wireTabs();
+mountConnector();
loadStrip();
startDemo();
+loadSkill();
loadTools();
diff --git a/tests/e2e/connect-grok.spec.js b/tests/e2e/connect-grok.spec.js
index 85cf19ffb..c3caae3d0 100644
--- a/tests/e2e/connect-grok.spec.js
+++ b/tests/e2e/connect-grok.spec.js
@@ -8,7 +8,8 @@ import { test, expect } from '@playwright/test';
// the real page against the real server directory (/.well-known/mcp.json):
// the tab opens by click, by keyboard and by ?client=grok, the URL and the
// authentication follow every server choice, and the copy button puts the
-// picked server's URL on the clipboard.
+// picked server's URL on the clipboard. The panel is the shared connector
+// card (src/grok-connector.js) that /grok mounts too.
const GROK = 'https://three.ws/api/mcp-grok';
@@ -36,14 +37,16 @@ test.describe('/connect Grok Bot tab', () => {
const panel = page.locator('#panel-grok');
await expect(panel).toBeVisible();
await expect(page.locator('#panel-claude')).toBeHidden();
- await expect(panel.locator('.cn-settings')).toContainText('Streamable HTTP');
- await expect(panel.locator('.cn-callout')).toContainText('localhost');
+ await expect(panel.locator('.gc-settings')).toContainText('Streamable HTTP');
+ await expect(panel.locator('.gc-callout')).toContainText('localhost');
+ // The tab sends a Grok Bot user on to the landing page that shows what it can do.
+ await expect(panel.locator('a[href="/grok"]')).toHaveCount(1);
// The default server needs sign-in, so the form asks for OAuth.
- await expect(page.locator('#cn-grok-url')).toHaveText('https://three.ws/api/mcp');
+ await expect(page.locator('#gc-url')).toHaveText('https://three.ws/api/mcp');
await expect(panel.locator('[data-grok-auth="oauth"]')).toBeVisible();
await expect(panel.locator('[data-grok-auth="none"]')).toBeHidden();
- await expect(page.locator('#cn-grok-say')).toHaveText(
+ await expect(page.locator('#gc-say')).toHaveText(
'Add a custom MCP server called three-ws-main at https://three.ws/api/mcp with OAuth authentication',
);
@@ -62,13 +65,13 @@ test.describe('/connect Grok Bot tab', () => {
await expect(page.locator(`.cn-server[data-endpoint="${GROK}"]`)).toHaveAttribute('aria-checked', 'true', { timeout: 60_000 });
const panel = page.locator('#panel-grok');
- await expect(page.locator('#cn-grok-url')).toHaveText(GROK);
- await expect(page.locator('#cn-grok-name')).toHaveText('three-ws-grok');
+ await expect(page.locator('#gc-url')).toHaveText(GROK);
+ await expect(page.locator('#gc-name')).toHaveText('three-ws-grok');
await expect(panel.locator('[data-grok-auth="none"]')).toBeVisible();
await expect(panel.locator('[data-grok-auth="oauth"]')).toBeHidden();
- await expect(page.locator('#cn-grok-signin-url')).toHaveText(`${GROK}?auth=oauth`);
- await expect(page.locator('#cn-grok-suggest')).toBeHidden();
- await expect(page.locator('#cn-grok-say')).toHaveText(`Add a custom MCP server called three-ws-grok at ${GROK}`);
+ await expect(page.locator('#gc-signin-url')).toHaveText(`${GROK}?auth=oauth`);
+ await expect(page.locator('#gc-suggest')).toBeHidden();
+ await expect(page.locator('#gc-say')).toHaveText(`Add a custom MCP server called three-ws-grok at ${GROK}`);
expect(errors).toEqual([]);
});
@@ -80,7 +83,7 @@ test.describe('/connect Grok Bot tab', () => {
await expect(servers.first()).toBeVisible({ timeout: 60_000 });
// Off the Grok server, the panel offers to switch to it.
- await expect(page.locator('#cn-grok-suggest')).toBeVisible();
+ await expect(page.locator('#gc-suggest')).toBeVisible();
const count = await servers.count();
expect(count).toBeGreaterThan(1);
@@ -88,9 +91,9 @@ test.describe('/connect Grok Bot tab', () => {
const server = servers.nth(i);
const endpoint = await server.getAttribute('data-endpoint');
await server.click();
- await expect(page.locator('#cn-grok-url')).toHaveText(endpoint);
- await page.locator('#cn-grok-copy').click();
- await expect(page.locator('#cn-grok-copy')).toHaveAttribute('data-copied', 'true');
+ await expect(page.locator('#gc-url')).toHaveText(endpoint);
+ await page.locator('#gc-copy').click();
+ await expect(page.locator('#gc-copy')).toHaveAttribute('data-copied', 'true');
expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(endpoint);
// Exactly one authentication answer shows, and it matches the pill.
@@ -98,14 +101,14 @@ test.describe('/connect Grok Bot tab', () => {
const expected = pill === 'free' ? 'none' : pill === 'x402' ? 'key' : 'oauth';
await expect(page.locator(`[data-grok-auth="${expected}"]`)).toBeVisible();
await expect(page.locator('[data-grok-auth]:visible')).toHaveCount(1);
- await expect(page.locator('#cn-grok-copy')).not.toHaveAttribute('data-copied', 'true', { timeout: 5_000 });
+ await expect(page.locator('#gc-copy')).not.toHaveAttribute('data-copied', 'true', { timeout: 5_000 });
}
// The suggestion button switches the whole page to the Grok server.
await servers.first().click();
- await page.locator('#cn-grok-use').click();
+ await page.locator('#gc-use').click();
await expect(page.locator(`.cn-server[data-endpoint="${GROK}"]`)).toHaveAttribute('aria-checked', 'true');
- await expect(page.locator('#cn-grok-url')).toHaveText(GROK);
+ await expect(page.locator('#gc-url')).toHaveText(GROK);
await expect(page).toHaveURL(/[?&]server=three-ws-grok\b/);
expect(errors).toEqual([]);
});
diff --git a/tests/e2e/grok-page.spec.js b/tests/e2e/grok-page.spec.js
new file mode 100644
index 000000000..75e2a1646
--- /dev/null
+++ b/tests/e2e/grok-page.spec.js
@@ -0,0 +1,56 @@
+import { test, expect } from '@playwright/test';
+
+// /grok, the landing page for Grok Bot users.
+//
+// Drives the real page against the real APIs: the gallery strip fills from
+// /api/forge-gallery, the setup tab mounts the shared connector card for
+// /api/mcp-grok, the tool grid comes from that server's tools/list and the
+// skill preview from /grok-skill.md. The failure and empty states are forced
+// by answering the gallery request directly.
+
+function watchErrors(page) {
+ const errors = [];
+ page.on('pageerror', (err) => errors.push(err.message));
+ return errors;
+}
+
+test.describe('/grok', () => {
+ test('renders every live section with real data', async ({ page }) => {
+ const errors = watchErrors(page);
+ await page.goto('/grok');
+ const card = page.locator('#gk-grok-card');
+ await expect(card.locator('#gc-name')).toHaveText('three-ws-grok');
+ await expect(card.locator('#gc-url')).toHaveText('https://three.ws/api/mcp-grok');
+ await expect(card.locator('[data-grok-auth="none"]')).toBeVisible();
+ await expect(card.locator('#gc-say')).toHaveText(await page.locator('#gk-say-text').innerText());
+ await expect(page.locator('#gk-tools .gk-tool').first()).toBeVisible({ timeout: 60_000 });
+ await expect(page.locator('#gk-skill-list li:not(.gk-skel)').first()).toBeVisible();
+ await expect(page.locator('.gk-recipe')).toHaveCount(3);
+
+ const gallery = await page.request.get('/api/forge-gallery?limit=6').then((r) => r.json());
+ if (gallery.enabled && gallery.creations.length) {
+ await expect(page.locator('#gk-strip .gk-made').first()).toBeVisible({ timeout: 60_000 });
+ await expect(page.locator('#gk-strip .gk-made').first()).toHaveAttribute('href', /^\/m\//);
+ }
+ expect(errors).toEqual([]);
+ });
+
+ test('the gallery strip offers a retry after an error, and says so when empty', async ({ page }) => {
+ const errors = watchErrors(page);
+ let mode = 'error';
+ await page.route('**/api/forge-gallery**', (route) =>
+ mode === 'error'
+ ? route.fulfill({ status: 503, contentType: 'application/json', body: '{}' })
+ : route.fulfill({ status: 200, contentType: 'application/json', body: '{"enabled":true,"creations":[]}' }),
+ );
+ await page.goto('/grok');
+ const note = page.locator('#gk-strip-note');
+ await expect(note).toHaveAttribute('data-tone', 'error');
+ await expect(note).toContainText('503');
+ mode = 'empty';
+ await note.getByRole('button', { name: 'Try again' }).click();
+ await expect(note).not.toHaveAttribute('data-tone', 'error');
+ await expect(note).toContainText('Be the first');
+ expect(errors).toEqual([]);
+ });
+});
diff --git a/tests/grok-page.test.js b/tests/grok-page.test.js
new file mode 100644
index 000000000..6840ce77d
--- /dev/null
+++ b/tests/grok-page.test.js
@@ -0,0 +1,96 @@
+// /grok tells a Grok Bot user which tools it will call, which guided prompts
+// to schedule and what to name the connector. Grok Bot follows those words
+// literally, so every tool and prompt the page names must be one the
+// /api/mcp-grok surface really serves, and every connector name must be the
+// one the shared connector card (src/grok-connector.js) and /connect use.
+import { describe, it, expect } from 'vitest';
+import fs from 'node:fs';
+import path from 'node:path';
+
+process.env.PUBLIC_APP_ORIGIN ||= 'https://three.ws';
+
+const { toolCatalogFor } = await import('../api/_mcp-studio/dispatch.js');
+const { GROK_ACCOUNT_TOOLS } = await import('../api/_mcp-studio/account-tools.js');
+const { PROMPTS } = await import('../api/_mcp/prompts.js');
+const { GROK_ENDPOINT, grokAuthFor, grokSentence, slugForEndpoint } = await import('../src/grok-connector.js');
+
+const ROOT = path.resolve(import.meta.dirname, '..');
+const html = fs.readFileSync(path.join(ROOT, 'pages/grok.html'), 'utf8');
+const decode = (s) => s.replace(/&quot;/g, '"').replace(/&amp;/g, '&');
+const attrs = (name) => [...html.matchAll(new RegExp(`${name}="([^"]+)"`, 'g'))].map((m) => decode(m[1]));
+
+const SERVED_TOOLS = new Set([...toolCatalogFor('grok').map((t) => t.name), ...GROK_ACCOUNT_TOOLS]);
+const AGENT_PROMPTS = new Set(PROMPTS.filter((p) => p.agent).map((p) => p.name));
+const SLUG = slugForEndpoint(GROK_ENDPOINT);
+
+describe('/grok names only what /api/mcp-grok serves', () => {
+ it('every tool chip and recipe step is a served tool', () => {
+ const named = attrs('data-tool');
+ expect(named.length).toBeGreaterThan(15);
+ expect(named.filter((name) => !SERVED_TOOLS.has(name))).toEqual([]);
+ });
+
+ it('every recipe links a guided prompt written for an unattended agent', () => {
+ const prompts = attrs('data-prompt');
+ expect(prompts).toHaveLength(3);
+ expect(prompts.filter((name) => !AGENT_PROMPTS.has(name))).toEqual([]);
+ });
+
+ it('every "run the X prompt" instruction names a real prompt', () => {
+ const asked = attrs('data-ask').flatMap((text) => [...text.matchAll(/run the ([a-z0-9-]+) prompt/gi)].map((m) => m[1]));
+ expect(asked.length).toBeGreaterThanOrEqual(4);
+ expect(asked.filter((name) => !AGENT_PROMPTS.has(name))).toEqual([]);
+ });
+
+ it('the recipe link lands on the guided-prompts heading of docs/grok.md', () => {
+ const doc = fs.readFileSync(path.join(ROOT, 'docs/grok.md'), 'utf8');
+ const anchors = doc
+ .split('\n')
+ .filter((line) => line.startsWith('## '))
+ .map((line) => line.slice(3).toLowerCase().replace(/[^a-z0-9 -]/g, '').trim().replace(/\s+/g, '-'));
+ for (const href of new Set(attrs('href').filter((h) => h.startsWith('/docs/grok#')))) {
+ expect(anchors).toContain(href.split('#')[1]);
+ }
+ });
+});
+
+describe('one connector name everywhere', () => {
+ it('the Grok server slug follows the CLI rule', () => {
+ expect(SLUG).toBe('three-ws-grok');
+ });
+
+ it('every sentence on the page uses that name', () => {
+ const text = decode(html);
+ const called = [...text.matchAll(/custom MCP server called ([a-z0-9-]+)/g)].map((m) => m[1]);
+ const uses = [...text.matchAll(/(?:Use|from) (three-ws[a-z0-9-]*)/g)].map((m) => m[1]);
+ expect(called.length).toBeGreaterThan(0);
+ expect(uses.length).toBeGreaterThan(0);
+ expect([...new Set([...called, ...uses])]).toEqual([SLUG]);
+ });
+
+ it('the hero sentence is the one the connector card generates', () => {
+ const hero = html.match(/id="gk-say-text">([\s\S]*?)<\/p>/)[1].replace(/<[^>]+>/g, '');
+ expect(hero).toBe(grokSentence({ endpoint: GROK_ENDPOINT, auth: 'none', signIn: `${GROK_ENDPOINT}?auth=oauth` }));
+ });
+
+ it('the skill file and the guide use the same name', () => {
+ for (const rel of ['public/grok-skill.md', 'docs/grok.md']) {
+ const body = fs.readFileSync(path.join(ROOT, rel), 'utf8');
+ expect(body, rel).toContain(`called ${SLUG} at ${GROK_ENDPOINT}`);
+ expect(body, rel).not.toMatch(/called three-ws at /);
+ }
+ });
+});
+
+describe('grokAuthFor', () => {
+ it('maps every directory auth string to the form field Grok Bot takes', () => {
+ expect(grokAuthFor({ auth: 'none' })).toBe('none');
+ expect(grokAuthFor({ auth: 'none for the read-only tools; API key or x402 for uploads' })).toBe('none');
+ expect(grokAuthFor({ auth: 'OAuth 2.1 or x402 pay-per-call', signIn: `${GROK_ENDPOINT}?auth=oauth` })).toBe('none');
+ expect(grokAuthFor({ auth: 'x402 pay-per-call' })).toBe('key');
+ expect(grokAuthFor({ auth: 'OAuth 2.1' })).toBe('oauth');
+ expect(grokSentence({ endpoint: 'https://three.ws/api/mcp', auth: 'OAuth 2.1' })).toBe(
+ 'Add a custom MCP server called three-ws-main at https://three.ws/api/mcp with OAuth authentication',
+ );
+ });
+});
diff --git a/tests/grok-skill-file.test.js b/tests/grok-skill-file.test.js
index f04986d63..1544ea2e8 100644
--- a/tests/grok-skill-file.test.js
+++ b/tests/grok-skill-file.test.js
@@ -88,7 +88,7 @@ describe('public/grok-skill.md', () => {
it('names the Grok connector and runs its HTTP examples against the free server', async () => {
const { values } = await skillFacts();
- expect(grokSkill).toContain(`Add a custom MCP server called three-ws at ${values.GROK_MCP}`);
+ expect(grokSkill).toContain(`Add a custom MCP server called three-ws-grok at ${values.GROK_MCP}`);
const examples = [...grokSkill.matchAll(/```bash\n([\s\S]*?)```/g)].map((m) => m[1]);
expect(examples.length).toBeGreaterThanOrEqual(4);
for (const example of examples) {