DEV Community

matt-dean-git
matt-dean-git

Posted on • Originally published at satgate.io

Beyond Connection: The Case for Economic Governance in MCP

Your AI agent just connected to 12 tools. Who's watching the bill?


The Model Context Protocol (MCP) is the most important thing happening in the agent ecosystem right now. Anthropic's open standard gives AI agents the ability to move beyond chat — connecting them to GitHub, Slack, databases, cloud APIs, and anything else with a JSON-RPC interface.

MCP turns chatbots into operators. That's the promise, and it's real.

But there's a problem nobody's talking about.

Every Tool Call Has a Price Tag

When an agent calls a tool, something happens on the other end. A database query runs. An API request fires. Tokens get consumed. Compute spins up.

Every one of those actions costs money.

The current MCP specification is excellent at answering two questions:

  1. Transport: How does the agent talk to the tool?
  2. Schema: What does the tool do and what parameters does it accept?

But it's silent on a third question that matters more than either of those in production:

How much can this agent spend, and what happens when it hits the limit?

There is no native mechanism in MCP to say: "This agent can use the Google Search tool, but stop it if it spends more than $2.00 this hour."

The $500 Hallucination

We all know agents hallucinate text. That's annoying but survivable.

In an MCP-enabled world, agents can hallucinate actions. A coding agent stuck in a loop doesn't just waste tokens — it fires real API calls, creates real cloud resources, runs real database queries. Each one costs real money.

Here's a scenario that's already happening in the wild:

  1. You give an agent access to a Cloud Resource Manager MCP tool
  2. You ask it to "optimize our staging environment"
  3. The agent tries an approach, it doesn't work, so it tries another
  4. And another. And another.
  5. 200 API calls later, you get a bill for $200

The agent wasn't malicious. It was doing exactly what you asked — trying to solve the problem. It just didn't have a budget.

The Missing Layer: Economic Policy

Consider what we already enforce at the infrastructure level for human users:

  • Authentication: Who are you?
  • Authorization: What can you access?
  • Rate limiting: How fast can you go?

For AI agents, we need a fourth layer:

  • Economic policy: How much can you spend?

This isn't rate limiting. Rate limits are blunt instruments — they cap requests per second regardless of cost. A single request to GPT-4 costs 100x more than a request to an embeddings API. You need cost-aware enforcement, not just velocity caps.

┌─────────┐         ┌──────────────────┐         ┌────────────┐
│  Agent   │────────▶│  Economic Proxy  │────────▶│ MCP Server │
│          │◀────────│  (SatGate)       │◀────────│  (Tools)   │
└─────────┘         └──────────────────┘         └────────────┘
                           │
                    ┌──────┴──────┐
                    │  Per-Tool   │
                    │  Cost       │
                    │  Attribution│
                    │  + Budget   │
                    │  Enforcement│
                    └─────────────┘
Enter fullscreen mode Exit fullscreen mode

SatGate is an economic proxy — it sits between the agent and the MCP server, intercepts every tool call, attributes its cost, and enforces budget policy in real time.

How It Works: Intercepting MCP at the Wire Level

MCP uses JSON-RPC 2.0 over stdio or HTTP. Every tool invocation is a tools/call method with the tool name in the params:

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "search_database",
    "arguments": {
      "query": "SELECT * FROM orders WHERE status = 'pending'"
    }
  },
  "id": 42
}
Enter fullscreen mode Exit fullscreen mode

SatGate's MCP middleware parses this at the proxy layer — no agent modification required. It extracts the method and tool name, matches them against cost profiles, and makes an enforce/allow decision before the request ever reaches the upstream:

# SatGate route config — per-tool cost profiles
routes:
  - name: mcp-tools
    match:
      pathPrefix: /v1/mcp
    policy:
      kind: fiat402
    mcp:
      costs:
        "search_database": 50      # 50 credits per call
        "create_resource": 500     # 500 credits — expensive!
        "read_file": 5             # cheap
        "execute_code": 200        # moderate
        "cloud_*": 300             # wildcard: any cloud tool
Enter fullscreen mode Exit fullscreen mode

The parser handles JSON-RPC batches, nested tool calls, and streaming responses. It runs at the proxy layer with 96% test coverage — this isn't a proof of concept.

Why API Keys Fail: "Hope-Based Governance"

Most teams try to control agent spend with traditional API keys. This is like giving a teenager your credit card and asking them to "be careful." Once the key is out, you have no way to limit what they buy or how fast they spend — until you manually revoke the key, usually after the damage is done.

SatGate replaces this hope-based governance with L402 and macaroons.

L402: The Economic Handshake

L402 (formerly LSAT) combines Lightning Network payments with macaroons. When an agent makes a request through SatGate:

  1. Challenge: SatGate intercepts the tool call and returns 402 Payment Required with a Lightning invoice and a macaroon
  2. Proof: The agent's wallet pays the invoice (microsatoshis — fractions of a cent) and receives a preimage — a cryptographic receipt
  3. Access: The agent retries with the preimage. SatGate verifies it cryptographically and unlocks the tool

No accounts. No signup. No OAuth dance. Just cryptographic proof that you paid for what you're about to use.

For enterprises not ready for Lightning, Fiat402 provides the same enforcement model using credit-based budgets — same hard caps, same delegation, familiar accounting.

Macaroons: The Smart Contract in Your Header

Unlike static API keys, macaroons support caveats — logic-based restrictions baked directly into the token:

  • "This token is only valid for the next 60 minutes"
  • "This token can only call the GitHub_PR_Review tool"
  • "This token is capped at a total spend of $5.00"

And the critical property: macaroons are self-verifying. Using HMAC chain verification, SatGate validates a token in microseconds without hitting a database.

A macaroon is a permission slip that can be narrowed but never widened:

Root Token (Acme Corp)
  └─ budget = 30000 credits
  └─ expires = 2027-02-11
  │
  ├─ Division Token (Acme Digital)
  │   └─ budget = 8000 credits  (narrowed from 30000)
  │   └─ routes = /v1/chat/*
  │
  └─ Division Token (Acme Creative)
      └─ budget = 3500 credits
      │
      └─ Agent Token (Design Generator)
          └─ budget = 2500 credits
          └─ routes = /v1/images/*
Enter fullscreen mode Exit fullscreen mode

When an agent hits its budget ceiling, SatGate returns a 402 Payment Required. The agent stops. Gracefully. No runaway spend.

The Three Modes: Observe → Control → Charge

👁 Observe (Free) — Deploy as a transparent proxy. See what your agents are doing and spending. This is your "holy shit" moment when you see the actual numbers.

🎛 Control ($99/mo) — Turn on budget enforcement. Hard caps, per-tool cost attribution, cascade delegation.

💲 Charge (Custom) — Monetize your APIs with L402 micropayments over Lightning. Your MCP tools become revenue generators, not cost centers.

Most teams start with Observe. They come for visibility. They stay for control.

Get Started

The MCP parser and proxy middleware are open source.

# Install the CLI
clawhub install satgate

# Or via Claude Code
claude plugin marketplace add SatGate-io/satgate-cli

# Check your agent spend
satgate tokens
satgate spend
Enter fullscreen mode Exit fullscreen mode

Sign up for the cloud beta or become a design partner.

Don't wait for the bill to learn how your agents behave.


SatGate is an economic firewall for AI agent traffic. Learn more at satgate.io.

Top comments (0)