The result? You're burning tokens on tool definitions you'll never use in that session.
Enter LeanProxy: Your Token Firewall
LeanProxy sits between your IDE and MCP servers as a smart gateway. It loads tool schemas only when needed β reducing 18,500 tokens to ~110.
flowchart LR
IDE["Your IDE"] --> Gateway["LeanProxy Gateway"]
subgraph Gateway["LeanProxy Gateway"]
Router["Router: invoke_tool + list_tools (~110 tokens)"]
JIT["JIT Schema Loading"]
Cache["Automatic Caching"]
Firewall["Token Firewall"]
Pool["Connection Pooling"]
end
Gateway -.->|"loads on demand"| GH["GitHub"]
Gateway -.->|"loads on demand"| Garmin["Garmin"]
Gateway -.->|"loads on demand"| Intervals["Intervals.icu"]
Gateway -.->|"loads on demand"| Stitch["Stitch"]
Router --> Firewall --> Pool --> GH
Router --> Firewall --> Pool --> Garmin
Router --> Firewall --> Pool --> Intervals
Router --> Firewall --> Pool --> Stitch
Router --> JIT
JIT --> Cache
style Gateway fill:#1a1a2e,color:#fff
style Router fill:#00ADD8,color:#fff
style JIT fill:#00ADD8,color:#fff
style Cache fill:#00ADD8,color:#fff
style Firewall fill:#00ADD8,color:#fff
style Pool fill:#00ADD8,color:#fff
Real Results, Real Savings
90%+ Token Reduction in Production Sessions
Session Type
Native MCP
LeanProxy
Savings
Morning Sport (2 servers, 4 prompts)
~21,000
~2,000
90%
Dev Workflow (2 servers, 5 prompts)
~10,600
~2,400
77%
Full Day (4 servers, 7 prompts)
~49,600
~3,500
93%
The Math Doesn't Lie
Native MCP + 100% cache hit still costs you at 0.25x (cache read isn't free!):
Configuration
Native MCP (cached)
LeanProxy
You Save
1 server (41 tools)
1,025 tokens
27 tokens
97.3%
2 servers (53 tools)
1,325 tokens
27 tokens
97.9%
4 servers (163 tools)
4,075 tokens
27 tokens
99.3%
Key Features
Feature
Benefit
π‘οΈ Token Firewall
Redacts secrets, API keys, and PII before they reach LLM providers
β‘ JIT Schema Loading
Tool schemas load only when actually called β not on every request
π Connection Pooling
HTTP MCP clients reuse connections with circuit breakers
π¦ Multi-Transport
Supports stdio, HTTP, and SSE transport protocols
π₯ Multi-Team Namespaces
Hierarchical organization for enterprise teams
π° Cost Attribution
Track token savings per server with detailed reports
π§ͺ Dry-Run Mode
Simulate and preview savings without live execution
π§ Shadow Manifesting
Merges global and project-local MCP configurations
Quick Start
One-Line Install
# macOS/Linux via Homebrew
brew tap mmornati/leanproxy-mcp https://github.com/mmornati/leanproxy-mcp
brew install leanproxy-mcp
# ...or download binary for your platform
curl -fsSL https://github.com/mmornati/leanproxy-mcp/releases/latest/download/leanproxy-mcp.tar.gz | tar xz
Configure Your IDE
Add LeanProxy as an MCP server in your opencode.json:
# Start with your MCP servers
leanproxy-mcp server run --stdio
# Preview savings without executing
leanproxy-mcp server run --dry-run --stdio
# Generate a detailed savings report
leanproxy-mcp report --output report.md
Architecture
flowchart TB
subgraph IDE["Your IDE"]
Client[(MCP Client)]
end
subgraph Gateway["LeanProxy Gateway"]
Router["Router<br/>(~110 tokens)"]
JIT["JIT Schema Cache"]
Firewall["Token Firewall<br/>(Secret Redaction)"]
Pool["Connection Pool<br/>& Circuit Breaker"]
Federation["Federation<br/>(Multi-org)"]
end
subgraph Servers["MCP Servers"]
GH["GitHub<br/>(stdio)"]
Garmin["Garmin<br/>(HTTP)"]
Intervals["Intervals.icu<br/>(SSE)"]
Stitch["Stitch<br/>(HTTP)"]
end
Client <--> Router
Router <--> JIT
Router <--> Firewall
Firewall <--> Pool
Pool <--> Federation
Pool --- GH
Pool --- Garmin
Pool --- Intervals
Pool --- Stitch
JIT -.->|"loads on call"| GH
JIT -.->|"loads on call"| Garmin
JIT -.->|"loads on call"| Intervals
JIT -.->|"loads on call"| Stitch
style Gateway fill:#1a1a2e,color:#fff
style Router fill:#00ADD8,color:#fff
style JIT fill:#00ADD8,color:#fff
style Firewall fill:#00ADD8,color:#fff
style Pool fill:#00ADD8,color:#fff
style Federation fill:#00ADD8,color:#fff
v0.7.0: What's New
Feature
Description
π OAuth2 Authentication
Built-in support for HTTP MCP servers with OAuth2
π Streamable HTTP
Full Streamable HTTP transport implementation for MCP
π₯ Hierarchical Namespaces
Multi-team organization with namespace assignment
β‘ Connection Pooling
HTTP clients with connection reuse and rate limiting