Wraps the agentfit JavaScript library as an MCP server so Claude and other clients can estimate token counts and truncate chat histories on the fly. Exposes three tools: count_tokens for quick estimation across OpenAI, Anthropic, Google, and Llama tokenizer families; fit_messages to drop messages from a history until it fits a budget, with strategies like drop-oldest or drop-middle and options to preserve system prompts or the last N turns; and list_estimators to see what's available. Useful when you need to ask your assistant "trim this transcript to 8k tokens" or check token usage mid-conversation without leaving your editor. Runs via npx with zero dependencies, works over stdio with any MCP client.
claude mcp add --transport stdio io.github.mukundakatta-agentfit uvx agentfit