tokens-saver-mcp
Works with OpenAI-compatible APIs to route low-risk text processing tasks to budget models, saving costs on GPT usage.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tokens-saver-mcpSummarize this paragraph into one sentence."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tokens-saver-mcp
A provider-agnostic MCP (Model Context Protocol) server that routes 7 narrow text-processing tools to budget models — local or cloud — to reduce main model token consumption.
Core idea: offload low-risk, structured, short-output sub-tasks (classification, extraction, summarization, rewriting, small code generation) to cheaper models, keeping complex reasoning and high-risk changes on Claude/GPT.
Tools
Tool | Purpose |
| Classify text into a given label set |
| Extract structured fields from long text |
| Compress long text to a short summary |
| Rewrite text in a different style (or translate zh↔en) |
| Generate small code snippets / function-level patches |
| Compress a git diff into a structured change summary |
| Extract actionable tasks from unstructured text |
All tools return both human-readable content and machine-consumable structuredContent.
Related MCP server: ai-workers-mcp
Requirements
Node.js >= 20
A running provider (local model or cloud API with OpenAI-compatible endpoint)
Setup
npm install
npm run buildCreate ~/.tokens-saver-mcp/settings.json to configure providers (see below).
If the file does not exist, the server falls back to a built-in default pointing at http://127.0.0.1:1234 with zai-org/glm-4.7-flash.
Configuration
~/.tokens-saver-mcp/settings.json
{
"defaultProvider": "remote_budget_cn",
"providers": {
"local": {
"type": "openai_compatible",
"baseUrl": "http://127.0.0.1:11434/v1",
"apiKeyEnv": "",
"model": "qwen2.5:14b",
"timeoutMs": 15000,
"maxRetries": 1,
"temperature": 0.1
},
"remote_budget_cn": {
"type": "openai_compatible",
"baseUrl": "https://api.minimax.chat/compatible-mode/v1",
"apiKeyEnv": "MINIMAX_API_KEY",
"model": "MiniMax-M2.7",
"timeoutMs": 20000,
"maxRetries": 2,
"temperature": 0.2
}
},
"toolRouting": {
"tsm_classify": "local",
"tsm_extract_json": "remote_budget_cn",
"tsm_summarize": "remote_budget_cn",
"tsm_rewrite": "remote_budget_cn",
"tsm_codegen_small_patch": "remote_budget_cn",
"tsm_diff_digest": "remote_budget_cn",
"tsm_task_extract": "local"
}
}Key rules:
API keys are never stored in the config file. Set
apiKeyEnvto the environment variable name that holds the key.For local providers with no auth, set
apiKeyEnvto"".toolRoutingis optional — unrouted tools fall back todefaultProvider.
Usage
# Run as MCP server (stdio transport)
npm startClaude Code integration
{
"mcpServers": {
"tokens-saver": {
"command": "node",
"args": ["/path/to/tokens-saver-mcp/dist/server.js"]
}
}
}Development
npm test # Run 61 tests
npm run typecheck # Type check only
npm run build # Compile TypeScriptAvailable Tools
7 toolstsm_classifyA
Classify text into one of the provided labels using a budget model. Returns label, confidence score, and a brief reason. Useful for intent classification, routing decisions, and tagging.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to classify | |
| labels | Yes | List of possible labels | |
| instructions | No | Optional classification instructions |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must disclose behavior. It mentions budget model, returns label/confidence/reason, but lacks edge cases, limitations, or state effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences: first explains action and output, second lists use cases. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 3-param tool without output schema, description adequately covers functionality and output shape but could include confidence scale or label limits.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, baseline 3. Description adds minimal extra meaning beyond the schema's parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (classify text), the resource (text), and specifies it uses a budget model, distinguishing it from sibling tools like summarize or extract.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit use cases (intent classification, routing, tagging) but does not mention when not to use or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tsm_codegen_small_patchA
Generate small code snippets or function-level patches using a budget model. Scoped to single functions, regex, SQL, scripts, or unit test samples. NOT for multi-file or architectural designs.
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Description of what the code snippet should do | |
| language | No | Target programming language | |
| constraints | No | Additional constraints or requirements | |
| existing_code | No | Existing code context for the patch |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry the behavioral burden. It mentions the use of a 'budget model' and scoping to single functions, but does not disclose auth requirements, rate limits, error handling, or behavior when input exceeds scope. Adequate but lacking depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise: two sentences total. First sentence states main purpose, second sets clear exclusions. Zero wasted words, front-loaded with essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, no annotations, and 4 parameters with brief descriptions, the tool description covers purpose and scope minimally. It lacks details on return format, error states, or behavior for edge cases. Adequate for a simple tool but not comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds marginal value beyond the schema: it provides context about scope (single functions) but does not enhance individual parameter meanings. The schema descriptions are basic, and the tool description does not enrich them.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool generates small code snippets or function-level patches using a budget model. It specifies scope (single functions, regex, SQL, scripts, unit tests) and explicitly excludes multi-file or architectural designs, distinguishing it from sibling tools like tsm_rewrite or tsm_summarize.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description explicitly says NOT for multi-file or architectural designs, providing clear when-not-to-use guidance. However, it does not directly name alternative tools for such cases, though the sibling list is available. Implicitly suggests use for small, focused code generation tasks.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tsm_diff_digestA
Compress a git diff into a structured summary of changed areas, behavior changes, risks, and a one-paragraph overview. Helps the main model quickly understand large diffs.
| Name | Required | Description | Default |
|---|---|---|---|
| focus | No | Analysis focus: behavior changes, risks, or general summary | |
| diff_text | Yes | Git diff or patch text to analyze |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description does not disclose behavioral traits such as whether the tool is read-only, destructive, or requires any permissions. It only describes the output without clarifying side effects or constraints, leaving a gap for an agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no redundant information. First sentence states core function and output, second sentence provides use case. Economical and clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but description outlines the kind of output (structured summary with specific components). For a tool with 2 parameters and no nested objects, this is fairly complete. Could be improved with more specific output format details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. Description adds marginal value by linking the focus enum options to the output components ('behavior changes, risks' correspond to enum values). No further parameter details beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb 'compress' and resource 'git diff', and specifies output includes 'structured summary of changed areas, behavior changes, risks, and a one-paragraph overview'. Differentiates from siblings like tsm_summarize or tsm_classify by being specific to git diffs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description says 'Helps the main model quickly understand large diffs', which implies usage context. However, no explicit when-not or alternatives to sibling tools are provided, but the specificity of the tool name and description makes the use case clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tsm_extract_jsonA
Extract structured fields from long text according to a schema description. Returns a JSON object with extracted data and a list of missing fields. Useful for parsing documents, issues, logs.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Source text to extract data from | |
| extraction_goal | Yes | What extraction goal or use case | |
| schema_description | Yes | Description of the fields to extract |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It mentions the return format (JSON object with extracted data and missing fields), which adds value beyond the schema. However, it does not disclose potential errors, side effects, or limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very concise with two sentences: first stating the core purpose, then mentioning return and use cases. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of an output schema, the description adequately covers the return format. It explains the tool's role in extraction tasks but could include more about safety or common pitfalls.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, providing clear parameter descriptions. The tool description adds minimal extra meaning beyond the schema, only connecting the schema_description parameter to the extraction task.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool extracts structured fields from long text according to a schema description, specifying the verb and resource. It distinguishes from sibling tools like tsm_classify (classification) and tsm_summarize (summarization) by focusing on extraction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides context with examples ('useful for parsing documents, issues, logs'), implying when to use it. However, it lacks explicit guidance on when not to use it or alternative tools for similar tasks.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tsm_rewriteA
Rewrite text in a different style (concise, formal, technical, friendly, or translate between Chinese and English) without changing the core facts.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to rewrite | |
| style | Yes | Target rewriting style | |
| constraints | No | Optional additional constraints for rewriting |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It states the behavioral guarantee 'without changing the core facts' and lists the available styles. However, it does not disclose other traits like whether it is read-only, any rate limits, or output format. The guarantee is useful but incomplete for full transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with a parenthetical list of styles. It is concise with zero wasted words, front-loading the core purpose and key details efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description explains the tool transforms text style and preserves facts, which is fairly complete for a simple rewriting tool. It covers the key operations and highlights translation capabilities. Minor omission: no mention of output format, but it is implicitly the rewritten text.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all three parameters. The description restates the style enum but adds no new meaning beyond the schema's property descriptions. For high coverage, baseline is 3, and the description does not elevate beyond that.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Rewrite', the resource 'text', and the action 'in a different style' while preserving core facts. It distinguishes itself from sibling tools like tsm_classify and tsm_summarize by focusing on style transformation rather than classification or summarization.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a list of styles (concise, formal, technical, friendly, translation) implying usage for style changes only. However, it lacks explicit guidance on when to use versus alternatives, such as not to use for summarization or classification. The sibling tools are distinct enough that context is implied, but not explicitly stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tsm_summarizeB
Compress long text into a concise summary with bullet points and risk flags. Useful for compressing long conversations, logs, documents, or diff context before passing to the main model.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Long text to summarize | |
| max_points | No | Maximum number of bullet points (default: 6) | |
| summary_style | Yes | Summarization style: brief paragraph, bullet points, or decision-focused |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose all behavioral traits. It mentions 'risk flags' which are not reflected in the input schema, leaving output behavior unclear. It does not state whether the tool is read-only or has side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: one sentence front-loaded with the core purpose. Every part is informative and earns its place. No fluff or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema and the description does not explain the return format, error conditions, or limitations. It mentions 'bullet points and risk flags' but provides no detail on how they are structured, leaving the agent underinformed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds context about 'risk flags' but does not significantly enhance understanding beyond the schema's parameter descriptions. It adds minimal value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool compresses long text into a concise summary with bullet points and risk flags. It distinguishes from sibling tools like classification and code generation. However, 'risk flags' are not defined in the schema, causing slight ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides examples of when to use the tool ('long conversations, logs, documents, or diff context'), but does not specify when not to use it or guide toward alternative tools. The usage context is implied but lacks explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tsm_task_extractB
Extract an actionable task list from unstructured text (meeting notes, daily reports, requirements). Returns tasks with optional owner, due date, status, and notes.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Source text to extract tasks from | |
| task_granularity | Yes | Level of task granularity: coarse (high-level), normal, or fine (atomic steps) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must convey behavioral traits. It states the tool returns tasks with optional fields, but does not clarify if it is read-only, what side effects exist, or any authorization needs. The non-destructive nature is implied but not explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the main action, and contains no irrelevant information. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 2-parameter tool with no output schema, the description covers purpose and input but lacks details on error handling, input limits, or exhaustive output structure. It is adequate but not comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds output structure context (owner, due date, etc.) but does not enhance parameter understanding (e.g., when to choose coarse vs fine granularity).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool extracts actionable task lists from unstructured text, with specific examples (meeting notes, daily reports, requirements). The verb 'extract' and resource 'task list' are specific, and it differentiates well from siblings like tsm_classify or tsm_extract_json.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description lists example input types but provides no explicit guidance on when to use this tool versus alternatives (e.g., tsm_extract_json) or when not to use it. No exclusion criteria or context for sibling comparison.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.0- First observed
tsm_classify - First observed
tsm_codegen_small_patch - First observed
tsm_diff_digest - First observed
tsm_extract_json - First observed
tsm_rewrite - First observed
tsm_summarize - First observed
tsm_task_extract
TDQS
Scored across 7 tools
Each tool has a distinct, non-overlapping purpose: classification, code patch generation, diff summarization, JSON extraction, rewriting, text summarization, and task extraction. No ambiguity between tools.
All tools use the 'tsm_' prefix and snake_case. Most follow a verb_noun pattern (classify, summarize, rewrite), though 'tsm_codegen_small_patch' is slightly less consistent with its compound noun. Overall, naming is clear and predictable.
With 7 tools, the server is well-scoped for a utility focused on token-saving and text processing. Each tool addresses a common need without being excessive or insufficient.
The tool set covers major text operations: classification, extraction, transformation, and summarization. Minor gaps exist (e.g., no data masking or bulk processing), but the core functionality for offloading to budget models is complete.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Deterministic AI agent microtools, no accounts/API keys. fetch_extract: 98% token cut. 38 tools.
Cost-optimized LLM model routing recommendations for autonomous AI agents
SaaS intelligence for AI agents. 5 unified tools cover 1,000+ services with 91-96% token savings.
Check if a task runs locally vs cloud. Save money on calls that don't need cloud inference.
Related MCP Servers
- AlicenseAqualityDmaintenanceOptimizes token costs by intelligently delegating low-complexity tasks to local LLMs via LiteLLM, enabling cost-effective development workflows.31MIT
- FlicenseAqualityDmaintenanceRoutes commodity NLP tasks like summarization and translation to free-tier LLMs, saving Claude tokens for complex work.12-
- AlicenseNot gradedqualityFmaintenanceProvides context management, task classification, and routing tools for small models (1B-12B) in production agentic workflows.1MIT
- AlicenseAqualityBmaintenanceEvaluates task suitability for local models before cloud API calls, routing to Ollama or similar to reduce costs.1185MIT