Skip to content

Budget-enforced MCP proxy — hard-cap your AI agent tool spend. Zero dependencies.

License

Notifications You must be signed in to change notification settings

SatGate-io/satgate-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

satgate-proxy

Budget-enforced MCP proxy — hard-cap your AI agent tool spend.

MCP servers are an open tap. Every tools/call costs money and there's no built-in spending limit. satgate-proxy sits between your MCP client (Claude Desktop, Cursor) and the server, enforcing a hard budget cap.

Zero dependencies. Node.js built-ins only. npx and go.

Quick Start — Local Mode (New in v0.3.0)

No server, no API key, no account. Budget enforced in-process:

npx satgate-proxy --local --budget 5.00 \
  --server @modelcontextprotocol/server-google-search

Or with a config file:

# satgate.yaml
server: @modelcontextprotocol/server-google-search
budget: 5.00

mcp_pricing:
  web_search: 5
  dalle_generate: 50
  '*': 1
npx satgate-proxy --local --config satgate.yaml

Claude Desktop config (local mode):

{
  "mcpServers": {
    "google-search": {
      "command": "npx",
      "args": [
        "satgate-proxy",
        "--local", "--budget", "5.00",
        "--server", "@modelcontextprotocol/server-google-search"
      ]
    }
  }
}

No env vars needed. No accounts. Just a budget cap.

SaaS Mode (Teams & Enterprise)

For server-side enforcement with L402 macaroons:

{
  "mcpServers": {
    "google-search": {
      "command": "npx",
      "args": [
        "satgate-proxy",
        "--cap", "5.00",
        "--server", "@modelcontextprotocol/server-google-search"
      ],
      "env": {
        "SATGATE_API_KEY": "your_macaroon_here"
      }
    }
  }
}

Get your API key at cloud.satgate.io.

How It Works

Local Mode

┌──────────────┐     stdio      ┌────────────────┐     stdio      ┌──────────────┐
│ Claude       │ ──── JSON-RPC ──▶ satgate-proxy  │ ──── JSON-RPC ──▶ MCP Server  │
│ Desktop      │ ◀── JSON-RPC ── │ (budget gate)  │ ◀── JSON-RPC ── │ (child proc) │
│ / Cursor     │                 └────────────────┘                 └──────────────┘
└──────────────┘                  ↑ intercepts tools/call
                                  ↑ deducts from budget
                                  ↑ blocks when exhausted

The proxy spawns your MCP server as a child process, intercepts every tools/call, deducts from your budget based on per-tool pricing, and blocks calls when the budget is exhausted.

SaaS Mode

┌──────────────┐     stdio      ┌────────────────┐     SSE/HTTP     ┌──────────────┐
│ Claude       │ ──── JSON-RPC ──▶ satgate-proxy  │ ──── JSON-RPC ──▶ SatGate      │
│ Desktop      │ ◀── JSON-RPC ── │ (this package) │ ◀── JSON-RPC ── │ MCP Proxy    │
│ / Cursor     │                 └────────────────┘                  │ + Budget     │
└──────────────┘                                                     │ Enforcement  │
                                                                     └──────┬───────┘
                                                                            │
                                                                     ┌──────▼───────┐
                                                                     │ MCP Server   │
                                                                     │ (hosted)     │
                                                                     └──────────────┘

Config File (satgate.yaml)

Instead of CLI flags, you can use a config file:

# satgate.yaml
server: @modelcontextprotocol/server-google-search
budget: 5.00

mcp_pricing:
  web_search: 5        # 5 cents per search
  dalle_generate: 50   # 50 cents per image
  '*': 1               # 1 cent default for unlisted tools

Pricing is in cents. The '*' wildcard sets the default cost for any tool not explicitly listed.

CLI Flags

Flag Description Default
--server <package> MCP server package to proxy (required)
--local Run in local mode (no SatGate server needed) off
--budget <amount> Budget cap in USD (local mode) unlimited
--config <path> Path to satgate.yaml config file
--cap <amount> Budget cap in USD (SaaS mode)
--endpoint <url> SatGate proxy endpoint https://satgate-mcp-saas.fly.dev
--key <macaroon> API key (or SATGATE_API_KEY env var)
--verbose Debug logging to stderr off
-h, --help Show help

Why?

MCP gives AI agents direct access to paid APIs — search, code execution, databases, you name it. There's no built-in spending limit. A runaway agent can burn through hundreds of dollars in minutes.

satgate-proxy adds a hard cap:

  • Local mode: Set --budget 5.00 → agent can spend at most $5, enforced in-process
  • SaaS mode: Set --cap 5.00 → enforced server-side with L402 macaroons
  • Zero dependencies — npx runs it instantly

Zero Dependencies

This package uses only Node.js built-ins (child_process, http, https, fs). No node_modules, no install step. npx satgate-proxy just works.

Links

License

MIT

About

Budget-enforced MCP proxy — hard-cap your AI agent tool spend. Zero dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published