S9 Protocol MCP Server
Compiles compact .s9 semantic markup into HTML5, with strict validation, token telemetry, and auditing/conversion of existing HTML5 files into .s9.
Compiles .s9 markup into interactive React JSX components, automatically generating useState for widgets such as tabs and modals.
Compiles .s9 markup into standalone Tailwind CSS HTML pages, reducing repetitive utility-class output and supporting Tailwind as a compilation target.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
S9 Protocol (Beta) — Token-Efficient Web Compiler & Agent Skill
Status:
Beta· License:MIT· Zero Dependencies · Language: English | Português (Brasil)
S9 Protocol (Semantic 9) is a modular microkernel DSL compiler, MCP server, and Agent Skill / Plugin built to cut LLM output and context-window token usage when AI coding agents generate or iteratively edit web interfaces.
Instead of making an LLM stream hundreds of lines of repetitive <div>, class="...", and closing </div> tags, the agent writes compact .s9 semantic markup and compiles it locally—at zero LLM token cost—into HTML5, Tailwind CSS, or interactive React JSX (with automatic useState for tabs and modals).
Where S9 Actually Pays Off (and Where It Doesn't)
We benchmarked .s9 against compiled outputs while explicitly accounting for the Tier-2 input token cost of reading SKILL.md (1,163 tokens) using benchmarks/token-benchmark.js (BPE pre-tokenizer estimator; install optional js-tiktoken for exact cl100k_base, or pass --json for CI telemetry):
Sample File |
| Compiled HTML5 | Compiled Tailwind | Compiled React JSX | Net Saved (TW, 1st page) | 3-Turn Net (TW) |
1,144 | 3,198 (-64.2%) | 6,369 (-82.0%) | 2,418 (-52.7%) | +4,062 tokens | +14,512 tokens | |
1,520 | 3,497 (-56.5%) | 6,692 (-77.3%) | 2,777 (-45.3%) | +4,009 tokens | +14,353 tokens | |
775 | 1,313 (-41.0%) | 2,659 (-70.9%) | 1,213 (-36.1%) | +721 tokens | +4,489 tokens | |
1,107 | 1,552 (-28.7%) | 2,777 (-60.1%) | 1,497 (-26.1%) | +507 tokens | +3,847 tokens |
✅ Use S9 when:
Building landing pages, marketing sites, docs, prototypes, dashboards, or HTML emails rich in repetitive structural blocks (
nav,hero,stats,features,grid,pricing,table,tabs,modal,faq).Generating Tailwind CSS pages: S9 removes the massive Tailwind utility-class repetition (
60%–82%reduction), paying off theSKILL.mdprompt cost on the first page.Iterating across multiple turns: When an agent re-reads a page to edit it, reading compact
.s9saves input context on every single turn.Compressing legacy HTML into context: Use
auditto convert verbose HTML5 into compact.s9before refactoring.
❌ Do NOT use S9 when:
Building complex stateful React/TypeScript applications (custom hooks, Context/Redux, complex event handlers, business logic) — standard TSX/JSX is more expressive and avoids leaky abstractions.
Making a tiny 5-line HTML tweak: The upfront
SKILL.mdread cost (~1.1k tokens) won't break even on a 10-line snippet.
Related MCP server: op-product-design-mcp
Installation & Agent Integration
1. Antigravity Plugin (Full Bundle)
Global (all projects):
git clone https://github.com/jpdwebBRPT/s9-protocol.git ~/.gemini/config/plugins/s9-protocolPer-workspace (shared with your team via Git):
git clone https://github.com/jpdwebBRPT/s9-protocol.git .agents/plugins/s9-protocol
2. Claude Code / Cursor / Codex / Gemini CLI (Portable Agent Skill)
The skills/s9-protocol/ folder is 100% self-contained (s9-engine.js, s9-cli.js, s9-mcp.js, assets/s9-core.css). Copy just skills/s9-protocol/ into your agent's skills directory (and optionally reference rules/AGENTS.md).
3. Optional MCP Server (Zero Expanded-HTML Context Overhead)
With the stdio MCP server (s9_compile, s9_validate, s9_audit), the agent sends compact .s9 to s9_compile with an outputPath. The compiled HTML/Tailwind/JSX is written straight to disk without entering the LLM's context window.
Generate a ready-to-paste mcp_config.json snippet for your machine:
node skills/s9-protocol/scripts/s9-cli.js mcp-configCLI Usage
# Compile .s9 to HTML5 with strict validation & token telemetry
node skills/s9-protocol/scripts/s9-cli.js compile examples/saas-demo.s9 -o out.html --target html --strict --stats
# Compile to standalone dark-mode Tailwind CSS HTML
node skills/s9-protocol/scripts/s9-cli.js compile examples/saas-demo.s9 -o out.tw.html --target tailwind --strict
# Compile to interactive React JSX (auto-generates useState for tabs & modals)
node skills/s9-protocol/scripts/s9-cli.js compile examples/saas-demo.s9 -o SaasDemo.jsx --target react --name SaasDemo --strict
# Audit an existing HTML5 file and convert it to compact .s9
node skills/s9-protocol/scripts/s9-cli.js audit examples/benchmark_base.html --s9-out dist/benchmark.s9The 3-6-9 Language & Microkernel Architecture
<3>(Foundation): Head metadata (title,meta-desc,meta-og,font,style), config, and variables (set).<6>(Architecture): Layout and content (section,grid,table,stats,features,pricing,each,if, plus any native HTML5 tag).<9>(Peak Impact): Isolated components (props,state,css,templatewith[data-component-id]CSS scoping and copy-on-write variable isolation) and interactive widgets (hero,nav,tabs,modal,carousel,accordion,faq).
Built on a Microkernel (src/kernel.js) so contributors can register custom macros (kernel.registerMacro) and new compilation targets (kernel.registerTarget) without editing the core, with kernel.inspect() override telemetry, parseToAST() structural metrics, left-associative prototype-guarded expressions, and path-sandboxed include: directives. See ARCHITECTURE.md for contributor details.
Development & Verification
node scripts/build-dist.js # Rebuild UMD root bundles & self-contained skill engine
node tests.js # Run full test suite (Kernel, Security, React/TW, CLI, MCP)
node benchmarks/token-benchmark.js # Run token & break-even benchmark
node server.js # Start local preview server on http://localhost:3000Interactive browser tools included in the repo:
s9-benchmark.html— Live.s9editor, preview, and token telemetrycheck.html— HTML5 Semantic Auditor &.s9/ JSX / Tailwind converter
License & Contact
MIT — see LICENSE. Contributions, issues, and experiments welcome during this Beta release!
GitHub: jpdwebBRPT/s9-protocol
Contact:
jpdweb@yahoo.com
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Turns agent output into versioned web pages, PDFs, Word docs, spreadsheets and Markdown.
MarkupBase turns AI-generated Markdown and HTML into durable, versioned artifacts that people can review and discuss. Its MCP server lets agents publish new versions, preserve contextual comments, include hosted images, and respond to feedback through secure account-linked identities, creating a clear human review boundary without requiring real-time editing.
Mlola UI components, tokens and design rules for coding agents, with a markup checker
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables coding agents to export Markdown implementation plans and audits into pixel-perfect PNGs, PDFs, and self-contained HTML files, with code highlighting, Mermaid diagrams, and GitHub callouts preserved.258 npm1MIT
- AlicenseAqualityCmaintenanceEnables AI hosts to validate, write to disk, hot-reload, preview, and export single-file HTML prototypes built to the Spark OP design spec, serving them locally at 127.0.0.1:5179 by slug. Also bundles the triggering skill, spec references, templates, and CSS tokens so agents can create, revise, and hand off development-ready prototype HTML through one controlled output path.910 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to deterministically audit markup and stylesheets for WCAG contrast failures, accessibility errors and design-token sprawl, and to compute contrast ratios and inventory hardcoded colors, sizes, radii and spacing before shipping UI code. Works across any web stack with Claude Code, Claude Desktop, Codex and Antigravity, and can also run as a CI check that exits non-zero on errors.64 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to validate HTML, CSS, JSON, XML, and accessibility from code snippets, local files, or live URLs, with optional page audits and site scans.412 npmMIT