# Replit SSH MCP server

> Allows an AI client to read, write, list, search, and manage files on Replit projects via SSH and SFTP.

- Repository: https://github.com/mindstone/mcp-servers
- Page: https://hostedmcp.org/servers/mindstone/mcp-server-replit-ssh
- Transport: stdio
- Stars: 14
- Latest version: 0.2.2

## Install

### Claude Code

```sh
claude mcp add mcp-server-replit-ssh -- npx -y @mindstone/mcp-server-replit-ssh
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-server-replit-ssh": {
      "command": "npx",
      "args": [
        "-y",
        "@mindstone/mcp-server-replit-ssh"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-server-replit-ssh": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@mindstone/mcp-server-replit-ssh"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-server-replit-ssh","type":"stdio","command":"npx","args":["-y","@mindstone/mcp-server-replit-ssh"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-server-replit-ssh": {
      "command": "npx",
      "args": [
        "-y",
        "@mindstone/mcp-server-replit-ssh"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-server-replit-ssh -- npx -y @mindstone/mcp-server-replit-ssh
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp-server-replit-ssh]
command = "npx"
args = ["-y", "@mindstone/mcp-server-replit-ssh"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp-server-replit-ssh npx -- -y @mindstone/mcp-server-replit-ssh
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-server-replit-ssh": {
      "command": "npx",
      "args": [
        "-y",
        "@mindstone/mcp-server-replit-ssh"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `MCP_REPLIT_SSH_KNOWN_HOSTS_PATH` | no | no | Explicit path to the connector's SSH known-hosts file. Defaults to $MCP_WORKSPACE_PATH/.replit-ssh-known-hosts, then $HOME/.replit-mcp/known_hosts. |
| `MCP_REPLIT_SSH_STRICT_HOST_KEY` | no | no | Set to 1 to require pre-populated known-hosts entries. When unset (default), unknown hosts are recorded on first contact (OpenSSH `accept-new` behaviour); a fingerprint mismatch always fails closed. |
| `REPLIT_SSH_REQUEST_TIMEOUT_MS` | no | no | Optional per-request timeout in milliseconds (default 60000, max 600000). |

## Tools (9)

- `replit_check_connection`: Check SSH connectivity to a Replit project. Verifies the connection works and reports the working directory, SFTP support, and server information. Use this to validate setup before file operations. Set verbose=true for detailed diagnostics when troubleshooting auth or connection failures. (read-only)
- `replit_list_files`: List files and directories in a Replit project path. Returns file names, sizes, and types (file/directory). Use "." for root or specify a subdirectory path. (read-only)
- `replit_read_file`: Read the contents of a file from a Replit project. Returns the file content as text. For binary files, returns base64-encoded content. (read-only)
- `replit_search_files`: Search a Replit project for files by name substring and/or text content substring (case-insensitive). Recursive from the given path with result caps; returns matching paths and, for content matches, the matching lines. Use this to find where a name, key, or string is used without reading every file. (read-only)
- `replit_stat`: Get metadata for a file or directory in a Replit project without reading its contents: type, size, permissions, and modification/access times. (read-only)
- `replit_write_file`: Write content to a file in a Replit project. Creates parent directories if needed. Uses atomic write (temp file + rename) and verifies the write by reading back. For binary files (images, etc.), pass base64-encoded content with encoding "base64".
- `replit_move`: Move or rename a file or directory within a Replit project. Never overwrites: fails if the destination already exists. The destination parent directory must already exist.
- `replit_delete_file`: Permanently delete a file from a Replit project (files only, not directories). Deletion is irreversible — there is no trash. Enabled by default; approval gating is the responsibility of the host tool-approval layer.
- `replit_setup_ssh`: Set up SSH keys and configuration for connecting to Replit projects. Generates an Ed25519 key pair, configures ~/.ssh/config, and provides the public key for the user to add to their Replit account. Safe to run multiple times — skips steps already completed.

## FAQ

### How do I set up SSH access for Replit?

You can run the `replit_setup_ssh` tool once to generate an Ed25519 key pair and automatically configure your local SSH config.

### Is file writing safe?

Yes, writes are atomic using a temporary file and rename process, followed by a SHA-256 read-back verification to ensure integrity.

### Can I search for specific text within my Replit files?

Yes, the `replit_search_files` tool allows for recursive searching by filename or text content (case-insensitive).
