Agentfit MCP server
Token-aware message truncation: fit a chat history into your model's context budget.
1 stars35 downloads/wk
Reviews
Write oneNobody has reviewed Agentfit yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Agentfit tools (3, 1 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
count_tokensEstimate tokens in a string or chat-message array. Fast, dependency-free, within ~10-20% of true tokenizer counts on English prose. Pass a model name to pick the right per-family estimator (openai, anthropic, google, llama, default).
fit_messageswrite actionDrop messages from the input array until the total is under maxTokens. Three strategies: drop-oldest (default), drop-middle, priority (uses each message's `priority` field). Always returns a structured result with token counts before and after; never throws across the wire.
list_estimatorsList the built-in estimator families this server knows about. Useful for picking a model alias when the exact model name isn't recognized.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan2 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 58 days ago12/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Agentfit compares
Against every graded AI and agents MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 88/100
- higher than 80% of 4,464 AI and agents servers
- Tools
- 3
- the typical AI and agents server has 6
- Tools that change things
- 33%
- typical: 0%. Fewer write tools means less an agent can break
- GitHub stars
- 1
- more than 50% of 2,697 AI and agents servers
- Downloads a week
- 35
- more than 25% of 1,515 AI and agents servers with a package
What its tools let an agent do: 2 read · 1 change
Install Agentfit in Claude Code, Cursor or VS Code
Runs npx -y @mukundakatta/agentfit-mcp on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add agentfit -- npx -y @mukundakatta/agentfit-mcp
What the publisher says
From the Agentfit repository's README, as published. We do not edit it. Read it on GitHub
agentfit-mcp
MCP server for @mukundakatta/agentfit. Lets Claude Desktop, Cursor, Cline, Windsurf, Zed, or any other MCP client estimate token counts and fit a chat history into a model's context budget on demand.
npx -y @mukundakatta/agentfit-mcpThree tools:
- counttokens** — estimate tokens in a string or chat-message array, with per-model estimator families (openai, anthropic, google, llama, default).
- fitmessages** — drop messages from a chat history until under a maxTokens budget. Supports drop-oldest, drop-middle, and priority strategies; honors preserveSystem, preserveFirstN, preserveLastN.
- listestimators** — list the built-in estimator families.
Add to your client
Claude Desktop
Edit ~/Library/Application Support/Claude/claudedesktopconfig.json (macOS) or %APPDATA%\Claude\claudedesktopconfig.json (Windows):
{
"mcpServers": {
"agentfit": {
"command": "npx",
"args": ["-y", "@mukundakatta/agentfit-mcp"]
}
}
}Cursor
~/.cursor/mcp.json:
{
"mcpServers": {
"agentfit": {
"command": "npx",
"args": ["-y", "@mukundakatta/agentfit-mcp"]
}
}
}Cline / Windsurf / Zed
Same shape as above. The server speaks plain MCP over stdio, so any client that supports stdio MCP servers will work.
Tool examples
counttokens:**
{ "input": "hello world", "model": "claude-sonnet-4-6" }Returns:
{ "tokens": 4, "model": "claude-sonnet-4-6" }fitmessages:**
{
"messages": [
{ "role": "system", "content": "You are precise." },
{ "role": "user", "content": "long context..." },
{ "role": "assistant", "content": "..." },
{ "role": "user", "content": "final question" }
],
"maxTokens": 8000,
"model": "claude-sonnet-4-6",
"preserveSystem": true,
"preserveLastN": 2,
"strategy": "drop-oldest"
}Returns:
{
"messages": [...],
"dropped": [...],
"tokens": { "before": 12000, "after": 7800, "budget": 8000 },
"fit": true
}fit_messages always returns a structured result and never throws across the wire: if the budget is unreachable even after dropping all non-protected messages, you get fit: false with the partial result so the caller can decide what to do.
Why a separate MCP server
@mukundakatta/agentfit is a zero-dependency JavaScript library. This package wraps it as an MCP server so it's accessible from inside any MCP-aware AI assistant: ask Claude "how many tokens is this transcript?" or "trim this chat to 8k tokens preserving the system prompt and last 2 turns" and the assistant calls these tools directly.
Sibling MCP servers
Part of the agent-stack series, all @mukundakatta/*-mcp:
- @mukundakatta/agentfit-mcp — Fit it. (this)
- @mukundakatta/agentguard-mcp — Sandbox it.
- @mukundakatta/agentsnap-mcp — Test it.
- @mukundakatta/agentvet-mcp — Vet it.
- @mukundakatta/agentcast-mcp — Validate it.
License
MIT
Nothing above is checked by us. What we check is on the safety report.
Agentfit: common questions
- Is Agentfit MCP server safe?
- Yes, by our scan: it is graded A (88/100). Read the Agentfit safety report
- How do I install Agentfit?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Agentfit need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is Agentfit maintained?
- The last commit was 93 days ago (2026-08-01). The latest release is v0.1.0.
- What can I use instead of Agentfit?
- Servers from other publishers that do the same job: Commonly MCP server, Agent-Native Chat MCP server and mcptoon MCP server.
- How does Agentfit compare with other AI and agents MCP servers?
- safety score 88/100 (higher than 80% of 4,464 AI and agents servers); tools 3 (the typical AI and agents server has 6); tools that change things 33% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Agentfit
Same job from other publishers: the closest match first, then the best rated.
- CommonlyRead Commonly pods and post as a Commonly agent you create, with a token from your Commonly account.not reviewedEstablishedA
- Agent-Native ChatMinimal chat-first app with durable threads, actions, and the app-agent loopnot reviewedEstablishedA
- mcptoonMCP tools + agent skills in one zero-dependency CLI: 71,929 -> 581 tokens (-99.2%, measured).not reviewedEstablishedA
- Actual Budget MCP ServerMCP server exposing Actual Budget accounts, transactions, budgets and reporting to LLM assistants.not reviewedEstablishedB
- llmtrimMCP server and proxy that compresses LLM prompts, tool output, and replies to cut token cost.not reviewedEstablishedA