Skip to main content
Glama

CostGate

Gate your MCP. Cut your bill.

CostGate reduces AI token consumption by optimizing MCP tool definitions and responses. Cursor-first, compatible with Claude Desktop and other MCP clients.

Repository layout (monorepo)

costgate/
├── packages/
│   ├── schema/     @costgate/schema   — shared log schema
│   ├── probe/      @costgate/probe    — measurement MCP (npm)
│   └── gate/       costgate-gate      — gateway MCP (Go binary)
├── docs/
├── examples/
└── scripts/

See docs/structure.md for why Probe and Gate share one repo.

Related MCP server: PlanckBot

Packages

Package

Dist

Description

@costgate/probe

npm

Measurement MCP — baseline token usage, call stats, JSONL logs

costgate-gate

binary

Gateway MCP — filtered tool exposure, delegation, cost reduction

@costgate/schema

workspace

Shared JSON Schema for logs

Quick start (Probe)

npm install
npm run build:probe

Add to Cursor ~/.cursor/mcp.json:

{
  "mcpServers": {
    "costgate-probe": {
      "command": "node",
      "args": ["/path/to/costgate/packages/probe/dist/index.js"],
      "env": {
        "COSTGATE_PROBE_LOG_DIR": "~/.costgate/logs"
      }
    }
  }
}

Or after npm publish: npx @costgate/probe

See examples/cursor/ for full configuration.

Quick start (Gate)

Requires Go 1.25+.

npm run build:gate
npm run test:gate   # smoke test (GitHub backend via ~/.costgate/backends.json)

Add to Cursor ~/.cursor/mcp.json (keep serena direct; see mcp-gate-github.json):

{
  "mcpServers": {
    "costgate-gate": {
      "command": "/path/to/costgate/packages/gate/bin/costgate-gate",
      "env": {
        "COSTGATE_CONFIG": "~/.costgate/backends.json"
      }
    }
  }
}

Filter mode (default): Tier A/B/C + discover_tools / invoke_tool. Set COSTGATE_GATE_MODE=transparent for pass-through baseline. See packages/gate/README.md.

Compare reduction: npm run compare (Before/After tools/list token estimate).

Production Cursor setup: npm run cursor:production — see examples/cursor/README.md.

Plans (roadmap)

Plan

Scope

Free (OSS)

Probe + Gate core

Pro

Automated cloud reports (costgate-cloud)

Team / Enterprise

Team dashboard, policies, custom proposals, support

Documentation

License

MIT — see LICENSE

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/YukiMiyatake/costgate'

If you have feedback or need assistance with the MCP directory API, please join our Discord server