
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 分