Mcp reconnect
Reconnect MCP servers in Claude Code tmux sessions after code deployments or server restarts. Use when MCP servers need reconnecting and sessions are running inside tmux.From its SKILL.md
npx -y skills add palios-taey/mcp-reconnect --skill mcp-reconnectAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.4 KB, as published. Nobody here has run it
MCP Reconnect
You have access to the mcp-reconnect script that automates MCP server reconnection in Claude Code tmux sessions.
When to use this
- After deploying new MCP server code
- After MCP server processes are killed or restarted
- When Claude Code sessions show MCP connection errors
- During automated deploy workflows that restart services
How it works
Claude Code has no programmatic API for MCP reconnect. The only way is through the interactive /mcp menu. This skill automates that sequence via tmux send-keys:
- Escape — stop any active generation
- /mcp + Enter — open the slash command menu
- Enter — enter the menu
- Down + Enter — select "Reconnect" (2nd option)
- Continuation prompt — tell Claude to resume work
Usage
Run the script from the plugin's bin directory:
# Reconnect all local Claude tmux sessions
mcp-reconnect
# Reconnect specific sessions
mcp-reconnect session-name-1 session-name-2
# Reconnect sessions on a remote host
mcp-reconnect --remote hostname
# Delayed start (when calling from within a Claude Code session)
nohup mcp-reconnect --delay 10 &>/dev/null & disown
Critical design constraints
- Sequential only — never run reconnect in parallel across sessions. Parallel instances cause
/mcp/mcpdouble-typing and kill sibling sessions. - Detached with delay — when calling from within a Claude Code session, you MUST use
nohup+disownwith--delayso the Bash tool returns before Escape hits the calling session. - tmux required — this only works with Claude Code sessions running inside tmux.
- Conservative timing — the default settle times (5s/2s/5s) are tuned to avoid missed keystrokes. Do not reduce without testing.
Flags
| Flag | Default | Description |
|---|---|---|
--remote HOST | — | Reconnect on a remote machine via SSH |
--delay N | 0 | Wait N seconds before starting |
--settle-esc N | 5 | Seconds after Escape |
--settle-mcp N | 2 | Seconds after /mcp submit |
--settle-select N | 5 | Seconds after Reconnect selection |
--message MSG | (default) | Override continuation prompt |
--dry-run | — | Preview without sending keys |