An MCP Server that works with Roo Code/Cline.Bot/Claude Desktop to optimize costs by intelligently routing coding tasks between local LLMs free APIs
Most planning and project tracking work still happens through a UI a human drives. LocaLLama MCP server moves it into the conversation instead. An MCP Server that works with Roo Code/Cline.Bot/Claude Desktop to optimize costs by intelligently routing coding tasks between local LLMs free APIs and paid APIs.
Local-first, provider-neutral Model Context Protocol server for coding-agent workflows. Routes tasks across local models (Ollama, LM Studio, llama.cpp), free OpenRouter models, and paid frontier models using cost, latency, context capacity, and benchmark history.
LocalLama MCP reduces token costs without sacrificing quality. Tasks are queued asynchronously — route_task returns a task_id immediately; callers poll get_task_status for results. The decision engine chooses local → free → paid based on measured provider capabilities and configurable thresholds.
npm on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.
The server publishes 14 tools. What each one is for:
route_task — task, context_length, expected_output_length?, complexity?, priority?, preemptive?get_task_status — task_idcancel_task — task_idcancel_job — job_idpreemptive_route_task — task, context_length, expected_output_length?, complexity?, priority?get_cost_estimate — context_length, expected_output_length?, model?benchmark_task — task_id, task, context_length, expected_output_length?, complexity?, local_model?, paid_model?, runs_per_task?benchmark_tasks — tasks[], runs_per_task?, parallel?, max_parallel_tasks?benchmark_model — model_id, provider_id?, task_categories?retriv_init — directories[], exclude_patterns?, chunk_size?, force_reindex?, bm25_options?retriv_search — query, limit?reload_config — —Configuration is passed through the environment: LM_STUDIO_ENDPOINT, OLLAMA_ENDPOINT, DEFAULT_LOCAL_MODEL, TOKEN_THRESHOLD, COST_THRESHOLD, QUALITY_THRESHOLD, OPENROUTER_API_KEY, BENCHMARK_RESULTS_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.
Plenty of planning and project tracking servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. LocaLLama's toolset — route_task, get_task_status, cancel_task and 11 more — is a fair guide to whether it matches your workflow. It is maintained by Heratiki; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
| Tool | What it does |
|---|---|
| route_task | task, context_length, expected_output_length?, complexity?, priority?, preemptive? |
| get_task_status | task_id |
| cancel_task | task_id |
| cancel_job | job_id |
| preemptive_route_task | task, context_length, expected_output_length?, complexity?, priority? |
| get_cost_estimate | context_length, expected_output_length?, model? |
| benchmark_task | task_id, task, context_length, expected_output_length?, complexity?, local_model?, paid_model?, runs_per_task? |
| benchmark_tasks | tasks[], runs_per_task?, parallel?, max_parallel_tasks? |
| benchmark_model | model_id, provider_id?, task_categories? |
| retriv_init | directories[], exclude_patterns?, chunk_size?, force_reindex?, bm25_options? |
| retriv_search | query, limit? |
| reload_config | — |
| check_for_updates | — |
| update_server | — |
{
"mcpServers": {
"locallama": {
"command": "node",
"args": ["/path/to/locallama-mcp/dist/index.js"],
"env": {
"LM_STUDIO_ENDPOINT": "http://localhost:1234/v1",
"OLLAMA_ENDPOINT": "http://localhost:11434/api",
"DEFAULT_LOCAL_MODEL": "qwen2.5-coder-3b-instruct",
"TOKEN_THRESHOLD": "1500",
"COST_THRESHOLD": "0.02",
"QUALITY_THRESHOLD": "0.07",
"OPENROUTER_API_KEY": "your_openrouter_api_key_here"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| LM_STUDIO_ENDPOINT | Configuration value read at startup. | Optional |
| OLLAMA_ENDPOINT | Configuration value read at startup. | Optional |
| DEFAULT_LOCAL_MODEL | Configuration value read at startup. | Optional |
| TOKEN_THRESHOLD | Credential the server authenticates with. | Yes |
| COST_THRESHOLD | Configuration value read at startup. | Optional |
| QUALITY_THRESHOLD | Configuration value read at startup. | Optional |
| OPENROUTER_API_KEY | Credential the server authenticates with. | Yes |
| BENCHMARK_RESULTS_PATH | Filesystem location the server is allowed to use. | Optional |
Your workspace, on speaking terms with AI — search, read and write Notion pages and databases.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Search and read your Drive — Docs, Sheets and files become context your assistant can actually use.
Your assistant inside the workspace — read channels, search history, post messages and tame the noise.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Stop letting your assistant hallucinate n8n node parameters — this server hands it the real schemas, templates and validation.