MCP Remote Code
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Remote Codesearch for 'function' in remote source files"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π MCP Remote Code
MCP Remote Code is a standalone Model Context Protocol server for working with remote machines over SSH. Its main focus is agent-style remote development, not only remote server administration.
The core tools are the ones coding agents normally rely on when working in a local repository:
remote_globremote_grepremote_readremote_writeremote_editremote_patch
Many existing SSH MCP servers expose a remote shell, and sometimes file download/upload helpers. That is useful for operations work, but it forces agents to manipulate source files through ad-hoc shell pipelines. MCP Remote Code instead exposes native agent-style file tools, modeled after OpenCode's built-in glob, grep, read, write, edit, and patch tools, so editing a remote project feels much closer to editing a local one.
The remote host stays clean: it only needs an SSH daemon. The MCP server runs
locally, maintains persistent SSH/SFTP connections with ssh2, and exposes
remote operations as namespaced MCP tools.
π‘ Motivation
The primary motivation is the same as the original OpenCode remote plugin: some important development machines are old, locked down, or specialized enough that installing an agent runtime is not realistic.
This is common on remote VMs, lab machines, EDA workstations, embedded Linux targets, and legacy servers. They may not have a modern Node.js, may not permit long-running agent processes, and may not be suitable for extra language server or indexing daemons. Agents still need stable ways to run commands, search code, inspect files, edit files, apply patches, and move artifacts.
The OpenCode plugin proved the remote-development workflow, but it is bound to the OpenCode ecosystem and deliberately masquerades the remote machine as the agent's local workspace. In that model, the runtime environment is fully remote: the agent cannot naturally see or use local directories.
The MCP server has two different goals:
detach the SSH remote-development tools from a single client ecosystem; and
support workflows where local and remote work need to cooperate.
For example, an analog IC engineer might keep design notes locally, query local gm/ID lookup tables, and iterate sizing scripts on the local workstation, while asking the agent to run Spectre verification and simulation iterations on a remote EDA machine. A pure "remote shell only" MCP server is too low-level for that workflow, and a fully remote-masquerading plugin cannot naturally use the local workspace. This project is designed for that middle ground.
Related MCP server: Scout MCP
β¨ Features
Multi-machine connection manager.
Saved machine templates in
~/.opencode/mcp-remote-code-configs.json.On-demand SSH connections with
remote_connect.Startup auto-connect from CLI flags or environment variables.
Persistent SSH command and SFTP connection pools.
Remote command execution, glob, grep, read, write, edit, and patch tools.
Explicit absolute-path file transfer tools:
remote_pull: remote file/directory to local absolute path.remote_push: local file/directory to remote absolute path.
Large-transfer preflight warnings with second-call
forceconfirmation.Streamable HTTP transport for current MCP clients.
Legacy HTTP+SSE compatibility for older MCP clients.
π Requirements
Node.js >= 20.
A reachable SSH server on each remote machine.
A POSIX-like remote shell for file tools.
The remote machine does not need Node.js, MCP software, an agent, rsync, or
sshpass.
π Install
From a checkout:
npm install
npm run build
npm install -g .When installed globally, the command is:
mcp-remote-codeβΆοΈ Start The Server
Default local daemon:
mcp-remote-codeCustom bind address:
mcp-remote-code --port 3000 --host 127.0.0.1Security note: this server has no built-in authentication. Keep the default
127.0.0.1 binding unless you place it behind your own trusted network
boundary. Do not expose it directly to the internet.
π MCP Endpoints
Endpoint | Purpose |
| Compatible endpoint. Accepts Streamable HTTP POST/GET/DELETE and legacy SSE GET. |
| Streamable HTTP endpoint for current MCP clients. |
| Legacy HTTP+SSE message endpoint. |
| Health and status JSON. |
Most MCP clients can use:
{
"mcpServers": {
"remote-code": {
"url": "http://127.0.0.1:3000/sse"
}
}
}π₯οΈ Machine Configs
Saved machine templates live at:
~/.opencode/mcp-remote-code-configs.jsonAdd a machine from an MCP client:
remote_add_config(
name: "dev",
ssh: "ssh -oHostKeyAlgorithms=+ssh-rsa user@host",
workdir: "/home/project",
password: "optional-password"
)Connect later:
remote_connect(machine: "dev")Passwords in saved templates are stored in the local JSON config file. Use file-system permissions appropriate for your machine.
β‘ Startup Auto-Connect
You can connect a machine as the daemon starts. Startup connections are not saved as templates.
mcp-remote-code \
--remote "ssh -i ~/.ssh/id_rsa user@host" \
--workdir /home/project \
--name devEnvironment variable form:
export REMOTE_SSH='ssh user@host'
export REMOTE_WORKDIR='/home/project'
export REMOTE_NAME='dev'
mcp-remote-codeSupported startup variables:
Variable | Meaning |
| SSH command string. |
| Remote working directory. |
| Connection name, default |
| SSH password. |
| Password used for sudo commands. |
π SSH Command Support
The SSH command string must start with ssh. Common OpenSSH-style options are
parsed:
-p <port>or-p<port>-i <identity_file>or-i<identity_file>-l <user>or-l<user>-o Key=Value
Recognized -o values include:
PortUserIdentityFileHostKeyAlgorithmsStrictHostKeyChecking=no
This server does not spawn the external ssh binary. Advanced OpenSSH client
features such as ProxyJump, ProxyCommand, and custom ssh_config files are
not implemented by this package.
π§° Tools
Connection and config tools:
remote_add_configremote_remove_configremote_list_configsremote_connectremote_disconnectremote_list_machines
Remote operation tools:
remote_bashremote_globremote_grepremote_readremote_writeremote_editremote_patchremote_pullremote_push
All remote operation tools accept an optional machine parameter. If omitted
and exactly one machine is connected, that machine is used.
π¦ File Transfer
remote_pull and remote_push require explicit absolute paths. The MCP server
does not infer the agent workspace from its own startup directory.
Pull
Download a remote file or directory to a local absolute path:
remote_pull(
machine: "dev",
remotePath: "/home/project/logs",
localPath: "/home/me/project/artifacts/logs"
)Rules:
remotePathmust be an absolute remote path.localPathmust be an absolute local path.On Windows, use a fully qualified path such as
C:\work\project\artifact.binor a UNC path, not\artifact.bin.Directories are copied recursively and preserve their internal tree.
Binary files are supported.
Same-path local files are overwritten.
Extra local files are not deleted.
Push
Upload a local file or directory to a remote absolute path:
remote_push(
machine: "dev",
localPath: "/home/me/project/artifacts/logs",
remotePath: "/home/project/logs"
)Rules:
localPathmust be an absolute local path.remotePathmust be an absolute remote path.Directories are uploaded recursively and preserve their internal tree.
Binary files are supported.
Symlinks and special local file types are skipped.
Same-path remote files are overwritten.
Extra remote files are not deleted.
Large Transfer Confirmation
Pull and push both use a two-step confirmation for large transfers.
Defaults:
Size threshold:
25 MB.File-count threshold:
500files.Confirmation window:
10minutes.
The first large-transfer call returns a plan with type, byte size, file count,
directory count, and source/destination paths. It does not transfer data, even
if force: true is already present. Repeat the same call with force: true
within the confirmation window to proceed.
Environment overrides:
Direction | Size threshold | File threshold |
Pull |
|
|
Push |
|
|
π οΈ Development
npm install
npm run lint
npm run build
npm pack --dry-runThe npm package includes build/, README.md, and README.zh-CN.md.
ποΈ Repository Layout
This MCP server is a standalone repository. It may live next to, or inside a
checkout of, an OpenCode plugin during development, but its .git directory,
package metadata, README files, and npm build artifacts are independent.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zz6zz666/mcp-remote-code'
If you have feedback or need assistance with the MCP directory API, please join our Discord server