429-throttle-mcp
429-throttle-mcp
English | 中文
Keine API-429-Ablehnungen mehr — ein MCP-Proxy mit Ratenbegrenzung, der Modellen in langen Aufgaben automatisch das Aufruftempo steuert.
Was ist das
Viele kostenlose LLM-APIs (Grok, Gemini, Dots usw.) erlauben nur etwa 30 Aufrufe pro Minute. Bei langen Aufgaben (Suche + PPT-Erstellung, Batch-Tool-Aufrufe) überschreiten Modelle schnell das Limit und werden mit 429 abgelehnt.
429-throttle-mcp bietet an diesem Schmerzpunkt eine transparente Ratenbegrenzungsschicht:
模型 → call_api 工具 → 限流器 → 实际 API 请求 → 返回结果 + 用量快照Das Modell muss nichts von der Ratenbegrenzung wissen — es ruft einfach normal call_api auf. Die Begrenzungslogik wird transparent innerhalb des MCP ausgeführt: Ist das Kontingent ausreichend, wird durchgelassen; wenn nicht, wird dem Modell mitgeteilt, wie lange es warten soll, bevor es es erneut versucht.
Related MCP server: mcp-doorman
Paketstruktur
Monorepo mit zwei unabhängigen npm-Paketen, die sich die zentrale Begrenzungslogik teilen:
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.examplePaketname | Installation | Verwendung |
|
| MCP-Server (ZCode und andere MCP-Clients) |
|
| DeepSeek-Harness-Plugin |
Kernparameter
Parameter | Standardwert | Beschreibung |
| 30 | Maximale Aufrufe pro Minute (RPM) |
| 750000 | Maximale Token pro Minute (TPM), einschließlich Anfrage- und Antworttext |
Verfügbare Tools
call_api
Sendet HTTP-Anfragen über den Begrenzungs-Proxy. Alle externen API-Aufrufe müssen über dieses Tool laufen.
Parameter | Typ | Erforderlich | Beschreibung |
| string | ✅ | Vollständige URL der Ziel-API |
| string | ❌ | HTTP-Methode, Standard GET |
| string | ❌ | Anfragekörper, JSON-String |
| string | ❌ | Benutzerdefinierte Header, JSON-String |
Rückgabe: API-Antwort + _meta.rateLimit-Verbrauchsmomentaufnahme. Bei Ablehnung durch die Begrenzung wird ein RATE_LIMIT_EXCEEDED-Fehler zurückgegeben, der die empfohlene Wartezeit retryAfterSeconds enthält.
get_rate_limit_status
Fragt den aktuellen Verbrauch der Ratenbegrenzung ab. Gibt verbrauchte/verbleibende Aufrufe und Token sowie Empfehlungen zurück. Enthält keinen Warteschlangenzähler, um Nutzer nicht zu verunsichern.
set_rate_limit
Passt die Begrenzungsparameter dynamisch an (entspricht einer Schieberegler-Anpassung, wirkt sofort ohne Neustart).
Parameter | Typ | Beschreibung |
| number | Maximale Aufrufe pro Minute (RPM) |
| number | Maximale Token pro Minute (TPM) |
Installation
MCP-Clients (z. B. ZCode)
npm install 429-throttle-mcpIn der MCP-Konfiguration hinzufügen:
{
"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-throttleIn der DSH-Konfiguration hinzufügen:
{
"plugins": {
"dsh-throttle": {
"maxCalls": 30,
"maxTokens": 750000
}
}
}Beispiel-Workflow
Wenn das Modell eine Marken-PPT-Suchaufgabe ausführt:
get_rate_limit_statusaufrufen → Kontingent ausreichend bestätigencall_apiaufrufen → Marken-Keywords suchenBei Ablehnung → nach
retryAfterSecondserneut versuchenSchritte 2–3 wiederholen, bis alle Informationen gesammelt sind
set_rate_limitaufrufen → Begrenzungsparameter für die Generierungsphase enger stellen
Ratenbegrenzungsalgorithmus
Sliding Window + Token Bucket: Ein 60-Sekunden-Sliding-Window wird gepflegt; bei jedem Aufruf werden Zeitstempel und Token-Verbrauch protokolliert. Alte Einträge außerhalb des Fensters werden automatisch bereinigt. Bei Überschreitung des Limits wird die verbleibende Wartezeit des ältesten Eintrags berechnet.
Nebenläufigkeitssicherheit: tryConsume() ist eine synchrone Funktion und wird im Single-Threaded-Event-Loop von Node.js natürlich serialisiert — es können keine Race Conditions auftreten.
Warum das hier statt „ruf langsamer an" im Prompt?
Ansatz | Ergebnis |
Im Prompt „alle 2 Sekunden aufrufen" | ❌ Das Modell hat keine Stoppuhr, hält sich nicht daran, Bursts führen trotzdem zu 429 |
Externes Skript zur Begrenzung | ❌ Benötigt zusätzlichen Prozess, Modell nimmt es nicht wahr, Fehler schwer zu debuggen |
MCP-Begrenzungs-Proxy (dieses Projekt) | ✅ Für das Modell unsichtbar, transparente Kontrolle, strukturierte Fehler + Warteempfehlung |
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
Lizenz
MIT
This server cannot be installed
Maintenance
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
- AlicenseBqualityCmaintenanceSecurity 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.54699MIT
- AlicenseNot gradedqualityCmaintenanceA drop-in proxy that guards MCP servers with policy enforcement, secret redaction, prompt-injection screening, rug-pull detection, rate limiting, and audit logging.12Apache 2.0
- AlicenseNot gradedqualityBmaintenanceA 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
- AlicenseNot gradedqualityCmaintenanceA 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
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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