Skip to main content
macOS only · Pro
The AI code editor built on VS Code

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.

Cursor is a code editor built on VS Code around an AI agent. Through MCP it can call outside tools, and SSHive's server gives it 20: list the SSH sessions open in SSHive, run commands, browse, read and write files over SFTP, and move large files in the background without passing them through the model's context. It only reaches sessions connected in SSHive, over the connection SSHive made, so Cursor never holds your SSH credentials. The server listens on 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. 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. 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.json to use SSHive in every project, or into .cursor/mcp.json at the root of one project. If the file already lists servers, add the sshive entry inside the existing mcpServers object. 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. 3

    Restart Cursor and check the tools

    Restart Cursor, or reload its window, so it reads the file again. sshive should 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. 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, runs docker ps through ssh_execute and answers.

What to ask Cursor once connected

You ask

"Refactor this Dockerfile to match the package versions actually installed on prod."

What happens

Cursor gets apt list --installed through ssh_execute on the prod session, compares it with your Dockerfile and proposes the smallest set of changes.

You ask

"Generate the docker-compose.yml from the compose stack running on staging."

What happens

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.

You ask

"Look at the last 500 lines of the api-gateway logs on prod and explain the 500 errors."

What happens

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

Cursor is strongest when it writes code and weakest when it has to guess what is deployed. Your repository and your servers drift apart, and without help Cursor cannot see the gap. SSHive's server closes it: Cursor edits the code, SSHive supplies the facts from the running machines, and the change fits reality the first time rather than after a failed deploy. The security trade-off is reasonable. The sessions are already authenticated in SSHive, on the Mac where Cursor runs, so Cursor never handles credentials. The server answers on the loopback interface only, and only to requests that carry the token, so another program on the Mac would need that token too. And MCP is an open protocol: you can switch the server off, move to Claude Code or another client, or check exactly which tools are exposed, whenever you like.

Frequently asked questions

Can Cursor run a destructive command by accident?+
By default, Cursor asks for your approval before it uses an MCP tool, 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?+
Yes. The agent uses the MCP tools listed under Available Tools when they are relevant, and it can chain several SSHive calls, for example 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?+
Either works. ~/.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?+
Cursor reaches SSHive on your Mac, and SSHive reaches your servers; nothing relays that traffic. But the command output and file contents Cursor reads become part of the conversation, which Cursor sends to its model provider along with your code. Treat them the way you treat code you paste into the chat.

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