agentleFS
zedarvateszedarvates/botte-secrete/skills/llm_mcp/SKILL.md

llm_mcp

Skill2 starsChanged 3 months agoMITView on GitHub

MCP server that lets Claude Code (or any MCP client) discover and call local LLM servers (LM Studio, Ollama, …) as tools, to offload cheap tasks off the cloud. Use when the user wants to wire local models into their agent, register an MCP server, or have the agent automatically route simple tasks to local hardware.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add to .mcp.json at the project root (an example ships at configs/mcp.example.json):

    line 30

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

llm_mcp — Local LLM tools over Model Context Protocol

Exposes [[llm_backends]] as MCP tools so an agent can route work to local models on its own. Pure stdlib, stdio JSON-RPC 2.0, no dependencies.

Tools exposed

ToolPurpose
discover_backendsScan localhost/network, register reachable LLM servers
list_modelsList models the registered backends expose
audit_local_usageLocal-usage report + hardware-aware setup steps
route_taskRecommend cheapest tier + a concrete local backend/model
local_chatRun a prompt on a local model (0 cloud tokens)
auto_routeDecide and optionally execute the cheapest capable route
route_feedbackVerify an executed route by its feedback_id
qa_statusShow verified quality-memory maturity and its next step
qa_task_statusExport a passive, non-terminal status observation for a task plane
qa_adviseExplain a shadow-only k-NN route suggestion or abstention
qa_recordAdd an externally verified outcome without raw task storage
compressCompress context; reversible calls add deduplicated verified grounding labels

Register in Claude Code

Add to .mcp.json at the project root (an example ships at configs/mcp.example.json):

{
  "mcpServers": {
    "botte-llm": {
      "command": "python",
      "args": ["-m", "skills.llm_mcp.server"],
      "cwd": "/absolute/path/to/botte-secrete"
    }
  }
}

Then in a session: "discover my local backends", "classify these 50 tickets locally", "is local routing active?" — the agent calls the tools directly.

Lazy tool loading (default on)

The server has grown to dozens of tools; injecting every full JSON Schema into an agent's context costs thousands of tokens on every turn, whether or not that turn uses them — [[context_profiler]] measured it as the single biggest slice of always-on prefix on this repo. So tools/list returns only a small core (local_chat, auto_route, find_skills, conduct) plus a find_tool(query) meta-tool — the same pattern this very harness uses (ToolSearch). Call find_tool to discover anything else; a strong match returns the full schema in one round trip. tools/call still dispatches any tool by name regardless of what was listed — lazy loading only shrinks the catalog, not what's callable.

Measured saving: ~3.3k tokens (84% of the tool-schema cost). Disable with BOTTE_MCP_LAZY_TOOLS=0 for a client that expects the full catalog upfront.

Manual smoke test

printf '%s\n' \
 '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{}}}' \
 '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
 '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"local_chat","arguments":{"prompt":"ping","max_tokens":16}}}' \
 | python -m skills.llm_mcp.server

Token strategy

Tell the agent: route classification / extraction / short summaries through local_chat, keep architecture & security reasoning on the cloud. That single rule typically moves 30-50% of calls to zero-cost local inference.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.