Cost-optimized MCP server: routes every tool call to the cheapest provider that returns a result.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
The open routing layer for AI tools.
Frugal is an MCP server that sits between your agent and its tool
providers. You describe the job β a search, an extraction, a render, or
just an intent β and Frugal decides how to complete it, routing each call
per policy: cheapest capable provider by default, fastest or premium when
you say so, pinned or denied when compliance says so, with automatic
failover when a provider errors or comes up empty. Every response carries
the decision β provider_used, cost_usd, and (via frugal__execute) a
one-line reason β so you can audit why each call went where it did.
Works with any model. One Go binary. Your keys. No account. Self-host everything, no lock-in. Source-available (BUSL 1.1 β Apache 2.0).
Install to first intelligently routed tool call: under five minutes.
The first command drops the binary in your $PATH. The second auto-detects
Claude Desktop, Cursor, AnythingLLM, and Claude Code and merges frugal
into each configured MCP server list.
frugal mcp install finds AnythingLLM Desktop on its own and merges
frugal into <storage>/plugins/anythingllm_mcp_servers.json. For a
self-hosted or Docker AnythingLLM, point the installer at that instance's
storage directory (the same path its own STORAGE_DIR uses):
Restart AnythingLLM, then look for frugal under Agent Skills β MCP
Servers. The tools load for agent sessions, so call them from an @agent
chat. In Docker, the command path must resolve inside the container β
mount the frugal binary in, or run frugal mcp serve --http on the host
and register it as a streamable server instead.
Search and extract work out of the box: Marginalia (free index of the
indie / non-commercial web), Wikipedia (free Wikimedia REST search),
and go-readability (free, pure-Go local extractor) ship enabled with
zero configuration. This is the default cheap policy at work β free and
local rungs first, failover when a provider comes up empty. Captured from
a live zero-key run:
Honest limits: Marginalia is genuinely good for essays, docs, blogs, and
niche technical writing, and weak on mainstream news and product pages;
Wikipedia covers entities and reference topics. Zero-key mode is a real
workflow for research and local extraction β it is not a Google-grade
SERP. One env var changes that: SEARXNG_URL (free, self-hosted) or
SERPER_API_KEY ($0.001/call) gives the chain a stronger rung to fall to.
Declare per capability how the provider chain is ordered, in
~/.frugal/config/models.yaml:
Every call chain logs which policy ran, and frugal__execute returns it
in the response.
Two guardrails cap what a provider can cost you, enforced in the routing layer alongside the policy above:
routing:) β when a provider returns a
rate limit (HTTP 429), it is fenced off for this long so the chain
stops hammering it. A Go duration string like 90s or 2m; an invalid
value warns at startup and falls back to the 60s default. Applies to
every provider, capped or not.When a guardrail skips a provider it is noted in the routing trace
(; budget: skipped youcom (...)) and logged at Warn. If every provider
in a chain is over budget or cooling down, the call fails with a clear
message rather than silently doing nothing.
frugal__executeInstead of picking a tool, an agent can state the intent and a priority. Frugal classifies it onto a capability (URL and keyword cues β deterministic, no model call) and routes under your policy. Captured from a live zero-key run:
priority: "cheap" | "balanced" | "premium" maps onto the policies above
(balanced defers to your configured strategy). A URL intent runs an
extract and falls forward to a headless render when the page needs JS,
with the costs summed. The reason field is the receipt: what was
decided, under which policy, and which provider won on which attempt.
The direct tools (frugal__search, frugal__extract, frugal__browse)
remain for callers that already know the capability.
Cost is Frugal's flagship policy, and the receipt is its proof. Every
call lands in a local ledger (~/.frugal/usage, JSONL, never leaves
your machine; FRUGAL_STATS=off disables it). frugal stats prints the
month's receipt:
Only the call that actually produced your result earns rack credit β fallback attempts and zero-hit whiffs don't inflate the number.
Add keys to unlock stronger paid providers. Frugal reads them from your environment and only registers tools whose providers are configured:
That's it. Restart your agent. Only the tools whose providers are configured get registered.
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 Β· Wikipedia | 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 (planned) | 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 |
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/frugal)<a href="https://allmcps.com/mcp/frugal"><img src="https://allmcps.com/api/badge/frugal?style=directory" alt="Frugal on AllMCPs" /></a>