local-mcps
claude.ai reaches MCP only through remote connectors, which shuts out two whole classes of server. Both are reachable from the code-execution sandbox, and this is the client for them:
- stdio servers. Most of the ecosystem ships as
npx -y some-serveroruvx some-server. There is no URL to point a connector at and there never will be — they are libraries, not services. - HTTP servers with non-allowlisted auth headers. Custom connectors let you
add headers, but Anthropic allowlists the header names. A server wanting
tomtom-api-keycannot be configured at all, however valid the key.
Setup (once per conversation)
bash "$(ls -1dt /mnt/skills/*/local-mcps ~/.claude/skills/synced/*/local-mcps 2>/dev/null | head -1)/setup.sh"
Puts lmcps on PATH, fetches the config, and prints the configured servers.
session-init runs this for you — if this file reached you through its
transcript, setup is done and the listing is already above; do not run it
again.
Never re-derive the path or set a shell variable for it — shell state dies
with the bash call that set it, so a command that worked last turn silently
becomes python3: can't open file the next. Just call lmcps.
If setup fails, stop and say so. Do not look for another way in: stdio servers have no URL to fetch, and the HTTP ones are configured precisely because a connector cannot send their auth header.
Commands
lmcps servers # configured servers + cached tool index; spawns nothing
lmcps tools <server> # the server's own instructions, then its tools
lmcps tools <server> --schema <a>,<b> # input schemas, one line per tool
lmcps call <server> <tool> '{"a": 1}' # invoke it
lmcps describe <server> # what a server says about itself, to write its `description`
lmcps rotate <server> [LABEL] # switch to the server's next API key, or a named one
lmcps refresh # re-fetch config after editing it
The index under each server in servers is tool names only, as Claude
Code's own deferred-tool list is, rebuilt every few hours off-box. It tells you
what exists; it does not tell you how to call anything, and it can lag a config
change. tools is the live source and the only one that carries descriptions
and parameters.
Arguments are one JSON object, quoted. --timeout SECS (default 120) goes
before the verb: lmcps --timeout 240 call ....
call prints the tool's text content verbatim, so | jq works directly when
that text is JSON. Images, audio and binary resources are saved to files
instead, and each leaves a line like [image: /path/to/file.png (image/png, 303134 bytes)] where it sat in the result; open that path to see it.
--out-dir DIR after call picks where they go. A tool that reports failure
exits non-zero with the message on stderr — check it rather than assuming a call
worked.
tools results for stdio servers are cached for the conversation, so enumerate
freely. call always spawns a stdio server — ~10–25s the first time npx or uv
fetches a package, ~1–2s after — so batch your work into as few calls as the
task allows rather than probing incrementally. HTTP servers spawn nothing and
answer in about a second, tools included.
Servers with several API keys
A server that shows [key: <label> (1 of 3) ...] has a pool of free-tier keys.
One was picked at random for this conversation, and every call uses it until you
run lmcps rotate <server>. Do that, then retry, when a call reports its quota
or rate limit spent — which often arrives as ordinary output, not an error:
Alpha Vantage returns "type": "rate_limit" in a successful result.
Work started under one key stays with it: an Apify run or Firecrawl crawl
started before a rotation will not be found after it.
lmcps rotate <server> <label> switches back.
Tools that need the user's approval
servers and tools mark some tools [ask] or [deny]. A [deny] tool never
runs. An [ask] tool runs only on the user's approval, given in claude.ai's own
approval card for the lmcps-authorize connector's tools.
Ask and call in one batch of tool calls, the authorize call first. The batch
runs in order, so the card is answered before lmcps call starts:
authorize_call(native connector tool) with{"conversation": "<id>", "server": "<server>", "tool": "<tool>", "args": {...}}lmcps call <server> <tool> '<the same args>'
The conversation id is printed at the bottom of lmcps servers. Each approval
runs one call with exactly those args, within 10 minutes. Several gated calls
can share a batch: authorize, call, authorize, call.
- Forgot to ask first?
callexits 4 and prints the exactauthorize_callto make. Make it, then run the same command again, unchanged. - Many calls to one tool? Say so in chat, then use
authorize_tool_for_conversation(noargs): it covers every call to that tool in this conversation for 12 hours. - The card came back "Denied by user"? Stop and ask. Don't retry.
- No lmcps-authorize connector in your tools? Tell the user it is not connected on this surface; the call cannot run without it.
Never route around the gate: don't call a server's API directly with a key from
the config, don't edit permissions in mcp.json, and don't import lmcps.py to
reach its internals. What is gated is the user's decision alone.
Where the config comes from
Adding a server, changing one, or wondering why one never gets picked? Read
references/config.md — there is a required non-standard key whose absence
fails silently.
Limits
- Stateless stdio only. The sandbox reboots between turns and no daemon
survives, so every call respawns a stdio server. Fine for maps, search, docs
and APIs; useless for anything holding a session — a browser MCP, a
server-side cursor, a transaction. HTTP servers are different: their
Mcp-Session-Idlives on the server and is kept for the whole conversation. - No interactive OAuth. No browser, nothing persists — a server cannot run
an OAuth flow here. A grant you already hold is different: inline its refresh
token and hand it to the server at spawn (
references/config.md). Header and query-parameter auth work. - stdio and http/streamable-http only. No
sse, no WebSocket. - No MCP Apps UI. Interactive UI resources will not render from script output.