token-discipline
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
token-discipline-mcp
Stop your AI coding agent from burning through your usage limits.
A tiny MCP server (one file, zero dependencies) that loads a set of token-saving rules into every session of Claude Code, Claude Desktop, Cursor, or any MCP client.
What it makes your agent do
Rule | Effect |
π§ Main chat is a dispatcher | Plans and delegates; heavy work runs in subagents |
β Agents checkpoint at ~125k tokens | Commit, write |
π Grep before reading | Only the needed lines, never re-read files |
π₯ 1 or 2 agents by default, max 5 | Parallel fan-out is what kills a session |
π Pace huge tasks | Split across sessions instead of hitting the rate limit |
Full list: RULES.md.
Related MCP server: mcp-context-condenser
Setup (1 minute)
Needs Node 18+. Nothing to install: npx runs it straight from GitHub.
Claude Code
claude mcp add token-discipline --scope user -- npx -y github:Suhaib5333/token-discipline-mcpClaude Desktop, Cursor, Windsurf, others
Add this to your MCP config (claude_desktop_config.json, ~/.cursor/mcp.json, ...):
{
"mcpServers": {
"token-discipline": {
"command": "npx",
"args": ["-y", "github:Suhaib5333/token-discipline-mcp"]
}
}
}Restart the client. Done β
How it works
The rules reach the model 3 ways, so it works whatever your client supports:
Channel | What |
Server instructions | Sent automatically on connect |
Tool | The agent can fetch the rules any time |
Prompt | Load them manually ( |
Use your own rules
Point it at any Markdown file:
claude mcp add token-discipline --scope user -e TOKEN_RULES_FILE=/path/to/my-rules.md -- npx -y github:Suhaib5333/token-discipline-mcp(JSON config: add "env": { "TOKEN_RULES_FILE": "/path/to/my-rules.md" }.)
Or fork this repo, edit RULES.md, and swap Suhaib5333 for your username in the install command.
Run locally
git clone https://github.com/Suhaib5333/token-discipline-mcp
cd token-discipline-mcp
npm testContributing
Ideas for better rules are welcome. Open an issue or a PR (keep it zero-dependency and short). See CONTRIBUTING.md.
License
MIT: use it, fork it, ship it.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Enforces architectural invariants and code quality rules inside your AI agent's edit loop.
Reduces AI Agent token usage by 40% via three-stage SOP workflow.
Rules-based context reduction, planning checks, research prompts and fixed experiences for agents.
Checks AI-written code against your rules as it is written, and keeps a record of what it found.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceReduces token consumption for AI coding agents by 50-70% through intelligent code context filtering, Git delta tracking, and local SQLite/Tree-sitter indexing.167 npmMIT
- AlicenseAqualityBmaintenanceEnables AI coding agents to reduce token usage by condensing source code into AST skeletons, extracting specific symbols, compressing logs, and estimating token budgets.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables monitoring of running agent loops with token and monetary cost estimation, pruning of verbose thinking chains near limits, and routing sub-tasks between fast/cheap and deep reasoning models. It provides deterministic, MCP-compatible budget optimization for autonomous agents and copilot frameworks.MIT
- AlicenseAqualityBmaintenanceEnables coding agents to perform advisory runtime safety checks by inspecting proposed file paths and shell commands, tracking caller budgets, detecting repeated actions, and masking common credentials in output without executing commands or opening target files.4GPL 3.0