Skip to main content
Glama
iqingyoung

429-throttle-mcp

by iqingyoung

429-throttle-mcp

English | 中文

No more API 429 rejections — a rate-limited MCP proxy that lets models automatically control their call pace in long-running tasks.


What it is

Many free LLM APIs (Grok, Gemini, Dots, etc.) only allow about 30 calls per minute. When models work on long-running tasks (searching + generating PPTs, batch tool calls), they can easily exceed the quota and get rejected with 429.

429-throttle-mcp provides a transparent rate-limiting layer for this pain point:

模型 → call_api 工具 → 限流器 → 实际 API 请求 → 返回结果 + 用量快照

The model doesn't need to know rate limits exist; it just calls call_api normally. The rate-limiting logic runs transparently inside MCP — if quota is available, the call goes through; if not, the model is told how long to wait before retrying.


Related MCP server: mcp-doorman

Package structure

Monorepo containing two independent npm packages that share the core rate-limiting logic:

429-throttle-mcp/
├── packages/
│   ├── rate-limiter.js              # 核心限流逻辑(共享)
│   ├── 429-throttle-mcp/            # MCP Server 包
│   │   ├── package.json
│   │   ├── server.js
│   │   └── README.md
│   └── dsh-throttle/                # DSH Plugin 包
│       ├── package.json
│       ├── plugin.js
│       └── README.md
├── dsh-manifest.json
├── README.md
└── .env.example

Package

Install

Purpose

429-throttle-mcp

npm i 429-throttle-mcp

MCP Server (MCP clients like ZCode)

dsh-throttle

npm i dsh-throttle

DeepSeek Harness Plugin


Core parameters

Parameter

Default

Description

MAX_CALLS

30

Max calls per minute (RPM)

MAX_TOKENS

750000

Max tokens per minute (TPM), including request and response bodies


Exposed tools

call_api

Sends HTTP requests through the rate-limiting proxy. All external API calls must go through this tool.

Parameter

Type

Required

Description

url

string

Full URL of the target API

method

string

HTTP method, defaults to GET

body

string

Request body, JSON string

headers

string

Custom request headers, JSON string

Returns: API response + _meta.rateLimit usage snapshot. If rejected by rate limiting, returns a RATE_LIMIT_EXCEEDED error with a suggested retryAfterSeconds wait time.

get_rate_limit_status

Queries current rate limit usage. Returns used/remaining call counts and token counts, plus recommendations. Does not include queue counters, to avoid user anxiety.

set_rate_limit

Dynamically adjusts rate limit parameters (like adjusting a slider, takes effect in real time without restart).

Parameter

Type

Description

callsPerMinute

number

Max calls per minute (RPM)

tokensPerMinute

number

Max tokens per minute (TPM)


Installation

MCP clients (e.g., ZCode)

npm install 429-throttle-mcp

Add to the MCP configuration:

{
  "mcpServers": {
    "429-throttle-mcp": {
      "command": "node",
      "args": ["node_modules/429-throttle-mcp/server.js"],
      "env": {
        "MAX_CALLS": "30",
        "MAX_TOKENS": "750000"
      }
    }
  }
}

DeepSeek Harness

npm install dsh-throttle

Add to the DSH configuration:

{
  "plugins": {
    "dsh-throttle": {
      "maxCalls": 30,
      "maxTokens": 750000
    }
  }
}

Workflow example

When a model works on a brand PPT search task:

  1. Call get_rate_limit_status → confirm sufficient quota

  2. Call call_api → search brand keywords

  3. If rejected → wait retryAfterSeconds then retry

  4. Repeat steps 2-3 until all information is collected

  5. Call set_rate_limit → tighten rate limit parameters for the generation phase


Rate limiting algorithm

Sliding Window + Token Bucket: maintains a 60-second sliding window, recording the timestamp and token consumption of each call. Old records outside the window are automatically cleaned up. When the limit is exceeded, the remaining wait time is calculated from the earliest record.

Concurrency safety: tryConsume() is a synchronous function, naturally serialized in Node.js's single-threaded event loop, so no race conditions occur.


Why use this instead of writing "call slower" in the prompt?

Approach

Effect

Writing "call once every 2 seconds" in the prompt

❌ The model has no stopwatch, won't comply, and will still get 429 when it bursts

External script rate limiting

❌ Requires an extra process, the model is unaware, hard to debug when errors occur

MCP rate-limiting proxy (this project)

✅ Transparent to the model, transparent gatekeeping, structured errors + wait suggestions


Application scenario Keyword

429报错, anti 429, MCP限流, 大模型每分钟调用限制, 免费大模型速率限制, Agent批量调用触发429, MCP排队调用, RPM, TPM, rate limiter mcp, quota guard, mcp server, mcp proxy, throttle, llm api quota, cop, HTTP 429, Too Many Requests, rate limiting, token bucket, sliding window, API proxy, LLM rate limit, AI API throttle, concurrent rate limit, 30 calls per minute


License

MIT

F
license - not found
Not graded
quality - not tested
B
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.

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Security gateway that wraps any MCP server with per-tool policies, approval gates, and optional Ed25519-signed decision receipts. Shadow mode logs every tool call without blocking; enforce mode applies block, rate-limit, and minimum-tier rules. Receipts are independently verifiable offline with no accounts needed.
    5
    469
    9
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A drop-in proxy that guards MCP servers with policy enforcement, secret redaction, prompt-injection screening, rug-pull detection, rate limiting, and audit logging.
    12
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    A least-privilege enforcement proxy for MCP servers. It sits between MCP clients and upstream servers, enforcing tool policies, hiding denied tools, requiring human approval for risky actions, and providing a structured audit trail.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A zero-infrastructure, local proxy that wraps any stdio MCP server to add audit logging, policy enforcement with regex guards, and per-session/per-day budgets.
    MIT

View all related MCP servers

Related MCP Connectors

  • Fleet-wide shared rate limiter for A2A + multi-MCP deployments. Most MCP servers rate-limit inde...

  • Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.

  • Billing proxy for MCP servers. Adds Stripe and x402 crypto payments without writing billing code.

View all MCP Connectors

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/iqingyoung/429-throttle-mcp'

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