minimax-remaining-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@minimax-remaining-mcpCheck my MiniMax token quota and let me know if I should pause."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
minimax-remaining-mcp
MCP server: lets AI agents know how much quota is left in the MiniMax Token Plan, and when they should pause themselves to avoid hitting rate limits.
Works with DeepSeek Harness (DSH), Claude Desktop, Cursor, and any other client compatible with the MCP protocol.
┌──────────────┐ stdio ┌──────────────────────┐ HTTPS ┌──────────────┐
│ AI 代理 │ ──────────► │ minimax-remaining- │ ────────► │ MiniMax │
│ (DSH 等) │ ◄────────── │ mcp │ ◄──────── │ Web API │
└──────────────┘ └──────────┬───────────┘ └──────────────┘
│
▼
┌─────────────┐
│ Camoufox │ 一次性手动登录
│ (Firefox) │ → 持久化会话 cookie
└─────────────┘Project Background
The MiniMax web console's "5h cap / 61% used / resets in 2h56m" panel is actually driven by two HTTP endpoints:
/v1/api/openplatform/coding_plan/remains?GroupId=…— remaining percentage + countdown for the 5-hour fixed window/backend/account/token_plan_credit— cumulative credit of the plan pool (weekly)
Neither endpoint accepts the api_key shown on the web UI (which looks like sk-cp-...) as a Bearer Token — using it returns base_resp = {2062, \"no active token plan\"}. The only viable approach is to use the web session cookie (_token after logging in through a real browser). This project uses Camoufox to maintain a persistent Firefox profile, so cookies survive MCP server restarts.
Related MCP server: cycles-mcp-server
5-Hour Fixed Window (Not a Sliding Window)
In-plan quota is controlled by a 5-hour fixed window and a weekly window; unused in-plan quota is not carried over to the next billing cycle.
So the window boundaries are fixed clock periods (typically CST 00:00, 10:00 / 15:00 / 20:00, etc.), rather than rolling from your first request. If you query a few seconds before a window switch, the response returns the next window's data. The interval_start_iso / interval_end_iso fields in the response tell you exactly which period it is.
One-Line Installation
# 方式 1:从 PyPI 安装(推荐)
pip install minimax-remaining-mcp
# 或
uv pip install minimax-remaining-mcp
# 或
uvx minimax-remaining-mcp # 不安装直接运行
# 方式 2:从 GitHub 安装(无需 PyPI 账号)
pip install git+https://github.com/yang-cc/minimax-remaining-mcp.git
# 方式 3:本地开发模式
git clone https://github.com/yang-cc/minimax-remaining-mcp.git
cd minimax-remaining-mcp
uv venv .venv --python 3.12
uv pip install -e .One-Time Login
Since there is no Bearer Token path, you need to log in manually once in Camoufox:
# 1. 启动服务器
python -m minimax_remaining_mcp.server
# 2. 在 MCP 客户端里调用:
minimax_login(timeout_seconds=600)The Camoufox browser will pop up and open the MiniMax login page. Please complete the Cloudflare / CAPTCHA verification and log in manually until the browser reaches the API Keys page. The server automatically detects the _token cookie and persists the session to data/cookies.json.
🔌 DeepSeek Harness (DSH) Integration
DSH loads MCP servers through @deepseek-ai/dsh-mcp-client. Append the following to ~/.dsh/profiles/web/cordis.patch.yml (note the package name is minimax-remaining-mcp, but the Python module path is minimax_remaining_mcp.server):
- insert:
- id: minimax-remaining-mcp
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: minimax
transport: stdio
command: <repo>/.venv/Scripts/python.exe # 或 uv 环境的 python
args: ['-u', '-m', 'minimax_remaining_mcp.server']
env:
# 暂停阈值:5h 剩余低于 30% 时触发代理暂停
MINIMAX_PAUSE_THRESHOLD_REMAINING_PCT: '30'
# 储存目录(可选,默认 ./data)
# MINIMAX_DATA_DIR: E:\\codex_dir\\.dsh\\state\\minimax-remaining-mcp
failOnStartupError: false
toolCallTimeoutMs: 180000DSH Integration Notes
Note | Description |
| Makes Python stdio unbuffered so the DSH console can see MCP server logs immediately. |
Python interpreter path | Depends on the installation method:• |
Login required on first start | If |
Restart DSH | After modifying |
| Recommended to set to |
Isolated persistence directories | When multiple projects share the same DSH, it is recommended to use a different |
Typical Usage in DSH
After DSH starts, it calls minimax_status() to determine the remaining quota. You can train the agent to call minimax_status() once before each MiniMax API call and observe the should_pause field:
remaining_percent_5h < 30 → should_pause=true → 代理应停下来或转做其他事
remaining_percent_5h >= 30 → should_pause=false → 可以继续调用A more thorough approach is to call minimax_wait_for_quota(), which blocks until the quota is back above the threshold (default MINIMAX_PAUSE_THRESHOLD_REMAINING_PCT), saving the agent from writing its own polling logic.
Tool Overview
Tool | Purpose |
| All the numbers from the web panel: 5h remaining/used %, countdown, plan accumulation. Sets |
| Returns only the agent-local 5h observation window state (separate from MiniMax's fixed window, used only for agent self-throttling). |
| Adds N to the local window consumption counter. Call once after each MiniMax API call. |
| Blocks until the 5h remaining percentage is ≥ |
| Pops up a Camoufox browser window for manual login. |
| Quick Camoufox health check (opens example.com). |
| Static configuration + metadata from the most recent session. |
| Clears cookies / session / window state. |
⚠️ First Cold Start (Camoufox) Is Slow
The first time minimax_smoke() and minimax_login() start Camoufox, they need to unpack the persisted Firefox profile, initialize the sqlite database, load extensions, and so on, which usually takes 30-90 seconds (depending on disk speed). This is normal Camoufox cold-start behavior, not a bug — subsequent starts reuse the cache in data/profile/ and finish in seconds.
If the first call exceeds your MCP client's toolCallTimeoutMs (DSH default 180s) and is aborted, just retry once and you'll see the result. If you expect frequent cold starts (for example, running in CI), you can set the toolCallTimeoutMs of the corresponding MCP client to 300000 (5 minutes).
minimax_status() Response Example
Actual diagnostic output (when the 5h window is exhausted and a pause should be triggered):

Below is the normalized JSON structure:
{
"ok": true,
"source": "coding_plan",
"remaining_percent_5h": 76, // 5h 窗口剩余 %
"used_percent_5h": 24, // 5h 窗口已用 %
"seconds_until_reset_human": "4h21m35s",
"interval_end_iso": "2026-08-25T12:00:00+00:00",
"interval_status_text": "active", // active | exhausted | inactive
"remaining_percent_weekly": 100,
"seconds_until_weekly_reset_human": "5d08h42m",
"total_credits": 14000, // 套餐累计(周维度)
"used_credits": 3188,
"remaining_credits": 10812,
"user_name": "...",
"group_id": "...",
"should_pause": false, // 低于阈值时为 true
"model_remains": [
{ "model_name": "general", "interval_remaining_percent": 76, "interval_status": 1 },
{ "model_name": "video", "interval_remaining_percent": 100, "interval_status": 3 }
]
}Pause Threshold Semantics
MINIMAX_PAUSE_THRESHOLD_REMAINING_PCT=30 means pause when the 5h window's remaining percentage is < 30% (i.e., more than 70% used). It compares remaining_percent_5h, not the plan-accumulated remaining_credits — these are independent metrics.
Persistent Files
All state is stored as plain JSON in data/ (excluded via .gitignore):
data/
├── cookies.json # Camoufox 会话 cookie
├── session.json # 最近一次登录元数据
├── window.json # 代理本地的 5h 观测窗口
├── last_usage.json # 最近一次成功的 API 响应(缓存)
└── profile/ # Camoufox 持久化 Firefox profile(~150 MB)If coding_plan/remains returns 401/403, the full response body is written to data/last_coding_plan_failure.json for troubleshooting — check this file before suspecting the service is down.
Environment Variables
All are optional; default values are shown in the table below.
Variable | Default | Description |
|
| Pause when the 5h remaining falls below this. |
|
| Agent-local window length (5h). |
|
| Forces the browser window to show during login. |
| auto |
|
|
| Browser language. |
|
| API request timeout (seconds). |
|
| cookies / session storage directory. |
|
| Overrides the console base URL. |
|
| Plan pool endpoint. |
|
| 5h window endpoint. |
|
| Used when the primary endpoint fails. |
|
| Login landing page. |
Local Development & Debugging
# 启动 MCP 服务器(stdio 模式)
.venv\Scripts\python.exe -u -m minimax_remaining_mcp.server
# 或(Windows)
run.bat
# 直接探测 coding_plan 接口(无需 MCP / 浏览器)
.venv\Scripts\python.exe probe_coding_plan.py
# 检查持久化状态
cat data/cookies.json | head -c 200
cat data/session.json
cat data/last_coding_plan_failure.json # 如果存在Packaging & Publishing to PyPI (for Maintainers)
# 安装打包工具
pip install build twine
# 在项目根目录构建 wheel + sdist
python -m build
# → dist/minimax_remaining_mcp-0.1.0-py3-none-any.whl
# → dist/minimax_remaining_mcp-0.1.0.tar.gz
# 检查产物
twine check dist/*
# 上传到 PyPI(需要先 `twine login` 或用 token)
twine upload dist/*
# 或:uv publish dist/*After publishing, anyone can:
pip install minimax-remaining-mcp
uv pip install minimax-remaining-mcp
uvx minimax-remaining-mcp # 临时运行Limitations
No Bearer-key path. MiniMax does not currently issue a subscription key for the Coding Plan API; using the web console's
api_keyas a Bearer returns2062 \"no active token plan\". The only viable option is the session cookie.Cloudflare / CAPTCHA must be completed manually. The initial login must be completed by a real person. This project does not integrate with any captcha-solving service.
The 5h window is a fixed CST period. Querying before a window switch returns the next window's data.
interval_start_iso/interval_end_isotell you exactly which period.Plan accumulation (
remaining_credits) is not carried over. It is a weekly cumulative pool and is not reset when the 5h window resets.
License
MIT — see LICENSE for details.
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
- AlicenseNot gradedqualityDmaintenanceProvides intelligent OpenAI API token management with automatic switching between model tiers when usage limits are reached. It enables users to track daily token consumption, estimate costs before making calls, and manage project-specific usage data.MIT
- AlicenseAqualityAmaintenanceRuntime budget authority for autonomous agents - a set of tools to check, reserve, spend, and release budget before and after every costly, risky operation. The agent asks "can I afford this?" before acting, and reports what it actually used afterward.9138Apache 2.0
- AlicenseAqualityNot gradedmaintenanceProvides real-time visibility into Claude Pro and Max subscription usage limits directly within Claude Code by utilizing local OAuth tokens. It enables users to monitor session and weekly usage across different models and receive alerts regarding rate-limiting status.4
- AlicenseAqualityAmaintenanceQueries real-time AI subscription quota for Claude Code Max, Kimi, and Z.ai. Tokens are read from environment variables and never stored.3MIT
Related MCP Connectors
Budget & cost control for AI agents — per-agent spend caps + rate limits before each call.
Agent Token Budget MCP — hard per-session token + spend cap with signed budget-exhausted
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
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/yang-cc/minimax-remaining-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server