Skip to content

brainsparker/frugal

frugal

Tool calls are the new tokens.

For most agentic workloads the tool bill exceeds the model bill. Frugal is an MCP server that routes every tool call your agent makes to the cheapest provider that returns a result — free / local first, paid only as fallback, premium only when you opt in.

Works with any model. One signed Go binary. Your keys. No account. Source-available (BUSL 1.1 → Apache 2.0).

frugal.sh

Install

curl -fsSL https://frugal.sh/install | bash
frugal mcp install

The first command drops the binary in your $PATH. The second auto-detects Claude Desktop, Cursor, and Claude Code and merges frugal into each configured MCP server list.

Try it now (no keys)

Search and extract work out of the box — Marginalia (free, public web index) and go-readability (free, pure-Go local extractor) ship enabled with zero configuration. Restart your agent and ask it something:

> recent AI news?
  frugal__search → marginalia (free, no key)
  gpt-4.1-nano synthesizes · $0.0006
done. total: $0.0006 — zero search cost.

Tool call: free. The rack-rate gap is the gap you keep.

Set your keys (optional)

Add keys to unlock cheaper paid providers. Frugal reads them from your environment and only registers tools whose providers are configured:

# Search — frugal__search
export SEARXNG_URL=...           # free, self-hosted (also Marginalia free, no key)
export SERPER_API_KEY=...        # cheap paid
export YDC_API_KEY=...           # premium paid (You.com)

# Extract — frugal__extract (goreadability is free, no key)
export FIRECRAWL_API_KEY=...     # premium paid (JS-rendered pages)

# Browse — frugal__browse
export BROWSERLESS_TOKEN=...     # headless render

That's it. Restart your agent. frugal__search, frugal__extract, and frugal__browse show up in the tool picker (only the tools whose providers are configured get registered).

The rack-rate gap

Tool prices haven't fallen the way model prices have. You.com at $0.005/call is 5× Serper at $0.001/call. SearXNG, running on your own machine, is free.

Capability Free / local Cheap paid Premium paid Status
Search SearXNG · Marginalia Serper $0.001/call You.com $0.005/call shipping
Extract go-readability (local) Firecrawl $0.001/page shipping
Browse local Playwright (deferred) Browserless $0.002/render Browserbase partial
Code exec local Docker E2B ~$0.10/hr (2 vCPU) Modal planned
Embeddings nomic-embed-text, bge-large text-embedding-3-small $0.02/1M tok 3-large, Voyage-3, Cohere planned
Transcription whisper.cpp Deepgram Nova $0.0043/min OpenAI Whisper $0.006/min planned

Frugal walks the columns left to right. Each tool call goes to the leftmost configured provider that returns a result; you keep the gap.

What ships today

One MCP server, three tools, seven providers:

  • frugal__searchshipping. Routed across SearXNG (free, self-hosted), Marginalia (free, public), Serper ($0.001/call), and You.com ($0.005/call).
  • frugal__extractshipping. Routed across go-readability (free, pure-Go local Readability) and Firecrawl (~$0.001/page, JS-rendered).
  • frugal__browsepartial. Browserless (~$0.002/render, headless Chrome) shipping; local Playwright deferred.
  • Stdio + Streamable HTTP transports.
  • HTTP transport supports bearer-token auth (FRUGAL_AUTH_TOKEN), per-IP rate limiting, and a /metrics endpoint (Prometheus text: frugal_calls_total{tool=,provider=} etc.).
  • frugal mcp install writes the right config into Claude Desktop, Cursor, and Claude Code.

What's coming

  • Phase 3 — embeddings, transcription, code execution, local chat models, semantic cache.
  • Phase 4 — Frugal Cloud: hosted MCP endpoint for users who don't want to operate the local stack themselves.

From source

git clone https://github.com/brainsparker/frugal.git && cd frugal && make build

License

BUSL 1.1 — self-hosting and internal commercial use are permitted. Each release converts to Apache 2.0 four years after publication. Plain-English summary in LICENSE-BUSL-FAQ.md.

Security

Private vulnerability reports via GitHub Security Advisories. Full policy in SECURITY.md.

About

Cost-optimized MCP server and proxy router for Claude, Cursor, and any agent. Picks the cheapest model + toolchain per use case. Drop-in, Go binary, BUSL-1.1.

Topics

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-BUSL-FAQ.md

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages