chatgpt-quota-mcp
MCP server that exposes a single tool to retrieve ChatGPT/Codex quota via the signed-in Codex CLI, reporting rate-limit windows and usage percentages.
README
ChatGPT Quota MCP
A single local MCP tool that lets ChatGPT read your current ChatGPT/Codex quota through your already signed-in Codex CLI.
ChatGPT
|
Secure MCP Tunnel
|
get_chatgpt_quota (local MCP)
|
codex app-server --stdio
|
account/rateLimits/read
What it returns
The server exposes one no-argument tool:
get_chatgpt_quota()
Example result:
{
"source": "codex_app_server",
"windows": [
{
"name": "primary",
"used_percent": 25.0,
"remaining_percent": 75.0,
"window_minutes": 300,
"resets_at": 1786543200
}
],
"rate_limit_reached_type": null,
"individual_limit": null,
"spend_control_reached": null,
"reset_credits": null
}
The tool does not assume that primary means 5-hour or secondary means weekly. It reports the window duration Codex actually returns.
Prerequisites
- Python 3.11+
uv- Codex CLI available as
codex - Codex CLI already signed in to the ChatGPT account whose quota you want to read
Verify the last two with:
command -v codex
codex
Install
git clone https://github.com/komaksym/chatgpt-quota-mcp.git
cd chatgpt-quota-mcp
uv sync --extra dev
Test the quota locally first
This bypasses MCP and proves that the Codex quota read works on your machine:
uv run python -c 'from chatgpt_quota_mcp.service import get_chatgpt_quota; import json; print(json.dumps(get_chatgpt_quota(), indent=2))'
If that prints your quota, the Codex side is working.
Connect it to ChatGPT
OpenAI Secure MCP Tunnel can launch a local stdio MCP command, so this project does not need an HTTP server or public port.
- In OpenAI Platform tunnel settings, create a tunnel associated with the ChatGPT workspace you will use and obtain a
tunnel_idplus runtime API key. - Install the current
tunnel-clientfrom OpenAI's tunnel settings/download instructions. - Configure the tunnel to launch this project's MCP executable:
export CONTROL_PLANE_API_KEY="sk-..."
TUNNEL_ID="tunnel_..."
MCP_COMMAND="$(pwd)/.venv/bin/chatgpt-quota-mcp"
tunnel-client init \
--sample sample_mcp_stdio_local \
--profile chatgpt-quota \
--tunnel-id "$TUNNEL_ID" \
--mcp-command "$MCP_COMMAND"
tunnel-client doctor --profile chatgpt-quota --explain
tunnel-client run --profile chatgpt-quota
Do not commit the runtime API key.
- In ChatGPT, enable Settings -> Security and login -> Developer mode.
- Open ChatGPT Plugins, press +, choose Tunnel under Connection, and select or paste your
tunnel_id. - Confirm that ChatGPT discovers exactly one tool:
get_chatgpt_quota.
Then ask:
How much Codex quota do I have left?
Development
uv sync --extra dev
uv run ruff check .
uv run ruff format --check .
uv run mypy src
uv run pytest
uv build
The test suite includes a real MCP stdio round trip backed by a fake Codex executable, so CI exercises the full local protocol chain without using a real account.
Why this shape
The Codex App Server has a stable account/rateLimits/read method. Using that structured interface is smaller and less brittle than scraping ChatGPT UI text or calling undocumented ChatGPT backend endpoints.
References
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。