Replit SSH

io.github.mindstone由 GitHub 账号 mindstone 发布v0.2.2更新于 Oct 24, 2026

Read, write, list, and check files on Replit projects over SSH/SFTP, plus SSH key setup.

发布方自己的服务:Free Agent Economy Lab

概览

AI 生成的概览

让助手通过 SSH/SFTP 读取、写入、列出、搜索、移动和删除 Replit 项目中的文件,并可配置本地 SSH 密钥。

可以做什么
从操作者本机通过 SSH/SFTP 连接 Replit 项目主机,提供九个工具:连接检查、文件列表、文件读取、按文件名或内容的递归搜索、元数据查询、带 SHA-256 回读校验的原子写入、移动/重命名、文件删除,以及一次性生成 SSH 密钥并写入 ~/.ssh/config。读取上限为 1 MiB,二进制文件以 base64 返回,符号链接只报告不跟随。写入为原子操作并校验,移动不覆盖,删除不可恢复。
适用场景
适合助手需要从用户本机查看或修改 Replit 项目文件的场景,例如读取 package.json、列出项目目录树或搜索源码文件。它是本地连接器,更适合桌面端宿主,而非浏览器端。
运行要求
需要 Node.js 20+ 与 npm,通过 npx 或 node 本地运行。需要具备 SSH 访问权限的 Replit 账户(Replit Core 或更高)、可用的 *.replit.dev 主机与用户名,以及在 Replit 注册的 SSH 密钥。认证使用通过 ~/.ssh/config 解析的本地 SSH 密钥,无需环境变量密钥。可选变量:REPLIT_SSH_REQUEST_TIMEOUT_MS、MCP_REPLIT_SSH_STRICT_HOST_KEY、MCP_REPLIT_SSH_KNOWN_HOSTS_PATH。
安装前请注意
replit_delete_file 会永久删除文件(无回收站),默认启用并带有破坏性提示,需依赖宿主的工具审批机制把关。replit_write_file 与 replit_move 会修改远程项目数据。replit_setup_ssh 会写入 ~/.ssh/rebel-replit、其 .pub 文件与 ~/.ssh/config,force_regenerate 会替换现有密钥,需重新在 Replit 注册。仅接受 *.replit.dev 主机;除非设置 MCP_REPLIT_SSH_STRICT_HOST_KEY=1,未知主机密钥会在首次连接时被记录。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Replit SSH,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@mindstone/mcp-server-replit-ssh

[npm version] [License: FSL-1.1-MIT]

Replit SSH MCP server — read, write, list, search, stat, move, and delete files on Replit projects over SSH/SFTP, plus one-shot generation of the local SSH key and ~/.ssh/config block.

Local Replit SSH MCP. Connects from the operator's machine to *.replit.dev hosts only, writes are atomic with SHA-256 read-back, and the ~/.ssh/config rewrite parses via AST rather than Match exec shell evaluation.

Status

  • Version: 0.2.2 · npm
  • Auth: Local SSH key on disk (~/.ssh/rebel-replit by default; resolved via ~/.ssh/config IdentityFile if set). No env-var-supplied secrets.
  • Tools: 9 (connection, files, ssh-setup)
  • Surface: local-protocol
  • Machine-readable: STATUS.json

Why this exists

Replit ships a hosted "Agent" experience but does not publish an MCP server for the SSH/SFTP surface its Core users get. The community options at the time we built this either shelled out to the system ssh binary (so connection failures surfaced as generic non-zero exit codes) or parsed ~/.ssh/config with the upstream [email protected] package, which evaluates Match exec "<cmd>" blocks by running them through the shell — that is local code execution against any consumer that reads a user-controlled config file. We wrote our own so that the host application can read, list, and atomically write files on a Replit project from the operator's own machine, with a host allow-list pinned to *.replit.dev, a safe AST-only config evaluator, SHA-256 read-back verification on every write, and a structured recovery contract on every tool error.

Example interaction

"List the files in my Replit project, then read package.json and tell me which scripts are defined."

Tools the host calls:

  1. replit_check_connection — verifies SSH connectivity and SFTP support, returns latency.
  2. replit_list_files — lists files and directories at ..
  3. replit_read_file — reads package.json from the project root as UTF-8 text.

Response (trimmed):

json
{  "ok": true,  "files": [    { "name": "package.json", "type": "file", "size": 612 },    { "name": "src", "type": "directory" }  ],  "package": {    "scripts": {      "dev": "node src/index.js",      "test": "vitest run"    }  }}

Requirements

  • Node.js 20+
  • npm
  • A Replit account with SSH access (Replit Core or higher)
  • A live *.replit.dev host from a Replit project (open the project, click SSH → Connect → Connect manually, copy the host and username)
  • An SSH key registered with Replit at replit.com/account#ssh-keys. Run replit_setup_ssh once to generate one if you do not already have one.

One-click install

[Add to Cursor] [Add to VS Code] [Add to VS Code Insiders]

After clicking the button, your host will prompt you to fill: REPLIT_SSH_REQUEST_TIMEOUT_MS.

Manual config for Claude Desktop / Claude Code / Goose / Continue.dev (Replit SSH)
json
{  "mcpServers": {    "Replit SSH": {      "command": "npx",      "args": [        "-y",        "@mindstone/mcp-server-replit-ssh"      ],      "env": {        "REPLIT_SSH_REQUEST_TIMEOUT_MS": "60000"      }    }  }}

Quick Start

Install & build

bash
cd <path-to-repo>/connectors/replit-sshnpm installnpm run build

npx (once published)

bash
npx -y @mindstone/mcp-server-replit-ssh

Local

bash
node dist/index.js

Configuration

This server has no required environment variables. Authentication is via the local SSH key resolved through ~/.ssh/config.

Optional environment variables

  • REPLIT_SSH_REQUEST_TIMEOUT_MS — per-request timeout in milliseconds (default: 60000, max 600000). Tool-level timeout for SFTP operations; the lower-level TCP/SSH handshake uses a separate 30-second budget.
  • MCP_REPLIT_SSH_STRICT_HOST_KEY — set to 1 to require pre-populated known-hosts entries. When unset (default), unknown hosts are recorded on first contact (matches OpenSSH's StrictHostKeyChecking=accept-new); a fingerprint mismatch on a subsequent connect always fails closed regardless of this flag. See the SSH host-key verification entry in Security notes below.
  • MCP_REPLIT_SSH_KNOWN_HOSTS_PATH — explicit path to the connector's SSH known-hosts file. Defaults to $MCP_WORKSPACE_PATH/.replit-ssh-known-hosts, falling back to $HOME/.replit-mcp/known_hosts. The file is created with mode 0o600 and the parent directory with mode 0o700.

Host configuration examples

Claude Desktop / Cursor

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

Local development (no npm publish needed)

json
{  "mcpServers": {    "ReplitSSH": {      "command": "node",      "args": ["<path-to-repo>/connectors/replit-ssh/dist/index.js"]    }  }}

After the host launches the server, run replit_setup_ssh once to generate the local key, then add the printed public key to replit.com/account#ssh-keys.

Tools (9)

Read

  • replit_check_connection — verify SSH connectivity, working directory, and SFTP support. Set verbose=true for handshake/auth diagnostics.
  • replit_list_files — list files and directories at a path (relative to the project root). Default path is .. Entry types are file/directory/symlink (symlinks are reported as links, not followed — consistent with replit_stat).
  • replit_read_file — read a file (capped at 1 MiB; larger files fail with FILE_TOO_LARGE rather than being truncated silently). UTF-8 text by default; binary files (detected via null-byte scan) are returned as base64.
  • replit_search_files — recursive search by file-name substring and/or text-content substring (case-insensitive), with result caps (max_results, default 50) and a depth cap (max_depth, default 4). Content search skips binary files and files over 1 MB. Returns matching paths and, for content matches, up to 5 matching lines per file with line numbers (lineMatchesTruncated: true when a file has more).
  • replit_stat — file/directory metadata (type, size, permissions, mtime/atime) without reading contents. Symlinks are reported as type symlink (via lstat), not followed.

Write

  • replit_write_file — atomic write via temp + ext_openssh_rename with SHA-256 read-back verification. Fails closed if the server doesn't support atomic overwrite and the target already exists (we never unlink + rename, which opens a data-loss window).
  • replit_move — move or rename a file or directory. Never overwrites: fails with DESTINATION_EXISTS if the destination path is taken. The destination parent directory must already exist.
  • replit_delete_file — permanently delete a file (files only, not directories). Deletion is irreversible on Replit — there is no trash — so the tool carries destructiveHint: true and relies on the host's tool-approval layer as the gate.
  • replit_setup_ssh — generate an Ed25519 key pair at ~/.ssh/rebel-replit, write public/private files with mode 0600 (or icacls ACL on Windows), and append a *.replit.dev block to ~/.ssh/config. Idempotent by default; pass force_regenerate=true to replace the existing key (you will need to re-register the new public key with Replit).

Security notes

  • Host allowlist. Only *.replit.dev hosts are accepted, case-insensitive suffix match. Any other host is rejected before the SSH connection is opened.
  • ~/.ssh/ mutation surface. replit_setup_ssh writes to the operator's home directory (~/.ssh/rebel-replit, ~/.ssh/rebel-replit.pub, ~/.ssh/config). Configuration rewrites use a safe AST-only evaluator that skips Match exec blocks entirely, rather than the upstream ssh-config.compute() which would spawnSync them through the shell.
  • Path traversal. SFTP file paths are POSIX-normalized after rejecting absolute paths and any .. segments — relative paths only, no escape from the project root.
  • Atomic write invariant. replit_write_file writes to a randomized temp filename, renames via OpenSSH's POSIX rename extension (ext_openssh_rename), and verifies the final file's SHA-256 against the expected hash. If the server lacks the extension and the target file already exists, the write fails rather than falling back to unlink + rename.
  • Read-back verification. Every replit_write_file re-reads the final file and asserts SHA-256 equality before returning verified: true.
  • SSH host-key verification. Every outbound SSH connection passes an explicit hostVerifier to ssh2 that pins server fingerprints in a per-user known-hosts file (mode 0o600). The default behaviour mirrors OpenSSH's StrictHostKeyChecking=accept-new: the first time the connector reaches a host, the SHA-256 fingerprint is recorded and a notice is logged to stderr; on subsequent connects, a mismatch fails closed with HOST_KEY_MISMATCH. Pins are keyed by the stable proxy suffix (first DNS label stripped, e.g. riker.replit.dev) because Replit rotates the per-project hostname on every restart — a rotated hostname presenting a different key than the recorded suffix pin fails closed. The stripping stops at three labels: a three-label host pins under its full hostname, and a bare replit.dev entry is never consulted as a pin, so no single entry can act as a universal pin for every Replit host. The known-hosts file accepts both native <host> SHA256:… lines and OpenSSH ssh-keyscan output (<host> <keytype> <base64-key>), and honours @revoked markers as an active refusal (HOST_KEY_REVOKED) like OpenSSH does — a revoked key fails closed even if it is also pinned as valid. Operators who need fail-closed first-contact set MCP_REPLIT_SSH_STRICT_HOST_KEY=1 and pre-populate the known-hosts file out-of-band (e.g. ssh-keyscan riker.replit.dev > "$MCP_WORKSPACE_PATH/.replit-ssh-known-hosts" from a trusted network). Added in 0.1.2 to close audit finding replit-ssh-001.
  • Untrusted-content envelopes. Content from replit_read_file, directory-entry names from replit_list_files, matched paths/lines from replit_search_files, and the peer-authored fields from replit_check_connection (server version, working directory, and diagnostic event details such as the server banner and keyboard-interactive prompts) are wrapped in <untrusted-content source="…">…</untrusted-content> envelopes per AGENTS.md invariant #6. Hosts must keep the envelopes intact when surfacing tool output to the model. Added in 0.1.2 to close audit finding replit-ssh-006; check-connection coverage added later.
  • Delete is irreversible; approval is the host's job. replit_delete_file performs irreversible deletion (Replit has no trash). The tool is enabled by default and carries destructiveHint: true — gating belongs to the host's tool-approval layer. Directories are never deleted.
  • Move never overwrites. replit_move pre-checks the destination and fails with DESTINATION_EXISTS rather than clobbering an existing file.
  • Algorithm allow-list. Outbound SSH connections restrict the negotiated KEX/host-key/cipher/HMAC algorithms to curve25519-sha256 + ssh-ed25519/rsa-sha2-* + ChaCha20-Poly1305/AES-GCM + ETM HMACs. Blocks downgrade negotiation to weaker suites if the proxy is ever misconfigured.

Licence

FSL-1.1-MIT — Functional Source License, Version 1.1, with MIT future licence. The software converts to MIT licence on 2030-04-08.

来源:connectors/replit-ssh/README.md,提交 22c4611

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.2最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Replit 集成