Skip to main content
Glama

maxtoken

Lightweight MCP server for GLM Coding Plan & Kimi Coding Plan balance query and utilization statistics.

Returns, per account:

  • 5-hour rolling window: used / remaining quota and ratio, reset time and countdown

  • Long cycle (GLM 7d / Kimi 30d): used / remaining ratio, reset time

  • Utilization stats: time elapsed ratio, burn rate (used ratio ÷ elapsed ratio), projected utilization at reset, estimated waste, and status (UNDER_UTILIZED / ON_TRACK / HIGH_LOAD)

Single runtime dependency (@modelcontextprotocol/sdk), stdio transport, Node >= 18.

Tools

Tool

Description

query_balance

Real-time Token/credit balance for the 5h window and the 7d/30d cycle

get_utilization_stats

Burn rate, projected utilization at window reset, estimated waste ratio, utilization status

Both tools take an optional account_id argument; omit it to query all enabled accounts.

Related MCP server: opencode-balance-mcp

Configuration

Create a JSON config with your accounts (see tokens.example.json):

{
  "accounts": [
    {
      "id": "glm-main",
      "provider": "glm",
      "plan": "max",
      "api_key": "your_glm_coding_api_key_here",
      "enabled": true
    },
    {
      "id": "kimi-main",
      "provider": "kimi",
      "plan": "pro",
      "api_key": "sk-kimi-your_coding_token_here",
      "region": "cn",
      "enabled": true
    }
  ]
}
  • provider: "glm" or "kimi"

  • region (Kimi only): "cn" (api.kimi.com, default) or "global" (api.kimi.ai)

  • enabled: set to false to skip an account

Usage

Add to your MCP client config (.mcp.json / ~/.claude.json):

{
  "mcpServers": {
    "maxtoken": {
      "command": "npx",
      "args": ["-y", "maxtoken", "--config", "/path/to/tokens.json"]
    }
  }
}

Or run directly:

npx maxtoken --config /path/to/tokens.json

The config path can also be set via the MAXTOKEN_CONFIG environment variable; it defaults to ./tokens.json.

Development

npm install
npm run build   # tsc -> dist/
npm run dev     # run from source with tokens.example.json

License

MIT

Available Tools

2 tools
get_utilization_statsC

统计 GLM 与 Kimi Coding Plan 的使用量与利用率指标,包含窗口时间流逝比、消耗速率比(Burn Rate)、预计重置时最终利用率及额度浪费比例。

Inputs: account_id.

query_balanceA

查询 GLM 与 Kimi Coding Plan 账号的实时 Token/积分余额,包含 5小时滚动窗口及周(7d)/月(30d)周期的已用额度、剩余比例与重置时间。

Inputs: account_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 2 tools

    Disambiguation4/5

    The two tools have mostly distinct purposes: one focuses on utilization/burn-rate analytics, while the other focuses on real-time balance and quota status. However, both report used quota, remaining ratio, and reset timing, so an agent could occasionally confuse which tool to use for quota-related questions.

    Naming Consistency4/5

    Both names follow a verb_noun pattern and are readable, but they use different verbs (get_ vs query_) for similar read operations. This is a minor inconsistency rather than a serious problem.

    Tool Count3/5

    Two tools is thin for a monitoring server, even if the domain is narrow. The surface feels minimal and may require agents to infer too much from only two operations.

    Completeness4/5

    The tools cover the core monitoring needs: utilization metrics and real-time balance/quota status across GLM and Kimi plans. Minor gaps remain, such as account listing or historical trend queries, but core workflows are covered.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Lets a coding agent inspect its own account's subscription limit windows, usage, and cost history, and decide whether to pause and sleep until a limit resets rather than failing mid-task. Supports multiple accounts and providers such as Claude Code and Codex.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Exposes three MCP tools that let Claude Desktop, Cursor, Claude Code, and Cline query an account's current balance in USD, retrieve token and cost usage statistics for the last N days, and list supported models with per-million-token pricing. Answers questions like "How much have I spent in the last 30 days?" by calling those tools directly from any MCP-compatible client.
      3
      MIT