Local-first · Privacy-preserving · Free & Open Source

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.

0
Input tokens
0
After optimize
0%
Tokens saved

AI Costs Are Out of Control

Every bloated prompt burns money. Teams waste thousands monthly on tokens that carry no real information.

System prompt$2,400/mo
2,400 tokens
Optimized$860/mo
860 tokens
64% saved — $1,540/mo back in your pocket
🔒

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.

🟣 Claude Desktop Integration

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"
    }
  }
}
Config path: ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)
Model Context Protocol

MCP Workflows

TokenForge exposes 3 MCP tools. Chain them with any MCP-compatible client to build powerful cost-saving pipelines.

optimize_prompt

Compress any prompt with configurable mode (safe/balanced/aggressive).

Params{ prompt, mode?, target_model? }
Returnsoptimized_text, token_savings, cost_estimate
analyze_tokens

Count tokens and estimate API cost for a given prompt and model.

Params{ prompt, model? }
Returnstoken_count, estimated_cost, breakdown
batch_optimize

Optimize an array of prompts in one call. Returns savings summary.

Params{ prompts[], mode? }
Returnsresults[], total_savings_pct

Common Workflows

Real Setup · Working Integration

Claude + TokenForge in Action

Actual screenshots from a live setup. Four steps from install to first optimization.

Step 1
📎Add files or photos
📁Add to project
⚙️Add from GitHub
Skills
Connectors
🔌Plugins
🔬Research
🌐Web search
✏️Use style
C
Claude in Chrome
T
tokenforge
Manage connectors
+ Add connector
🔍
Tool access
Load tools when needed

Claude.ai — Enable Connector

Add TokenForge as a connector in Claude.ai web app. It appears instantly in the Connectors list.

Step 2
General
Account
Privacy
Billing
Usage
Capabilities
Connectors
Claude Code
Cowork
Claude in Chrome
Desktop app
General
Extensions
Developer
Local MCP servers
Add and manage MCP servers that you're working on.
tokenforge
tokenforgerunning
Command
C:\Mahendra\TokenOptimizer\.venv\Scripts\python.exe
Arguments
-m mcp_server.server

Claude Desktop — MCP Running

TokenForge MCP server shows "running" in Claude Desktop settings. One-time setup via Edit Config.

Step 3
Usingtokenforge
analyze_tokensInstant token count + cost estimate without an LLM call. Great for checking costs before you scale.
optimize_promptCompresses prompts to cut tokens. Three modes: safe · balanced · aggressive.
compare_modelsSame prompt, ranked by cost across every major model. Llama 4 vs Claude Opus: 50× cost difference.
get_pricingFull pricing directory across all providers — input/output rates + context windows.
👍👎2/2

Claude.ai — Tools Active

All 4 TokenForge tools available in Claude.ai conversations. Real cost data, real savings.

Step 4
TokenForgeAI Cost Optimization
Healthy·ollama ●·all-MiniLM-L6-v2·v1.0.0↺ Refresh↺ Restart
Optimization Mode
🛡
Safe
Balanced
Aggressive
Target Model
GPT-5
Constraints
Keep formatting
Keep constraints
Your Prompt
Paste a prompt to compress…
· Verbose system prompts
· Multi-step instructions
· RAG context + questions
· Repeated boilerplate
✦ Optimize Ctrl+Enter
Optimized Prompt
Your compressed prompt will appear here.
Tokens · cost · semantic score included.

TokenForge Dashboard

Full local dashboard at localhost:3001. Paste a prompt, pick a mode, get instant optimization with token savings.

1Enable Connector
2MCP Running
3Tools Active
4Start Optimizing
Installation Guide

Get Running in Minutes

No account, no API key, no cloud. Just clone and run.

Windows — terminal

1. Install prerequisites (first time only)

Skip any you already have installed.

1a. Install Git

Accept all defaults during install.

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:\TokenForge

Change C:\TokenForge to any folder you prefer.

4. Navigate into the project folder

$cd C:\TokenForge

5. 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:latest

Requires ~5 GB of free disk space. Only needed once.

7. Start the backend server

$python -m uvicorn backend.main:app --port 8000

Keep this window open while using TokenForge. Ready when you see "Application startup complete."

8. Open the dashboard

🌐http://localhost:8000Open in browser

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 8001 and open localhost:8001 instead.
  • 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