Skip to main content
Glama

LocalTokens

Turn your machine — or your whole LAN of ollama nodes — into a local token generator for coding agents. An MCP server that lets Claude Code, opencode or codex delegate bounded processing tasks to local models, cutting cloud-credit usage while the agent keeps doing the thinking.

Pure Python stdlib. Zero dependencies. One file of config (optional).

Why

A large share of daily agent spend goes to work that doesn't need a frontier model: first-pass code review, summarising files, boilerplate, format conversions, commit messages. LocalTokens moves that work to your own hardware with two real levers:

  1. File-aware tools — the agent sends paths, never contents. Files are read locally and go straight to the local model: they never enter the agent's context window.

  2. Local generation — bulk output is produced by your nodes; the agent only reviews the result.

Unlike single-node delegation servers, LocalTokens speaks to a pool of nodes: tasks fan out across your LAN in parallel, with per-task failover, round-robin with random start (multiple agent sessions won't stampede one node), and your workstation's ollama used only as a last resort so it never becomes the straggler.

Savings are measured, not assumed — every call logs two honest counters (input reading avoided vs. output generated locally, which is re-read as input) to a JSONL ledger; the estado tool reports totals.

Related MCP server: local-executor-mcp

Tasks, not prompts

Tool

Task

Fan-out

procesar

one bounded task (boilerplate, docstrings, commit msg…)

1 node

lote

N independent tasks at once

1 node per task

revisar_archivos

first-pass code review of file paths

1 node per file

resumir_archivos

summarise/extract from files

1 node per file

estado

pool health + accumulated savings

Install

pip install -e .            # or: pipx install .
ollama pull qwen2.5-coder:7b llama3.2:3b   # on each node you'll use

# Claude Code
claude mcp add --scope user localtokens localtokens

# codex
codex mcp add localtokens -- localtokens

# opencode (~/.config/opencode/opencode.json)
# "mcp": { "localtokens": { "type": "local", "command": ["localtokens"] } }

Then let it configure itself:

localtokens init            # detects CPU/RAM/GPU, scans your LAN for
                            # ollama nodes, recommends models for your
                            # hardware and writes the config
localtokens init --solo-mostrar     # report only, write nothing
localtokens init --sin-escanear     # skip the LAN scan (localhost only)
localtokens init --rango 10.0.0.0/24  # scan a specific subnet

init detects your local CPU, RAM and GPU (nvidia-smi/rocm-smi), probes your subnet for ollama nodes (TCP port 11434, two passes), inventories which models each node serves, and recommends models your hardware can actually run — a 24 GB GPU gets qwen2.5-coder:32b, a 2013 CPU-only box gets qwen2.5-coder:1.5b. Existing config is backed up before writing.

Prefer manual setup? Copy config.example.json to ~/.config/localtokens/config.json and list every node (first entry = the machine you work on; it is deliberately deprioritised). On each remote node, run ollama reachable from the LAN: OLLAMA_HOST=0.0.0.0:11434 ollama serve.

An optional agent skill that teaches when to delegate ships in skills/localtokens/SKILL.md — copy it to ~/.claude/skills/localtokens/.

Design notes

  • The agent supervises: local output is volume, not judgment. Bounded, self-contained tasks only — architecture decisions stay with the agent.

  • Responses are capped (20 KB default) so a 12-file review cannot blow up the very context it is saving; per-file input is capped at 24 KB.

  • A background pre-warm loads models on remote nodes at server start, so the first task of the day doesn't look like a hang.

  • Path guardrail (exact directory segments + filename patterns) refuses .ssh, .env, keys, credentials. It is a guardrail against accidents, not a sandbox; contents travel over plain HTTP on your LAN.

Related work: houtini-lm, mcp-local-llm, claude-code-router. LocalTokens's differentiator is the parallel multi-node pool.


Español

Convierte tu máquina — o tu red local de equipos con ollama — en un generador de tokens locales para agentes de código. El agente delega tareas de procesamiento acotadas (no prompts a modelos concretos): LocalTokens decide modelo, nodo y reparto en paralelo con failover.

Las dos palancas de ahorro: los archivos se leen localmente (nunca pasan por el contexto del agente) y la generación de volumen la hacen tus nodos. El ahorro se mide en dos cuentas honestas por llamada (tokens_lectura y tokens_generacion) en un registro JSONL.

Instalación: pip install -e ., luego registra localtokens en tu cliente (arriba los tres comandos). Sin configuración usa localhost:11434; con ~/.config/localtokens/config.json listas todos tus equipos (la primera URL = tu máquina de trabajo, que queda al final de la rotación a propósito). Código y herramientas en español — nació en el proyecto ECO, construido en español por diseño.

License

MIT

Available Tools

5 tools
estadoA

Salud del cluster y total de tokens cloud ahorrados.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries full burden. It indicates a read operation (health and tokens saved) but lacks details on authentication, rate limits, or potential side effects. For a simple status tool, this is adequate but not exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no filler. Front-loaded with purpose. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and no output schema, the description is nearly complete. It specifies return values (health and tokens). However, it could clarify what 'salud del cluster' encompasses or token units. Still, it meets the minimal bar for a simple query tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters means the schema is fully covered (100%). Per guidelines, baseline is 4 for no parameters. The description adds no parameter info, which is appropriate as none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns cluster health and total cloud tokens saved. This specific verb+resource pairing distinguishes it from siblings like 'lote' (batch) and 'procesar' (process) which handle file operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternative tools. Given sibling tools exist (lote, procesar, etc.), the description should provide context on usage boundaries or comparison.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

loteC

Delega VARIAS tareas independientes a la vez: se reparten entre los nodos del cluster y corren en paralelo.

ParametersJSON Schema
NameRequiredDescriptionDefault
tipoNo
tareasYes
contextoNo

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavior. It mentions parallel execution and distribution, but omits critical details: whether it's blocking, error handling, or side effects. The agent lacks information on tool behavior beyond parallel execution.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but lacks structure. It could be improved by separating purpose and behavior into clear points. No waste, but it's underspecified.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given three parameters and no output schema, the description is incomplete. It doesn't clarify return values, required configurations, or how to use parameters. The tool is complex (batch execution) but documented minimally.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description should explain parameters. It only references 'tareas' implicitly, not 'tipo' or 'contexto'. The agent cannot infer what these parameters mean from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: delegating multiple independent tasks to run in parallel across cluster nodes. The verb 'Delega' and resource 'VARIAS tareas independientes' are specific. While it doesn't explicitly differentiate from siblings, the batch nature is evident.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'procesar' or 'revisar_archivos'. The description implies it's for independent tasks but doesn't specify prerequisites or conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

procesarB

Delega UNA tarea de procesamiento acotada al cluster local (0 tokens cloud). Pasa rutas en archivos en vez de pegar su contenido: se leen localmente. Para: boilerplate, docstrings, conversiones de formato, mensajes de commit, borradores.

ParametersJSON Schema
NameRequiredDescriptionDefault
tipoNo
archivosNo
contextoNo
instruccionYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions files are read locally and tasks are bounded, but it does not disclose side effects (e.g., file modification), authorization needs, error behavior, or whether the tool returns results or just triggers processing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single paragraph that front-loads the main purpose and provides concrete examples. It is concise but could benefit from bullet points for use cases. No filler sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations, output schema, and schema descriptions, the description is insufficient. It omits return value details, synchronous/asynchronous behavior, error handling, and does not fully explain all parameters. The tool's processing nature requires more context for safe use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains that 'archivos' should be file paths instead of content, adding value beyond the schema. However, it does not clarify the 'tipo' enum (codigo vs texto), 'contexto', or the required 'instruccion' in enough detail. Since schema description coverage is 0%, the description partially compensates.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool delegates a bounded processing task to the local cluster, and lists specific use cases (boilerplate, docstrings, format conversions, etc.). It distinguishes the tool from siblings implicitly by focusing on local, single-task processing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description advises to pass file paths instead of content, and mentions '0 tokens cloud' for cost awareness. However, it does not provide explicit when-to-use or when-not-to-use scenarios, nor does it mention alternatives among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

resumir_archivosA

Resume o extrae información de archivos por ruta (en paralelo) sin que pasen por tu contexto.

ParametersJSON Schema
NameRequiredDescriptionDefault
rutasYes
instruccionNo

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description alone carries the burden. It discloses parallel execution and that files do not pass through the context, which is useful. However, it omits many behavioral traits: required permissions, file size limits, supported formats, whether it's read-only (likely safe), or error behavior. The disclosure is insufficient for safe and correct invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, well-structured sentence that front-loads the action and key constraints ('en paralelo', 'sin que pasen por tu contexto'). Every word contributes meaning; no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 2 parameters, no output schema, and no annotations, the description covers the core function, parallelism, and context behavior. It lacks details on return format, error handling, and file type support, but these are secondary for a summarizing tool. The description is mostly complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It relates 'rutas' to file paths and 'instruccion' to the extraction instruction, adding meaning beyond the raw schema. However, it does not specify path format (absolute/relative) or allowed instruction formats (natural language vs. specific syntax). The description provides a baseline but not full compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: summarizing or extracting information from files by path, emphasizing parallel execution and not passing files through the context. This differentiates it from siblings like 'procesar' (full processing) and 'revisar_archivos' (review). The verb 'Resume o extrae' and resource 'archivos por ruta' are specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to extract info without full file loading ('sin que pasen por tu contexto'). However, it does not explicitly state when to avoid this tool (e.g., when full file content analysis is needed) or mention alternative siblings. Usage context is implied but lacks explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

revisar_archivosB

Primera pasada de code review sobre rutas de archivos (un nodo por archivo, en paralelo). Devuelve solo los hallazgos: los archivos no pasan por tu contexto.

ParametersJSON Schema
NameRequiredDescriptionDefault
rutasYes
enfoqueNo

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description bears full burden. It mentions parallelism and that files are not added to context, which are useful behavioral traits. However, it omits details on authorization needs, side effects, or return format, leaving gaps in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise at two sentences with no extraneous content. It front-loads the purpose and key behavioral notes. However, it could be slightly more structured with bullet points or explicit separations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

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 and only two parameters with no description, the description is incomplete. It does not explain the return format, how findings are structured, or how 'enfoque' affects behavior. Essential context for a code review tool is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the description adds no meaning beyond parameter names ('rutas' and 'enfoque'). The 'enfoque' parameter is not explained, and 'rutas' lacks format or constraints. The description fails to compensate for the lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it is a first pass of code review on file paths, running in parallel per file, and returning only findings. This distinguishes it from sibling tools like 'estado' or 'procesar' by specifying its role as an initial review step.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage as a first step ('primera pasada') and that files do not pass through context, but it does not explicitly state when to use this tool versus siblings or provide scenarios to avoid. More explicit guidance would improve clarity.

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.

  1. 5 tool updatesv1.2.0
    • First observedestado
    • First observedlote
    • First observedprocesar
    • First observedresumir_archivos
    • First observedrevisar_archivos

TDQS

B3.3/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct operation: cluster health, batch parallel tasks, single processing, summarization, and code review. No overlaps; descriptions clarify differences.

Naming Consistency3/5

Tool names mix nouns (estado, lote) and verbs (procesar, resumir_archivos, revisar_archivos). While the verb_noun pattern is consistent for two tools, the overall pattern is inconsistent.

Tool Count5/5

Five tools is well-scoped for the server's purpose of local cluster processing and file analysis. Each tool serves a necessary function without bloat.

Completeness4/5

Covers core workflows: cluster health, batch and single task processing, summarization, and code review. Missing job management (e.g., cancel/status) is a minor gap but not critical.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers