
429 Throttle Mcp
io.github.iqingyoungPublished by GitHub account iqingyoungv1.2.0Updated Oct 27, 2026
带速率限制的 MCP HTTP 代理:滑动窗口+令牌桶控速,长程任务不再 429
Overview
A local MCP proxy that sends HTTP API calls through a sliding-window and token-bucket rate limiter so long agent tasks avoid 429 rejections.
- What you can do
- Send HTTP requests through a rate-limited proxy, with method, body and headers, and get the response plus a usage snapshot
- Check current rate-limit usage: calls and tokens used and remaining, rejected calls, total and average latency
- Adjust calls-per-minute and tokens-per-minute limits live without restarting
- Open and close a task interval to get a report of wall-clock time, call count, tokens, rejections and the round where the limit would be hit
- When to use it
- Useful when an assistant makes many external API calls in long tasks against free or low-tier model APIs with per-minute quotas, and you want throttling enforced by the server rather than by prompt instructions.
- Requirements
- Runs as a local Node.js process installed from npm and configured as a stdio server. Optional environment variables MAX_CALLS (default 30 per minute) and MAX_TOKENS (default 750000 per minute) set the starting limits; no accounts or API keys are declared. Network access to the target APIs is required.
Installation
In SourceWeft
- Open 429 Throttle Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
429-throttle-mcp
[Downloads] [MCP] [DSH Market]
English | 中文
不再被 API 429 拒绝 — 自带限流的 MCP 代理 + Agent 操作员技能。模型在长程任务中自动控速;非技术用户一句话完成「打开 / 调参 / 关闭 / 诊断 / 复盘」。
是什么
很多免费大模型 API(Grok、Gemini、Dots 等)每分钟只能调用 30 次左右。模型在做长程任务(搜索 + 生成 PPT、批量调用工具)时,很容易超出限额被 429 拒绝。
429-throttle-mcp 在这个痛点上提供了一个透明限流层:
模型不需要知道速率限制的存在,它只需要正常调用 call_api。限流逻辑在 MCP 内部透明执行——额度够就放行,不够就告诉模型等多久再重试。
适合谁:
- 开发者 / Agent 框架用户:
npm i 429-throttle-mcp(MCP)或npm i dsh-throttle(DSH)即得透明限流代理; - 非技术用户:配合
rate-limit-operator技能,用一句话完成限流的打开、调参、关闭与复盘。
v1.1 方向变化(重要)
v1.1 从「仅面向开发者的限流代理」升级为「非技术用户也能用的限流控制面」,新增三块能力:
- Agent 操作员技能
rate-limit-operator— 把「打开 / 调参 / 关闭 / 诊断 / 复盘」全部口语化,由 agent 代劳。用户说「打开限流」「太慢了」「还是 429」「关掉限流」即可,无需懂 RPM/TPM、无需改文件。 - 任务复盘
begin_task/end_task— 长任务开始 / 结束时各调一次,返回:实际用时、调用次数、被限流次数、原定串行用时、按并发度推算的「第几轮会触顶」。 - 两种 429 的区分 — 代理拦截(
rejectedCalls > 0,可调参解决)vs 上游平台配额 429(只能查平台文档),避免盲目调高本代理上限反而更易被封。
版本与变更记录
当前版本 v1.1.0(npm 自 1.0.2 起跳升)。v1.1.0 变更:
- ✨ 新增工具:
begin_task/end_task(长任务复盘) - ✨ 新增统计:
totalDurationMs/avgLatencyMs(get_rate_limit_status返回) - ✨ 新增操作员技能
rate-limit-operator(口语控制全流程) - 🔒 安全加固:
call_api增加 URL scheme 白名单(仅 http/https) - 🔧 兼容修复:适配
@modelcontextprotocol/sdk1.30(改用高层McpServer+ Zod raw shape)
包结构
Monorepo,包含两个独立 npm 包,共享核心限流逻辑:
核心参数
参数优先级:set_rate_limit 工具动态调整 > env 启动值。动态调整实时生效但进程重启后回到 env 默认值;长期参数请改 env。
暴露的工具(v1.1 共 5 个)
call_api
通过限流代理发送 HTTP 请求。所有外部 API 调用必须经过此工具(否则限流器无数据,复盘为空)。
返回:API 响应 + _meta.rateLimit 用量快照。如果被限流拒绝,返回 RATE_LIMIT_EXCEEDED,包含 retryAfterSeconds 建议等待时间。
get_rate_limit_status
查询当前速率限制使用情况。返回已用/剩余调用次数和 Token 数、rejectedCalls(被本代理拦截数)、totalDurationMs(累计接口耗时)、avgLatencyMs(平均单次时延)及建议。判 429 来源看 rejectedCalls。
set_rate_limit
动态调整限流参数(实时生效,无需重启)。
begin_task(v1.1 新增)
开启一个限流观测任务区间,返回 taskId。长任务开始前调用。
end_task(v1.1 新增)
结束任务区间并返回复盘报告。
返回字段:
安装
MCP 客户端(ZCode / WorkBuddy 等)
在 MCP 配置中添加(stdio):
DeepSeek Harness
方式一(推荐):DSH CLI 一键挂载
方式二:手动挂载——将插件装入 profiles/<profile>/node_modules/@deepseek-ai/dsh-throttle/,并在 cordis.patch.yml 的 - insert: 数组追加条目:
🔍 重中之重:挂载后如何确认启用与跑通
MCP 客户端(以 WorkBuddy 为例)
第 1 步 — 启用:连接器管理页找到 429-throttle-mcp,点击 Trust(首次挂载必须)。若配置里 disabled: true,先改为 false。
第 2 步 — 确认已启用(满足任一即成功):
- ✅ 连接器管理页显示该 server 已连接、工具 5/5
- ✅ 会话工具列表能看到
429-throttle-mcp_call_api/get_rate_limit_status等 - ✅ 让模型调一次
get_rate_limit_status,返回 JSON 即进程存活
第 3 步 — 命令行冒烟(不依赖客户端 UI):
期望输出:已启动 + 每分钟调用上限: 30 次 + 工具: call_api / get_rate_limit_status / set_rate_limit / begin_task / end_task。
常见问题:
- 工具不可见 → 90% 是会话未刷新:新开一个对话窗口再试(MCP 工具在会话启动时加载)。
- 改了
disabled/ env 参数 → 需重启客户端才生效。 - 只有 3 个工具、缺
begin_task/end_task→ 装的是 1.0.x,请升级到 1.1.0。
DeepSeek Harness
- 插件装入
profiles/<profile>/node_modules/@deepseek-ai/dsh-throttle/,patch 加条目(见上)。 - 重启 Harness。
- 工具列表出现
call_api/get_rate_limit_status/set_rate_limit/begin_task/end_task,即启用成功。 - 冒烟:调
get_rate_limit_status看返回。
跑通一次完整链路(推荐,含复盘)
Agent 操作员技能(口语控制,v1.1 新增)
将技能 rate-limit-operator 安装到 agent 技能目录(如 WorkBuddy 的 ~/.workbuddy/skills/rate-limit-operator/)后,以下口语自动触发 agent 代劳:
重要认知:用户说「还是 429」时,先判因再动作。上游平台 429(免费 / 起步 plan 配额)不是本代理能解决的,盲目调高本代理上限只会打更猛、更易被封。
工作流示例(含复盘)
模型在做品牌 PPT 搜索任务时:
begin_task({name:"PPT 搜索"})→ 记下 taskIdget_rate_limit_status→ 确认额度充足call_api→ 搜索品牌关键词(如被拒 → 等retryAfterSeconds后重试)- 重复 2-3 直到收集完所有信息
end_task({taskId, concurrency:3})→ 拿到用时 / 次数 / 触顶轮次复盘set_rate_limit→ 按复盘结果收紧或放宽限流参数
限流算法
滑动窗口 + 令牌桶(Sliding Window + Token Bucket):维护 60 秒滑动窗口,每次调用记录时间戳和 token 消耗。窗口外的旧记录自动清理。超过限制时计算最早记录的剩余等待时间。
并发安全:tryConsume() 是同步函数,在 Node.js 单线程事件循环中天然串行化,不会出现竞态条件。
为什么用这个而不是 prompt 里写"慢点调用"?
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, MCP 启用确认, MCP 冒烟测试
License
MIT
Source: README.md at commit 220e8cf
Tools
0Version history
1- v1.2.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts