jsx-notation
Integrates with Codeium (Windsurf) to provide tools for compressing JSX/HTML/SVG files into JSXN notation, enabling AI assistants to work with reduced token usage.
Integrates with JetBrains IDEs (IntelliJ, WebStorm) via MCP settings to allow AI assistants to read, encode, and decode JSX/TSX, HTML, and SVG files into JSXN compact notation.
Integrates with WebStorm IDE via MCP settings to provide tools for compressing JSX/HTML/SVG files into JSXN notation for reduced token consumption.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jsx-notationcompress the file Header.jsx to JSXN"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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:
// Before: 278 chars
<Modal isOpen={showModal} onClose={handleClose}>
<div className="modal-body">
<h2>{title}</h2>
<Button disabled={!selected} onClick={handleSubmit}>Submit</Button>
</div>
</Modal>// After: 170 chars
@C Modal=M, Button=B
@P onClick=k, disabled=x, isOpen=io, onClose=oc
M {io:showModal, oc:handleClose}
.modal-body
h2 (title)
B {x:!selected, k:handleSubmit} "Submit"Works for HTML too:
<!-- Before: 340 chars -->
<table class="data-table">
<thead>
<tr><th>Name</th><th>Email</th><th>Role</th></tr>
</thead>
<tbody>
<tr><td>Alice</td><td>alice@example.com</td><td>Admin</td></tr>
<tr><td>Bob</td><td>bob@example.com</td><td>User</td></tr>
</tbody>
</table>// After: 188 chars
table.data-table
thead
tr
th "Name"
th "Email"
th "Role"
tbody
tr
td "Alice"
td "alice@example.com"
td "Admin"
tr
td "Bob"
td "bob@example.com"
td "User"Works for SVG too:
<!-- Before: 306 chars -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<circle cx="12" cy="12" r="10"></circle>
<line x1="12" y1="8" x2="12" y2="12"></line>
<line x1="12" y1="16" x2="12.01" y2="16"></line>
</svg>// After: 251 chars
svg {xmlns:http://www.w3.org/2000/svg, viewBox:0 0 24 24, fill:none, stroke:currentColor, stroke-width:2, stroke-linecap:round, stroke-linejoin:round}
circle {cx:12, cy:12, r:10}
line {x1:12, y1:8, x2:12, y2:12}
line {x1:12, y1:16, x2:12.01, y2:16}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.
Related MCP server: tsx-query
Quick start: MCP server
The main use case — let your AI assistant read JSX/HTML/SVG files in compressed form.
Claude Code:
claude mcp add jsx-notation -- npx jsx-notationThat's it. Restart Claude Code and the tools will be available. No
npm installneeded —npxdownloads everything automatically.
VS Code (.vscode/mcp.json):
{
"servers": {
"jsx-notation": {
"command": "npx",
"args": ["jsx-notation"]
}
}
}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):
{
"mcpServers": {
"jsx-notation": {
"command": "npx",
"args": ["jsx-notation"]
}
}
}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):
{
"mcpServers": {
"jsx-notation": {
"command": "npx",
"args": ["jsx-notation"]
}
}
}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):
{
"context_servers": {
"jsx-notation": {
"command": "npx",
"args": ["jsx-notation"]
}
}
}Add this inside your Zed settings file and restart. Zed uses
context_serversinstead ofmcpServers.
The server exposes four tools:
Tool | Description |
| Reads a |
| Encodes raw code as a string ( |
| Decodes JSXN back to JSX/TSX or HTML ( |
| Decodes JSXN and writes the result to a file (auto-detects |
Guiding the AI
Add this to your CLAUDE.md or .cursorrules so the assistant prefers JSXN:
When you need to read .jsx, .tsx, .js, .ts, .html, or .svg files for context,
use the read_jsxn tool from the jsx-notation MCP server. It returns JSXN compact
notation (~40% fewer tokens) that you understand perfectly.Library usage
For programmatic use: npm install jsx-notation — exports encode, encodeFile, encodeHTML, decode, decodeFile.
Notation reference
Elements and attributes
JSX/HTML | JSXN |
|
|
|
|
|
|
|
|
|
|
|
|
Patterns (JSX only)
JSX | JSXN |
|
|
|
|
|
|
|
|
File-level compression (encodeFile)
Code | JSXN |
|
|
|
|
|
|
|
|
|
|
JSX return boundary |
|
HTML/SVG-specific
HTML/SVG | JSXN |
|
|
|
|
|
|
|
|
|
|
When decoding with { format: 'html' }:
classis used instead ofclassNameAll 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
Header | Purpose | Example |
| Component aliases |
|
| Prop aliases |
|
| CSS class aliases (Tailwind) |
|
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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceAdvanced Token-Optimized Object Notation MCP server that compresses JSON with up to 85% token reduction using AI-powered pattern detection, providing lossless compression and decompression through 12 MCP tools.Last updated129MIT
- Alicense-qualityDmaintenanceSemantic React/TSX analysis MCP server that saves 70-90% tokens by using AST to retrieve precise component usages, prop flow, and state update information for AI coding assistants.Last updated11MIT
- Flicense-qualityCmaintenanceSemantic compression MCP server that reduces document token usage by 60-80% using structured symbolic notation, enabling Claude to efficiently store, retrieve, diff, and summarise documents across PRD, CODE, PAPER, and MEETING domains.Last updated
- FlicenseBqualityCmaintenanceLocal MCP server for token optimization, providing tools to compress code/JSON, optimize prompts, and manage placeholder-based content redaction and hydration to reduce LLM token usage.Last updated5
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
An MCP server that gives your AI access to the source code and docs of all public github repos
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SebastianMaciel/jsx-notation'
If you have feedback or need assistance with the MCP directory API, please join our Discord server