feat(docs): WebMCP — site as in-browser MCP server with the 3 neuron-js tools - #35
Merged
Merged
Conversation
- docs/public/webmcp/webmcp.js: vendored WebMCP widget library (jasonjmcghee/WebMCP, MIT) served self-hosted, no CDN dependency. - docs/public/webmcp/neuron-webmcp.js: registers the same three tools as the stdio server (validate_script, execute_decision, explain_decision) plus a pricing-example prompt and llms.txt / SKILL.md resources. The runtime is the real @sebasoft/neuron-js ESM from the npm registry executed in the visitor's browser; the library is browser-safe (zero node: imports). Fail-closed: every call validates script and context first. - VitePress head loads both scripts on every page. - docs/integrations/webmcp.md guide: connect instructions for Claude Desktop/Cursor/Cline/Windsurf, tool table, guarantees, provenance note (library vs W3C navigator.modelContext draft). - Sidebar, integrations index, llms.txt, llms-full.txt, SKILL.md (mirror kept identical) updated. - tests/contracts/webmcp-site.test.ts: 5 contract tests over the integration surface. Browser E2E verified: widget renders on every page; webmcp_tools in sessionStorage shows the 3 tools + prompt + 2 resources registered; the neuron-js ESM bundle executes a real script in-browser (validateScript ok, execute ok rulesExecuted=1, explain trace, invalid script rejected). Suite 122/122, docs:build green.
…istration - Chrome origin-trial token for sebasoft.github.io (WebMCP feature, expires 2026-11-17) as http-equiv=Origin-Trial meta in the VitePress head: GitHub Pages cannot serve custom headers, so the meta tag is the enabling mechanism. - Dual tool registration in neuron-webmcp.js: when the trial activates navigator.modelContext, the same three tools (validate_script, execute_decision, explain_decision) register through the native W3C API; the WebMCP widget remains the universal path for every browser. - Same fail-closed contracts on both surfaces. - Guide updated: two complementary surfaces documented honestly. - Contract test extended: origin-trial presence + dual registration. Verified: 6/6 webmcp contract tests, full suite green, docs:build with Origin-Trial meta in dist/index.html, browser E2E shows the three tools registered and the widget healthy; navigator.modelContext correctly absent in headless (trial only activates in Chrome with the token).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
El sitio de documentación se convierte en servidor MCP en el browser del visitante. Cualquier MCP client (Claude Desktop, Cursor, Cline, Windsurf) se conecta via el widget WebMCP y llama los tools de neuron-js en la página — sin backend, sin API keys.
Piezas
docs/public/webmcp/webmcp.js— librería WebMCP vendored (jasonjmcghee/WebMCP, MIT), self-hosted. Sin CDN dependency.docs/public/webmcp/neuron-webmcp.js— registra:validate_script,execute_decision,explain_decision(mismo contrato fail-closed: valida script y context antes de ejecutar)llms.txt,SKILL.md)@sebasoft/neuron-jsreal desde npm (ESM de unpkg), ejecutándose en el browser del visitante — la librería es browser-safe (ceronode:imports, verificado)docs/integrations/webmcp.md— guía completa: cómo conectar, tabla de tools, garantías, nota de provenance (librería ≠ draft W3Cnavigator.modelContext; cuando el spec nativo llegue, la página lo prefiere)llms.txt+llms-full.txt+SKILL.md(mirror idéntico verificado)tests/contracts/webmcp-site.test.ts— 5 contract tests de la superficieVerificación real (no simulada)
/neuron-js/como Pages): widget renderiza en cada página (div fixed bottom-right),WebMCPglobal presentesessionStorage.webmcp_toolsdel browser real: los 3 tools + prompt + resources registradosvalidScript:true, executed:true rulesExecuted:1, hasExplanation:true, invalidRejected:true— el mismo bundle ESM que sirve unpkgdocs:buildverdeNota de scope
La librería
@jason.today/webmcpes el prototipo original (no conforme al W3C spec, su propio README lo aclara) — funciona hoy y demuestra el patrón; la guía documenta el estado real. Cuandonavigator.modelContextllegue nativo, se prefiere.Sin bump de versión: docs-only, no runtime code del paquete.