Troubleshooting¶
Solutions to common issues.
First step for any problem
Run the proxy by hand, with debug logs, using the same config your IDE uses:
Logs go to stderr unless you pass --log-file. Many IDEs also show the
stderr of an MCP server in their MCP log view.
Common Issues¶
Server Won't Start¶
Symptoms: the IDE shows the LeanProxy MCP server as failed, or
server run exits right away.
Solutions:
- Read the error. Frequent ones:
no servers configured in <path>: the config file is missing or empty. Add a server (Quick Start), or point to the right file (see Configuration Not Loading).failed to load config: validate config: server x: url is required for sse transport: fix the named server.httpandsseservers both needhttp.url; there is nosse:block.exec: "npx": executable file not found in $PATH: the server's command is not on thePATHLeanProxy sees (see Server Command Not Found).
- Check one upstream server on its own. This starts a temporary copy of the server and runs the MCP handshake:
- Run the server's command by hand, outside LeanProxy:
- If the server needs an API key or another variable, check that it
receives it. A stdio server gets only a minimal environment, plus what
you list in
envandenv_passthrough: See Child Process Environment.
Server Command Not Found When Started From an IDE¶
Symptom: everything works in a terminal, but the IDE cannot start
LeanProxy ("command not found", ENOENT), or LeanProxy logs
executable file not found in $PATH for an upstream server built on
npx/uvx.
Why: GUI apps such as Claude Desktop do not load your shell profile, so
their PATH lacks /opt/homebrew/bin, ~/.local/bin, nvm directories, and
so on. LeanProxy and the servers it starts inherit that PATH.
Solutions:
- Use the absolute path of
leanproxy-mcpin the IDE config (which leanproxy-mcpprints it). - Give LeanProxy a full
PATHin the IDE config. For Claude Desktop: - Or use absolute commands in
leanproxy_servers.yaml(command: /opt/homebrew/bin/npx), and setPATHfor that server withstdio.env: ["PATH=/opt/homebrew/bin:/usr/bin:/bin"]when the command starts other programs (npxstartsnode).
Server Disconnects or Stops Responding¶
Symptom:
An MCP server (e.g. garmin) stops responding mid-session. Tool calls hang
or return "request timed out".
Current behavior (auto-recovery):
With auto-reconnect enabled (default), LeanProxy-MCP handles these cases automatically:
- Crash recovery: if a
stdioprocess exits unexpectedly it is respawned with exponential backoff, and the restart budget resets after a server stays up forstable_window. - Liveness probe: idle/running servers are pinged every
health_check_interval;health_check_failuresconsecutive failures trigger a restart. Pings are MCP pings and do not consume AI tokens. - Transport recovery:
http/sseservers reconnect transparently when the connection drops, and the next tool call re-establishes a dead session. - Request retry: if a request lands on a server that is recovering, it waits briefly for the restart to finish instead of failing permanently. For
http/sse, a request that fails on a genuine transport error is retried once after the reconnect.
Older versions had two bugs that caused this symptom: a fresh stdio
server was stopped by the idle timer about 30 seconds after start, and a
restarted server never answered. Both are fixed; upgrade if you see this
on an old version.
If a server still appears stuck:
-
Check the logs for restart activity:
-
Confirm the server works standalone (use the command from your config):
-
Tune the recovery knobs if the defaults are too aggressive or too slow (see Auto-Reconnect configuration).
-
As a last resort, disable auto-reconnect if it is interfering with a specific server:
Redaction Not Working¶
Symptom: Sensitive data still appears in tool arguments or results.
Solutions:
-
Check that redaction is on. It is on unless
bouncer.enabled: false: -
Check that the secret matches a built-in pattern. There are 29, and there is no email or phone-number detection:
-
If it does not, add a custom pattern. The block is
For random-looking tokens without a known prefix, you can also turn on the high-entropy detector withbouncer::bouncer.entropy_detection: true. -
Validate the patterns. Pass
--config: this command defaults to./leanproxy.yamlin the current directory: -
Restart the proxy. A running proxy does not reload its config.
High Token Usage¶
Symptom: Token usage is not decreasing.
Solutions:
-
Check which exposure mode your client gets. Claude Code, Claude Desktop, Cursor and VS Code get every tool directly (passthrough) and do their own tool search, so the router savings do not apply to them (exposure modes).
-
See what LeanProxy measured:
-
Large tool results are not trimmed unless you turn on the response governor (
response.enabled: true, see Configuration). -
Watch what happens with debug logs:
There is no dry-run mode for the proxy: the global --dry-run flag has no
effect on server run.
IDE Connection Issues¶
Symptom: IDE cannot connect to LeanProxy-MCP.
Solutions:
-
Verify installation:
-
Check the IDE configuration. The command must be
leanproxy-mcp server run --stdio, neverserve. For clients that usemcpServers(Cursor, Claude Desktop):VS Code uses a different file and key; see Connect your client.{ "mcpServers": { "leanproxy": { "command": "leanproxy-mcp", "args": ["server", "run", "--stdio"] } } } -
If the IDE cannot find the binary, see Server Command Not Found.
-
Restart the IDE or reconnect the MCP server.
Configuration Not Loading¶
Symptom: Config changes have no effect.
Solutions:
-
Restart the proxy.
server runreads the config once, at start. -
Check which file is used. The default is
~/.config/leanproxy_servers.yaml.LEANPROXY_CONFIGoverrides it, andserver run --configoverrides both:server listshows the servers from that file. Remember that the IDE starts LeanProxy with its own environment, which may not include aLEANPROXY_CONFIGyou set in your shell. See Config File Locations. -
Check that the file loads.
Unknown keys are ignored without a warning, so check the spelling of any setting that seems to have no effect.server runprints any validation error and exits: -
For a security-focused view of the loaded settings (
doctorignoresLEANPROXY_CONFIG, so pass--configif you use another file):
Cache Issues¶
Cache Empty After List Tools¶
Symptom:
list_tools returns no results or tools are not cached.
Solutions:
-
Check cache location:
-
Verify the
list_toolstool works:printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_tools","arguments":{"server_name":"garmin"}}}\n' | leanproxy-mcp server run --stdio -
Check logs for errors:
-
Clear and rebuild cache:
Cache Not Persisting¶
Symptom: Cache files exist but are empty or disappear after restart.
Solutions:
-
Check that you own the directory. LeanProxy creates it with mode 0700 (owner only); keep it that way:
-
Check
LEANPROXY_TOOLCACHE_DIR. When set, the cache lives there instead. -
Verify disk space:
Status File Issues¶
status --running Shows "No running leanproxy instance found"¶
Symptom:
LeanProxy is running, but leanproxy-mcp status --running shows no
instances.
Solutions:
-
Check if the status file exists:
-
Check that the running instance wrote it recently:
-
Make sure the IDE runs the binary you think it runs:
status without --running does not look at running instances: it starts
every enabled server itself to check it.
Status File Not Updated¶
Symptom: Status file exists but shows stale data.
Solutions:
-
Look for old processes:
-
Restart the IDE (or its MCP server), then check again:
Debug Mode¶
There is no --debug flag. Use --log-level debug (or -v):
Doctor Command¶
leanproxy-mcp doctor on its own only prints help. Use a subcommand:
| Command | What it checks |
|---|---|
leanproxy-mcp doctor security |
Local, read-only security report mapped to the OWASP MCP Top 10: redaction and custom patterns, injection guard, policy, tool pinning, sandbox, exposure, HTTP front end, token file permissions. Add --json or --markdown |
leanproxy-mcp doctor env |
Per stdio server, which environment variables are passed and which are dropped (names only) |
leanproxy-mcp doctor sandbox |
Per stdio server, its container sandbox status |
doctor does not test network connectivity or check that server commands
are installed. Use leanproxy-mcp server health <name> for that.
Getting Help¶
- GitHub Issues: https://github.com/mmornati/leanproxy-mcp/issues
- Documentation: https://mmornati.github.io/leanproxy-mcp/