
Jsx Notation
io.github.SebastianMaciel由 GitHub 帳號 SebastianMaciel 發布v0.1.6更新於 Oct 24, 2026
JSXN encoder/decoder — compact notation for React/Next.js files, optimized for LLMs
概覽
本機 MCP 伺服器,把 JSX/TSX、HTML 與 SVG 檔案編碼成精簡的 JSXN 記法並可解碼還原,讓助理讀取前端程式碼時節省 token。
- 可以做什麼
- 讀取本機 .jsx/.tsx/.js/.ts/.html/.svg 檔案並回傳其 JSXN 編碼
- 把原始程式碼字串編碼為 JSXN,支援 file 或 snippet 模式以及 jsx 或 html 格式
- 把 JSXN 解碼回 JSX/TSX 或 HTML 原始碼
- 解碼 JSXN 並把結果寫入檔案,自動辨識 HTML/SVG 輸出
- 適用情境
- 適合助理需要反覆讀取 React/Next.js 元件、HTML 頁面或 SVG 標記,並希望節省上下文視窗空間的情境。它是面向前端開發的專用輔助工具,而非通用工具。
- 執行需求
- 以本機 stdio 程序執行,透過 npx 啟動 jsx-notation npm 套件,因此 PATH 中需要有 Node.js 與 npx。未宣告任何帳號、API 金鑰或環境變數。僅支援桌面 IDE 或命令列用戶端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Jsx Notation,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
jsx-notation
Compress React/Next.js files, HTML, and SVG by ~40% for AI assistants. An MCP server and library that converts JSX/TSX, HTML, and SVG into JSXN — a compact notation optimized for LLM token consumption.
Why
Every time an AI assistant reads your React components, HTML, or SVG files, it wastes tokens on closing tags, repeated className/class attributes, and verbose props. That's context window space that could be used for actual reasoning.
JSXN strips the redundancy while keeping the meaning:
Works for HTML too:
Works for SVG too:
Indentation replaces closing tags. .class and #id work like CSS selectors. Frequent components, props, and CSS classes get short aliases. Values with commas are quoted to avoid delimiter confusion.
Quick start: MCP server
The main use case — let your AI assistant read JSX/HTML/SVG files in compressed form.
[Install in VS Code] [Install in Cursor]
Claude Code:
That's it. Restart Claude Code and the tools will be available. No
npm installneeded —npxdownloads everything automatically.
VS Code (.vscode/mcp.json):
Add this file to your project and restart VS Code. It will detect the server on its own — no extra setup needed.
Cursor (~/.cursor/mcp.json or .cursor/mcp.json):
Just add this to your config file and restart Cursor. It will pick up the server automatically — nothing else to install.
Troubleshooting: If the server shows "No tools or prompts" with a red dot, Cursor can't find
npxin its PATH (common with nvm). Fix it by replacing"npx"with the full path — runwhich npxin your terminal and use that value (e.g."/Users/you/.nvm/versions/node/v22.22.0/bin/npx").
Windsurf (~/.codeium/windsurf/mcp_config.json):
Same format as Cursor. Add it, restart Windsurf, and it's ready.
Cline, Continue, Amazon Q, and JetBrains IDEs (IntelliJ, WebStorm, etc.) also use the same
mcpServersformat. Paste the JSON above into your MCP settings.
Zed (~/.config/zed/settings.json):
Add this inside your Zed settings file and restart. Zed uses
context_serversinstead ofmcpServers.
The server exposes four tools:
Guiding the AI
Add this to your CLAUDE.md or .cursorrules so the assistant prefers JSXN:
Library usage
For programmatic use: npm install jsx-notation — exports encode, encodeFile, encodeHTML, decode, decodeFile.
Notation reference
Elements and attributes
Patterns (JSX only)
File-level compression (encodeFile)
HTML/SVG-specific
When decoding with { format: 'html' }:
classis used instead ofclassName- All attribute values are strings (no
{expression}) - Void elements use
<br>(not<br />) - SVG elements without children use
<path ... />(XML self-closing) - Empty non-void elements use
<div></div>(not<div />) - Values with commas are quoted in props:
{key:"val, val2"}
Alias headers
Contributing
Found a bug or have an idea? Open an issue.
Disclaimer
This software is provided "as is", without warranty of any kind. See the MIT License for full terms.
JSXN is an experimental tool that compresses JSX/TSX, HTML, and SVG source code into a compact notation for use with AI/LLM systems. The encoded output is a lossy representation and may not preserve all semantic details of the original code. The author makes no guarantees about the accuracy of the encoding, the behavior of AI systems consuming JSXN output, or fitness for any particular use case.
The MCP server component reads files from your local file system. Only .jsx, .tsx, .js, .ts, .html, and .svg files are accepted, with a 10 MB size limit. You are responsible for ensuring it is configured appropriately for your environment. Use at your own risk.
License
MIT - Sebastián Maciel
來源:README.md,提交 c450344
工具
0版本歷史
1- v0.1.6最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分