SSH Remote File MCP Server
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., "@SSH Remote File MCP ServerRun 'df -h' on the remote host."
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.
SSH Remote File MCP Server
Read, edit, and run commands on a remote server through Claude Code — as if the files were local.
An MCP server that exposes a remote SSH host as
a set of file-system tools. Once registered with Claude Code you can ask it to
read /home/you/proj/main.py, edit a function, run pytest, or grep across the
remote tree — and it talks to the server over SSH, with path-scoping and command
filtering on the way.
中文文档 / Chinese version → · GitHub →
License
MIT — see LICENSE.
Related MCP server: MCP SSH Server
Features
Tool | Purpose |
| Read a remote file |
| Create or overwrite (also append) a remote file |
| Find-and-replace inside a remote file |
| List a remote directory with permissions, size, mtime |
| Run a shell command on the remote (with safety filters) |
| Find files by name glob or content |
| OS / Python / disk / memory / CPU snapshot |
| Detailed stat for a single path |
Quick start
# 1. Clone and enter
git clone https://github.com/zhangqi-eiq/server_mcp.git
cd server_mcp
# 2. Install (editable mode — picks up code changes immediately)
python install.py
# 3. Edit your real credentials
# (file is at ~/.ssh-mcp-server/config.json by default)
# 4. Restart Claude Code, then in a chat:
# "show me the env of my server"That's it. install.py does three things:
pip install -e .— installs the package.Copies
config.json(with placeholder values) to~/.ssh-mcp-server/.Runs
claude mcp addso the server shows up in Claude Code.
If you do not have the claude CLI yet, run python install.py --no-register
and add the MCP entry by hand (see Manual configuration).
Manual configuration
If you prefer to wire things up by hand, or install.py did not register
correctly:
1. Install the package
pip install -e .This puts ssh_mcp_server on Python's import path so that
python -m ssh_mcp_server can launch the server.
2. Create your config
Copy config.json to ~/.ssh-mcp-server/config.json (the loader looks here
when SSH_MCP_CONFIG is unset) and fill in real values:
mkdir -p ~/.ssh-mcp-server
cp config.json ~/.ssh-mcp-server/config.json
$EDITOR ~/.ssh-mcp-server/config.json3. Register with Claude Code
The MCP entry must invoke the server via the Python interpreter you installed
into. <python> below should be the absolute path to that interpreter
(sys.executable from your activated env, e.g.
C:\Users\you\.conda\envs\myenv\python.exe on Windows or
/home/you/.venv/bin/python on Linux).
Option A — user-scope, available in every project:
claude mcp add --scope user ssh-remote \
-e SSH_MCP_CONFIG="$HOME/.ssh-mcp-server/config.json" \
-- "<python>" -m ssh_mcp_serverOption B — project-scope, only this project:
Create .mcp.json in your project root:
{
"mcpServers": {
"ssh-remote": {
"command": "<absolute path to python>",
"args": ["-m", "ssh_mcp_server"],
"env": {
"SSH_MCP_CONFIG": "/absolute/path/to/your/config.json"
}
}
}
}Note: Claude Code looks for
mcpServersin two places —~/.claude.json(CLI-managed, written byclaude mcp add) and~/.claude/settings.json(hand-edited). The CLI route above writes to the right one automatically.
Configuration reference
config.json shape:
{
"ssh": {
"host": "your-server.example.com",
"port": 22,
"username": "your-username",
"auth": {
"type": "password",
"key_path": "",
"password": "your-password",
"key_password": ""
},
"connect_timeout": 10,
"keepalive_interval": 30
},
"allowed_paths": [
"/home/your-username/projects"
],
"security": {
"blocked_commands": ["rm -rf /", "mkfs", ...],
"max_file_size_mb": 50,
"max_output_chars": 100000,
"command_timeout": 30
}
}SSH connection
Field | Description | Default |
| Server address (IP or domain) | required |
| SSH port |
|
| Login username | required |
|
|
|
| Path to private key (key auth) | required if |
| Login password (password auth) | required if |
| Passphrase for the key | empty |
| Seconds |
|
| Seconds between keepalives |
|
Access control
allowed_paths— whitelist of remote directories. Every file operation is validated against this list after..normalization. Requests outside the list are rejected. Sub-paths inherit access (e.g./data/projallows/data/proj/sub/file.py).security.blocked_commands— list of shell command patterns thatssh_run_commandrefuses to execute. The defaults cover obvious foot-guns (rm -rf /,mkfs,shutdown, fork bombs, raw writes to block devices). You can extend the list, but never weaken it to "fix" a legitimate need — see Security model.
Resource limits
Field | Effect | Default |
|
|
|
|
|
|
|
|
|
Authentication
Key-based (recommended)
# On your local machine
ssh-keygen -t ed25519 -C "you@example.com"
# Push the public key to the remote
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@serverThen in config.json:
"auth": {
"type": "key",
"key_path": "~/.ssh/id_ed25519",
"key_password": ""
}key_password is only needed if the private key itself is encrypted.
Password-based
"auth": {
"type": "password",
"password": "your-password"
}The password is stored in plain text in config.json. Prefer key auth.
GUI manager (optional)
A small Tk-based GUI lets you maintain multiple server profiles and switch between them:
# From source
python server_manager.py
# Or build a standalone Windows exe and put it on PATH
pip install -e ".[gui]" # adds pyinstaller
python build.py
python setup_global.py
# now `SSH-Server-Manager` is on PATHProfiles live in profiles.json; switching copies the selected profile into
config.json so the MCP server picks it up on next launch.
Security model
This server is intentionally conservative. Two independent layers protect the remote host:
Path scoping. Every file operation is normalized (resolving
.., collapsing slashes) and then checked againstallowed_paths. There is no way to escape the list — the check happens server-side after the path is resolved on the remote.Command filtering.
ssh_run_commandrejects any command matchingsecurity.blocked_commands(substring match). The default list blocks recursive destruction, raw device writes, system shutdown, fork bombs, and remote shell installers (curl … | sh). Extend the list if you need to allow something specific — but do not gut it.
Things this server does not do:
It does not run as root on the remote. SSH to a non-root user.
It does not bypass
sudo. If the configured user can'tsudo, neither can the server.It does not provide an interactive shell. Long-running processes are killed by
command_timeout.
Troubleshooting
Symptom | Likely cause | Fix |
| Server registered to wrong scope, or | Use |
| Installed into a different Python than | Run |
| Config still has placeholder values | Edit |
| The path the LLM tried isn't in | Add the path to |
| The LLM tried a blacklisted command | Adjust |
| Wrong credentials or wrong user | Verify with |
Server starts but Claude Code shows no tools | Stale VSCode extension process | Fully quit and reopen VSCode |
Project layout
server/
├── ssh_mcp_server/ # MCP server package (the actual product)
│ ├── server.py # tool definitions
│ ├── ssh_client.py # paramiko wrapper
│ ├── security.py # path + command validation
│ └── config.py # config loader
├── server_manager.py # Tk GUI for managing profiles
├── profiles.json # GUI profile store
├── config.json # runtime config template (placeholder values)
├── setup.py # pip-installable package metadata
├── install.py # one-shot installer (install + register)
├── setup_global.py # optional: deploy GUI exe to PATH
├── build.py # optional: PyInstaller wrapper for the GUI
├── SSH-Server-Manager.spec # PyInstaller spec for fine-grained builds
├── requirements.txt # raw dependency pins
├── LICENSE # MIT
├── README.md # this file (English)
└── README.zh.md # Chinese translationLicense
MIT — see the file for the full text.
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.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables SSH remote access to servers through Claude, allowing users to execute commands, transfer files via SFTP, and manage multiple remote connections using natural language.128MIT
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude to remote servers via SSH to execute commands, manage files, and browse directories. It allows users to add, edit, and switch between multiple server configurations through natural language conversations.
- AlicenseAqualityBmaintenanceEnables Claude to connect to servers via SSH, execute commands, transfer files, and manage connections through natural language.9151MIT
- -licenseNot gradedqualityNot gradedmaintenanceEnables Claude Code to control remote servers via SSH for automated deployment, testing, and operations, including command execution and file transfer.4
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Read, edit, publish, and preview your pepita websites from Claude.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/zhangqi-eiq/server_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server