
MCP SSH Server
一个安全的 SSH 服务器实现,用于模型上下文协议,支持远程命令执行和文件操作,并同时支持密码和密钥认证。 (Alternative, slightly more formal and technical:) 一个为模型上下文协议设计的安全 SSH 服务器实现,该实现支持远程命令执行和文件操作,并提供密码和密钥两种认证方式。
README
MCP SSH 服务器
一个强大的用于模型上下文协议 (MCP) 的 SSH 服务器实现。该服务器通过 SSH 协议实现安全的远程命令执行和文件操作,支持密码和密钥两种身份验证方式。
特性
- ✨ 安全的 SSH 连接管理
- 🔑 密码和密钥身份验证
- 💻 远程命令执行
- 📁 文件操作(上传/下载)
- 📊 文件传输进度跟踪
- 🔐 权限管理
- 📂 目录操作
- 🚀 批量文件传输
- 📝 详细日志记录
安装
- 安装包:
npm install mcp-ssh
- 添加到你的 Claude 桌面配置 (
claude_desktop_config.json
):
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["%APPDATA%/npm/node_modules/mcp-ssh/dist/server.js"],
"env": {
"SSH_PORT": "8889",
"SSH_LOG_LEVEL": "info"
}
}
}
}
用法
密码验证
$body = @{
id = "test"
host = "example.com"
port = 22
username = "user"
password = "pass123"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/connect" -Method Post -Body $body -ContentType "application/json"
密钥验证
$body = @{
id = "test"
host = "example.com"
port = 22
username = "user"
privateKey = Get-Content ~/.ssh/id_rsa | Out-String
passphrase = "optional-key-passphrase" # 如果你的密钥受到保护
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/connect" -Method Post -Body $body -ContentType "application/json"
执行命令
$execBody = @{
id = "test"
command = "ls -la"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/exec" -Method Post -Body $execBody -ContentType "application/json"
文件操作
# 上传文件
$uploadForm = @{
file = Get-Item -Path "localfile.txt"
remotePath = "/remote/path/file.txt"
}
Invoke-RestMethod -Uri "http://localhost:8889/upload/test" -Method Post -Form $uploadForm
# 下载文件
Invoke-RestMethod -Uri "http://localhost:8889/download/test?remotePath=/remote/path/file.txt" -Method Get -OutFile "downloaded.txt"
目录操作
# 列出目录
Invoke-RestMethod -Uri "http://localhost:8889/ls/test?path=/remote/path" -Method Get
# 获取连接状态
Invoke-RestMethod -Uri "http://localhost:8889/status/test" -Method Get
开发
- 克隆仓库:
git clone https://github.com/shaike1/mcp-server-ssh.git
cd mcp-server-ssh
- 安装依赖:
npm install
- 构建:
npm run build
- 启动服务器:
npm start
环境变量
SSH_PORT
: 服务器端口 (默认: 8889)SSH_LOG_LEVEL
: 日志级别 (默认: info)
贡献
- Fork 仓库
- 创建你的特性分支 (
git checkout -b feature/amazing-feature
) - 提交你的更改 (
git commit -m 'Add some amazing feature'
) - 推送到分支 (
git push origin feature/amazing-feature
) - 打开一个 Pull Request
许可证
MIT
推荐服务器
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Excel MCP Server
一个模型上下文协议服务器,使 AI 助手能够读取和写入 Microsoft Excel 文件,支持诸如 xlsx、xlsm、xltx 和 xltm 等格式。
Playwright MCP Server
提供一个利用模型上下文协议的服务器,以实现类人浏览器的自动化,该服务器使用 Playwright,允许控制浏览器行为,例如导航、元素交互和滚动。
Claude Code MCP
一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。
@kazuph/mcp-taskmanager
用于任务管理的模型上下文协议服务器。它允许 Claude Desktop(或任何 MCP 客户端)在基于队列的系统中管理和执行任务。
Apple MCP Server
通过 MCP 协议与 Apple 应用(如“信息”、“备忘录”和“通讯录”)进行交互,从而使用自然语言发送消息、搜索和打开应用内容。
contentful-mcp
在你的 Contentful Space 中更新、创建、删除内容、内容模型和资源。
serper-search-scrape-mcp-server
这个 Serper MCP 服务器支持搜索和网页抓取,并且支持 Serper API 引入的所有最新参数,例如位置信息。
The Verge News MCP Server
提供从The Verge的RSS feed获取和搜索新闻的工具,允许用户获取今日新闻、检索过去一周的随机文章,以及在最近的Verge内容中搜索特定关键词。