Cursor + SSH through SSHive's MCP server
By Lucas Russo, developer of SSHive · Updated
Let Cursor check your running servers while it edits code: list containers, read logs, compare configs over SFTP. Local MCP server, no relay in between.
127.0.0.1 only.
The pairing pays off when the code depends on remote state: a Dockerfile that should match what apt list --installed reports on the host, an nginx config that has to match the deployed one, a migration that needs to know which tables exist. Instead of guessing, or asking you to paste, Cursor asks SSHive. Setting it up takes one JSON block, copied from SSHive and pasted into Cursor's MCP file.Set up Cursor with SSHive in 4 steps
- 1
Turn on the MCP server in SSHive
In SSHive, open Settings > MCP and turn on "Enable MCP server"; the Bearer token is created at that moment. Leave the panel open, the block for Cursor is in it. MCP is part of Pro.
- 2
Paste the JSON block into Cursor's MCP file
SSHive shows the block for Cursor with your real token in it; the one below has
<your-token>in its place. Paste it into~/.cursor/mcp.jsonto use SSHive in every project, or into.cursor/mcp.jsonat the root of one project. If the file already lists servers, add thesshiveentry inside the existingmcpServersobject. SSHive does not write this file for you, because an App Store app is not allowed to.Copy this{ "mcpServers": { "sshive": { "type": "http", "url": "http://127.0.0.1:49422/mcp", "headers": { "Authorization": "Bearer <your-token>" } } } } - 3
Restart Cursor and check the tools
Restart Cursor, or reload its window, so it reads the file again.
sshiveshould then appear with its tools under Available Tools: 20, or 17 while "Let the assistant open sessions" is off in SSHive. If it shows an error instead, the MCP logs in Cursor's Output panel (Cmd+Shift+U) say why; the usual causes are a wrong token or the server being off in SSHive. - 4
Connect the sessions Cursor should reach
In SSHive, connect to the servers Cursor should work on; it only sees connected sessions. Then ask in Cursor's chat: "Which containers are running on prod?" Cursor calls
ssh_list_sessions, picks prod, runsdocker psthroughssh_executeand answers.
What to ask Cursor once connected
"Refactor this Dockerfile to match the package versions actually installed on prod."
Cursor gets apt list --installed through ssh_execute on the prod session, compares it with your Dockerfile and proposes the smallest set of changes.
"Generate the docker-compose.yml from the compose stack running on staging."
Cursor reads the deployed compose file with sftp_read_file and the output of docker compose config with ssh_execute, then writes a clean compose file that matches what actually runs.
"Look at the last 500 lines of the api-gateway logs on prod and explain the 500 errors."
Cursor runs docker logs --tail 500 api-gateway 2>&1 through ssh_execute, picks out the requests that ended in a 500 and summarizes the stack trace behind them.
Why pair Cursor with SSHive
Frequently asked questions
Can Cursor run a destructive command by accident?+
ssh_execute included, and shows the call it wants to make. Cursor's run settings can let some tools run without asking; keep ssh_execute and the write tools on approval for sessions that point at production. On the SSHive side, Cursor only works on sessions you opened, unless you turn on "Let the assistant open sessions".Does it work with Cursor's agent?+
ssh_list_sessions, then ssh_execute, then sftp_read_file. Each call still waits for your approval unless you let that tool run on its own.Should SSHive go in the global file or in a project?+
~/.cursor/mcp.json in your home folder makes SSHive available in every project; .cursor/mcp.json at the root of a project limits it to that project. The token sits in the file in plain text, so keep a project-level file out of your Git repository.What happens to the output Cursor reads?+
Other clients and related pages
Claude Code + SSH through SSHive's MCP server
Anthropic's coding assistant, in the terminal and the IDE
Claude Desktop + SSH through SSHive's MCP server
Anthropic's desktop app for chatting with Claude
Try SSHive Free for macOS
Get the all-in-one SSH, SFTP, RDP and VNC client for Mac. Free download, no signup required.
Download SSHive Free