Cut AI Costs
Up to 70%
TokenForge compresses your prompts without losing meaning. Run entirely on your machine, integrate with Claude Desktop and MCP workflows, and never send data to a third party.
AI Costs Are Out of Control
Every bloated prompt burns money. Teams waste thousands monthly on tokens that carry no real information.
Fully Local
Nothing leaves your machine. No telemetry, no cloud processing, no data sharing.
Instant Results
Optimize any prompt in under a second. Works with any LLM or API.
Semantic Preservation
Our semantic engine ensures meaning is preserved while cutting filler tokens.
Works With Every Tool You Already Use
TokenForge integrates natively with Claude Desktop via MCP, and connects to any AI client through its REST API.
Claude Desktop
Native MCPUse TokenForge as an MCP server inside Claude Desktop. Optimize prompts directly from your chat window.
ChatGPT / OpenAI
APIRoute your GPT-4o and o3 calls through TokenForge to cut token spend before hitting OpenAI APIs.
Cursor
MCPInstall the MCP extension and optimize AI context sent to Cursor's code assistant automatically.
VS Code Copilot
ExtensionCompress prompts before they reach GitHub Copilot. Works with any VS Code AI extension.
Ollama
Local LLMBuilt-in Ollama adapter. TokenForge ships with gemma4:latest by default for zero-cloud optimization.
Any REST API
UniversalExpose TokenForge as a local REST proxy. Drop it in front of any LLM API with two lines of config.
Optimize Prompts Inside Claude Desktop
TokenForge ships as a native MCP server. Add one config block to Claude Desktop and get a optimize_prompt tool available in every conversation.
- ✓Run optimization without leaving Claude Desktop
- ✓See token count + cost estimate inline
- ✓Supports all 3 modes: Safe, Balanced, Aggressive
- ✓Works offline — no external API calls
claude_desktop_config.json
{
"mcpServers": {
"tokenforge": {
"command": "python",
"args": ["-m", "tokenforge.mcp_server"],
"cwd": "/path/to/tokenforge"
}
}
}~/Library/Application Support/Claude/claude_desktop_config.json(macOS)MCP Workflows
TokenForge exposes 3 MCP tools. Chain them with any MCP-compatible client to build powerful cost-saving pipelines.
optimize_promptCompress any prompt with configurable mode (safe/balanced/aggressive).
{ prompt, mode?, target_model? }optimized_text, token_savings, cost_estimateanalyze_tokensCount tokens and estimate API cost for a given prompt and model.
{ prompt, model? }token_count, estimated_cost, breakdownbatch_optimizeOptimize an array of prompts in one call. Returns savings summary.
{ prompts[], mode? }results[], total_savings_pctCommon Workflows
Claude + TokenForge in Action
Actual screenshots from a live setup. Four steps from install to first optimization.
Claude.ai — Enable Connector
Add TokenForge as a connector in Claude.ai web app. It appears instantly in the Connectors list.
Claude Desktop — MCP Running
TokenForge MCP server shows "running" in Claude Desktop settings. One-time setup via Edit Config.
Claude.ai — Tools Active
All 4 TokenForge tools available in Claude.ai conversations. Real cost data, real savings.
TokenForge Dashboard
Full local dashboard at localhost:3001. Paste a prompt, pick a mode, get instant optimization with token savings.
Get Running in Minutes
No account, no API key, no cloud. Just clone and run.
1. Install prerequisites (first time only)
Skip any you already have installed.
1b. Install Python 3.11+
⚠️ On the installer screen, tick "Add Python to PATH" before clicking Install.
1c. Install Ollama (local AI engine)
Run the installer — Ollama starts automatically in the system tray.
2. Open Command Prompt as Administrator
Press Windows key → type "cmd" → Right-click "Command Prompt" → "Run as administrator"
3. Clone TokenForge to your machine
git clone https://github.com/nitiemahendra/aitokenforge.git C:\TokenForgeChange C:\TokenForge to any folder you prefer.
4. Navigate into the project folder
cd C:\TokenForge5. Install all Python dependencies
pip install -e ".[dev]"Installs FastAPI, the token counter, AI libraries — takes ~2 min on first run.
6. Download the AI model (one-time, ~5 GB)
ollama pull gemma4:latestRequires ~5 GB of free disk space. Only needed once.
7. Start the backend server
python -m uvicorn backend.main:app --port 8000Keep this window open while using TokenForge. Ready when you see "Application startup complete."
8. Open the dashboard
Open this URL in your browser — the TokenForge UI will load.
🔧 Common issues
- "pip is not recognized" — Python was installed without ticking "Add to PATH". Re-install Python and tick that checkbox.
- "ollama: command not found" — Restart your terminal after installing Ollama.
- Port 8000 already in use — Run
python -m uvicorn backend.main:app --port 8001and openlocalhost:8001instead. - Model download stuck — Make sure Ollama is running (check the system tray icon on Windows).
Python 3.11+
Required
Ollama
For local LLM
Claude Desktop
Optional, for MCP