SSH MCP Server
Enables AI apps to connect to remote servers via SSH, SFTP, and tunnels.
README
SSH MCP Server
A Model Context Protocol (MCP) server that exposes SSH, SFTP, and tunnel capabilities as AI tools. Connect any MCP-compatible AI app to your remote servers.
Tools (17 total)
| Category | Tools |
|---|---|
| Connections | ssh_connect, ssh_disconnect, ssh_list_connections |
| Profiles | ssh_save_profile, ssh_list_profiles, ssh_delete_profile |
| Exec | ssh_exec |
| SFTP | sftp_upload, sftp_download, sftp_list, sftp_stat, sftp_mkdir, sftp_rm |
| Tunnels | ssh_forward_local, ssh_forward_remote, ssh_list_tunnels, ssh_close_tunnel |
Prerequisites
- Node.js v18+
- Clone and build the server:
git clone <your-repo-url>
cd ssh-mcp
npm install
npm run build
The built entry point will be at dist/index.js.
Connecting to AI Apps
Replace
/path/to/ssh-mcpwith the actual absolute path where you cloned the repo.
- Windows example:
D:/projects/ssh-mcp- macOS/Linux example:
/home/user/ssh-mcp
Claude Desktop
Config file location:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Open the file and add the mcpServers block (merge with existing content if needed):
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["/path/to/ssh-mcp/dist/index.js"]
}
}
}
Windows example:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["D:/projects/ssh-mcp/dist/index.js"]
}
}
}
Steps:
- Edit the config file above
- Fully quit Claude Desktop (right-click tray icon → Quit)
- Relaunch Claude Desktop
- Look for the 🔨 hammer icon in the chat input — click it to verify SSH tools are listed
Google Antigravity
Config file location:
- Windows:
C:\Users\<YOUR_USERNAME>\.gemini\antigravity\mcp_config.json - macOS/Linux:
~/.gemini/antigravity/mcp_config.json
Create or edit mcp_config.json:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["/path/to/ssh-mcp/dist/index.js"]
}
}
}
Alternatively via the UI:
- Open Antigravity → click Agent session dropdown in the side panel
- Select MCP Servers → Manage MCP Servers
- Click View raw config and paste the config above
Steps:
- Save the config file
- Restart Antigravity or reload the MCP servers from the UI
- The SSH tools will appear in the agent tool list
VS Code (GitHub Copilot Chat)
MCP servers in VS Code can be scoped to a workspace or configured globally.
Option A — Workspace (recommended)
Create .vscode/mcp.json in your project root:
{
"servers": {
"ssh": {
"type": "stdio",
"command": "node",
"args": ["/path/to/ssh-mcp/dist/index.js"]
}
}
}
Option B — Global (user settings)
Open VS Code settings (Ctrl+, / Cmd+,) → search for MCP → click Edit in settings.json and add:
{
"mcp": {
"servers": {
"ssh": {
"type": "stdio",
"command": "node",
"args": ["/path/to/ssh-mcp/dist/index.js"]
}
}
}
}
Steps:
- Save the config
- Open Copilot Chat (
Ctrl+Alt+I/Cmd+Alt+I) - Switch to Agent mode using the mode selector
- The SSH tools will be available to the agent
Requires: VS Code 1.99+ with the GitHub Copilot extension
Opencode
Config file location: ~/.config/opencode/config.json
Add the mcp block to your config (create the file if it doesn't exist):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"ssh": {
"type": "local",
"command": ["node", "/path/to/ssh-mcp/dist/index.js"],
"enabled": true
}
}
}
Steps:
- Save the config file
- Start or restart
opencode - The SSH tools will be loaded automatically on startup
The
commandfield in Opencode is an array (command + args combined), unlike other apps that split them intocommand+args.
LM Studio
LM Studio supports MCP servers since version 0.3.17. It uses the same mcpServers format as Claude Desktop.
Config file via UI (easiest):
- Open LM Studio → switch to the Program tab in the right sidebar
- Click Install → Edit mcp.json — this opens the config in the built-in editor
- Add the SSH server entry and save
mcp.json format:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["/path/to/ssh-mcp/dist/index.js"]
}
}
}
Windows example:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["D:/projects/ssh-mcp/dist/index.js"]
}
}
}
Steps:
- Edit
mcp.jsonvia the UI or directly on disk - Save the file — LM Studio reloads MCP servers automatically
- Load a model that supports tool use (e.g. a Qwen, Llama, or Mistral instruct model)
- Start a new chat — LM Studio will show a confirmation dialog before executing any tool call
Note: LM Studio shows a tool-call confirmation dialog before running each tool, letting you review and optionally edit the arguments first.
Requires: LM Studio 0.3.17+
Authentication Methods
When connecting with ssh_connect, three auth methods are supported:
| Method | When to use |
|---|---|
password |
Username + password login |
key |
Private key file (PEM format) |
agent |
SSH agent (e.g. ssh-agent, Pageant on Windows) |
Password example:
ssh_connect host=192.168.1.10 username=admin auth=password password=secret
Key example:
ssh_connect host=192.168.1.10 username=admin auth=key privateKeyPath=/home/user/.ssh/id_rsa
Agent example:
ssh_connect host=192.168.1.10 username=admin auth=agent
Saving profiles
To avoid re-entering credentials every session, save a profile:
ssh_save_profile name=myserver host=192.168.1.10 username=admin auth=password
Then connect using:
ssh_connect profileName=myserver password=secret
Development
# Run without building (uses tsx)
npm run dev
# Build to dist/
npm run build
# Type-check only
npm run typecheck
Troubleshooting
| Problem | Fix |
|---|---|
| Tools don't appear in the app | Make sure you ran npm run build and dist/index.js exists |
Cannot find module error |
Run npm install then npm run build again |
| Connection refused | Check the host/port and that the SSH service is running on the remote |
| Auth failed | Double-check username, password, or key path and permissions |
| Antigravity doesn't load tools | Reload MCP servers from the UI or restart Antigravity |
| VS Code tools missing | Ensure you're in Agent mode in Copilot Chat, not Ask/Edit mode |
| LM Studio tools missing | Requires v0.3.17+; make sure you're using a model that supports tool use |
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。