ASON MCP Server
Enables compression and decompression of JSON data using the token-optimized ASON format, reducing token usage by 20-60% for LLM applications.
README
ASON MCP Server
Model Context Protocol (MCP) server for ASON compression/decompression. Enables Claude Desktop, Cline, Continue, and other MCP clients to compress JSON data using the token-optimized ASON format.
Features
- compress_json: Convert JSON to ASON format (20-60% token reduction)
- decompress_ason: Convert ASON back to JSON (lossless)
- get_compression_stats: Analyze compression metrics without performing compression
- configure_compressor: Customize compression settings globally
Installation
Option 1: Local Development
cd mcp-server
npm install
npm run build
Option 2: Global Installation
npm install -g @ason-format/mcp-server
Usage with Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ason": {
"command": "node",
"args": [
"/absolute/path/to/ason/mcp-server/dist/index.js"
]
}
}
}
Or if installed globally:
{
"mcpServers": {
"ason": {
"command": "ason-mcp"
}
}
}
Available Tools
1. compress_json
Compress JSON data to ASON format.
Input:
{
"json": {"users": [{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}]},
"config": {
"indent": 1,
"delimiter": "|",
"useReferences": true,
"useSections": true,
"useTabular": true
}
}
Output:
ASON 2.0 Output:
users:[2]{id,name}
1|Alice
2|Bob
Configuration used:
{
"indent": 1,
"delimiter": "|",
"useReferences": true,
"useSections": true,
"useTabular": true
}
2. decompress_ason
Decompress ASON back to JSON.
Input:
{
"ason": "users:[2]{id,name}\n1|Alice\n2|Bob"
}
Output:
{
"users": [
{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"}
]
}
3. get_compression_stats
Analyze compression statistics.
Input:
{
"json": {"users": [{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}]},
"config": {
"indent": 1,
"delimiter": "|"
}
}
Output:
Compression Statistics:
Original Tokens: 32
Compressed Tokens: 15
Reduction: 53.13%
Original Size: 78 bytes
Compressed Size: 41 bytes
Savings: 37 bytes
Configuration:
{
"indent": 1,
"delimiter": "|",
"useReferences": true,
"useSections": true,
"useTabular": true
}
4. configure_compressor
Update global compression settings.
Input:
{
"config": {
"indent": 2,
"delimiter": ",",
"useReferences": false
}
}
Output:
Global configuration updated:
{
"indent": 2,
"delimiter": ",",
"useReferences": false,
"useSections": true,
"useTabular": true
}
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
indent |
number | 1 |
Indentation level for nested structures |
delimiter |
string | `" | "` |
useReferences |
boolean | true |
Enable $var reference deduplication |
useSections |
boolean | true |
Enable @section organization for objects |
useTabular |
boolean | true |
Enable [N]{fields} tabular format for arrays |
minFieldsForSection |
number | 3 |
Minimum fields to create a @section |
minRowsForTabular |
number | 2 |
Minimum rows for tabular array format |
minReferenceOccurrences |
number | 2 |
Minimum occurrences to create a $var reference |
Development
# Build
npm run build
# Watch mode
npm run watch
# Test locally
node dist/index.js
Example Usage in Claude Desktop
User: Can you compress this JSON for me?
{
"products": [
{"id": 1, "name": "Laptop", "price": 999},
{"id": 2, "name": "Mouse", "price": 25}
]
}
Claude: I'll use the compress_json tool to compress this JSON.
[Uses MCP tool compress_json]
Result:
products:[2]{id,name,price}
1|Laptop|999
2|Mouse|25
This compressed version uses 45% fewer tokens!
🚀 Publishing
To release a new version:
# Run the release script
./scripts/release.sh
# 1. Select version bump (patch/minor/major)
# 2. Update CHANGELOG.md when prompted
# 3. Confirm push
# GitHub Actions will automatically:
# - Build the package
# - Publish to NPM (@ason-format/mcp-server)
# - Create GitHub Release
🧪 Supported MCP Clients
- ✅ Claude Desktop (Anthropic)
- ✅ Cline (VS Code extension)
- ✅ Continue (VS Code extension)
- ✅ Any MCP client with stdio transport
📚 What is ASON 2.0?
ASON (Aliased Serialization Object Notation) 2.0 is a token-optimized JSON compression format designed for LLMs. It reduces token usage by 20-60% while maintaining 100% lossless round-trip fidelity.
Key features:
- Sections (
@section) - Organize related objects - Tabular Arrays (
key:[N]{fields}) - CSV-like format for uniform arrays - References (
$var) - Deduplicate repeated values - Pipe Delimiter (
|) - More token-efficient than commas
Learn more: ason-format.github.io/ason
📖 Documentation
- Changelog - Version history
- ASON Format - Core library
- Model Context Protocol - MCP specification
- Claude Desktop - Download Claude Desktop
📝 License
MIT © ASON Project Contributors
🤝 Contributing
Contributions welcome! Please open an issue or pull request.
🔗 Links
- NPM: https://www.npmjs.com/package/@ason-format/mcp-server
- GitHub: https://github.com/ason-format/mcp-server
- Issues: https://github.com/ason-format/mcp-server/issues
- ASON Core: https://github.com/ason-format/ason
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。