mcp-ssh-wrapper
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-ssh-wrapperrun 'df -h' on prod-server"
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-ssh-wrapper
mcp-ssh-wrapper is a minimal MCP server that executes commands on remote hosts by delegating to the local ssh binary.
The server does not implement SSH authentication. It relies entirely on the host machine's existing SSH configuration, agent, identities, and host key policy.
This project runs as a streamable HTTP MCP server. It is intended to be started as a long-lived local process and then connected to by tools like Codex or Claude.
The SSH execution path is non-interactive. The server runs ssh in batch mode and does not allow prompts on stdin, so hosts must already be reachable using existing SSH config, keys, agent state, and known-hosts entries.
Warning: binding this server to anything other than localhost or 127.0.0.1 exposes a tool that can use the local machine's SSH configuration, agent, and keys over the network. Treat non-local binding as a high-risk configuration.
Features
Exposes a single MCP tool:
execute_commandUses the system
sshcommand directlyReturns
stdout,stderr, andexit_codeSupports an optional execution timeout
Related MCP server: MCP Shell Server
Installation
pip install mcp-ssh-wrapperRunning the server
After installation, run the server with:
mcp-ssh-wrapper --host 127.0.0.1 --port 8000 --mount-path /mcpThis exposes the MCP endpoint at http://127.0.0.1:8000/mcp.
You can also use the module entrypoint:
python -m mcp_ssh_wrapper --host 127.0.0.1 --port 8000 --mount-path /mcpKeep this bound to localhost unless you fully understand the security implications.
Local execution
For local development from this repository, use the helper script:
./run_server.sh --host 127.0.0.1 --port 8000 --mount-path /mcpIf your SSH setup depends on ssh-agent, run_server.sh will try to recover SSH_AUTH_SOCK automatically on macOS.
Add to Codex
Start the server first:
mcp-ssh-wrapper --host 127.0.0.1 --port 8000 --mount-path /mcpThen register the running HTTP endpoint with Codex:
codex mcp add mcp-ssh --url http://127.0.0.1:8000/mcpVerify the registration:
codex mcp list
codex mcp get mcp-sshCodex will connect to the running HTTP endpoint. It does not launch the server process for you in this setup.
Add to Claude
Claude Code CLI
Start the server first, then register the URL with Claude Code:
claude mcp add mcp-ssh --transport http http://127.0.0.1:8000/mcpVerify the registration:
claude mcp list
claude mcp get mcp-sshClaude Desktop
Add this server entry to your claude_desktop_config.json:
{
"mcpServers": {
"mcp-ssh": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}Claude Desktop will connect to the running local HTTP server.
Important limitation
run_test.sh does not launch the server. Start mcp-ssh-wrapper ... or ./run_server.sh ... first, then run the test wrapper against the live endpoint.
Local smoke test
To verify startup, MCP initialization, and tool discovery against a running server:
./run_test.sh --skip-callTo target a non-default endpoint:
./run_test.sh --url http://127.0.0.1:8000/mcp --skip-callTo also invoke the SSH tool:
./run_test.sh --host my-host --command "uname -a"Tool
execute_command
Arguments:
host: SSH host oruser@host, resolved by the local SSH clientcommand: Command string to execute remotelytimeout_seconds: Optional timeout.0disables timeout handling.
Result:
{
"host": "prod-box",
"command": "uname -a",
"stdout": "Linux ...\n",
"stderr": "",
"exit_code": 0
}Notes
SSH options should be configured in
~/.ssh/configor the host environment.This server invokes
ssh -o BatchMode=yes, so password prompts and interactive confirmations are disabled.Authentication, host key policy, and identity selection are still handled by the local
sshclient and its existing configuration.
Releasing
This project is configured to publish to PyPI using GitHub Trusted Publishing via .github/workflows/publish-pypi.yml.
Release flow:
Update
project.versionin pyproject.toml.Commit the version bump and push it to
main.Tag the
maincommit with a matching version tag in the formvX.Y.Z.Push the tag to GitHub.
Example for version 0.1.0:
git checkout main
git pull
git tag v0.1.0
git push origin v0.1.0The GitHub Actions workflow will:
verify the tag points to a commit on
mainverify the tag matches
project.versionbuild the package
publish it to PyPI using the GitHub
pypienvironment
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
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/megascope/mcp-ssh-wrapper'
If you have feedback or need assistance with the MCP directory API, please join our Discord server