📡 MCP Radar

LucasPortinho/mcp-token-optimizer

MCP server to reduce input token costs when sending code to AI agents through syntax-aware code minification.

⭐ 5 stars
⑂ 0 forks
TypeScript
momentum ▲ 10.0
created 2026-10-07
on radar since 2026-10-12
star trend 4 → 5 since 2026-10-12
View on GitHub ↗

About mcp-token-optimizer

A high-performance Model Context Protocol (MCP) server and CLI tool engineered to drastically reduce token consumption when coding with AI assistants (Claude, Cursor, Gemini, Copilot, Windsurf).

It intercepts code sent to LLMs, compacts it to minimal tokens, enforces surgical SEARCH/REPLACE diffs, and validates Abstract Syntax Tree (AST) integrity alongside automated Prettier formatting.

- The Problem: Sending full, boilerplate-heavy, indented source files to LLMs rapidly exhausts context windows, degrades attention ("lost in the middle" phenomenon), and drives up API costs. - The Solution: mcp-token-optimizer minifies source code structurally before delivery to the model, reducing context consumption by 10% to 30%. When the AI replies with surgical edits, the server restores formatting via Prettier, verifies that the AST is intact (preventing syntax breakage), and snapshots changes with undo capability.

- Token Compaction (readfile): Strips non-essential indentation, blank lines, and whitespace while strictly safeguarding strings and syntax. - 🩺 Surgical Edits with AST Validation (applycodeedit): Applies diffs using REPLACE blocks. Automatically validates syntax via Tree-sitter and formats with Prettier before saving to disk. - Snapshot & History Manager: Keeps historical snapshots of files prior to edits with undo and roll-back capabilities. - Project Token Scanner (scanproject): Analyzes whole repositories and reports potential token savings and file-by-file optimization rates. - Real-time Session Analytics (getoptimizerstatus): Monitors read operations, edit count, t

From the project README.

Maintaining this server?

Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:

[![On MCP Radar](https://mcp.liqiwa.com/badge.svg)](https://mcp.liqiwa.com/s/LucasPortinho--mcp-token-optimizer.html)

Related MCP servers

XiaoDuoYa/codex-with-chatgpt

ChatGPT thinks. Codex works. Use ChatGPT as the planning brain while keeping the Codex harness.

⭐ 2301TypeScript
shinthink/blitzstrike

⚡ Blitz Strike — a universal MCP penetration-testing toolbelt. Structured methodology: reconnaissance & attack-surface mapping, source-to-sink analysis, and live validation. 57 escalation chains, 130-

⭐ 634TypeScript
0xwilliamortiz/openclaude-improved

runs anywhere. uses anything

⭐ 563TypeScript
halofyai/halofy

Halofy is the open access and governance layer for AI agents across your organization. Identity, policy, provenance, audit, and signed erasure.

⭐ 440TypeScript
CaptureGrubEnchant/SolidWorks

SolidWorks MCP Server connects an AI assistant to a running SolidWorks instance. Sketch, extrude, fillet, export STEP/STL, generate macros.

⭐ 385TypeScript
arielshad/3d-asset-server

3d assets api and mcp

⭐ 276TypeScript

📬 Get the weekly radar in your inbox

The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.