Vortex MCP服务器
](https://github.com/ilxqx/vortex-mcp/releases)     
漩涡是一种普遍现象 模型上下文协议(MCP) 用Go编写的服务器,为AI助手提供安全的shell执行和文件传输功能。
特性
- 本地Shell执行 -在具有安全过滤的本地计算机上执行shell命令
- 远程SSH执行 -使用预配置的服务器通过SSH在远程主机上执行命令
- SFTP文件传输 -在本地和远程主机之间上传和下载文件
- 安全第一 -默认情况下,危险命令(rm-rf、关机等)被阻止
- 基于DSN的配置 -通过环境变量进行简单的URL样式服务器配置
- 跨平台 -支持macOS、Linux和Windows
安装
使用Go安装
go install github.com/ilxqx/vortex-mcp/cmd/vortex@latest来源
# Clone the repository
git clone https://github.com/ilxqx/vortex-mcp.git
cd vortex-mcp
# Build using Task
task build
# Or install to $GOPATH/bin
task install预构建二进制文件
从下载 发布 页面。
配置
ssh服务器配置
SSH服务器是通过以下方式配置的 VORTEX_SSH_SERVERS 使用DSN(数据源名称)格式的环境变量:
ssh://[user[:password]@]host[:port]?name=alias[&desc=description][&key=keyfile][&timeout=30]参数:
| 参数 | 必填 | 说明 |
|---|---|---|
user | 是 | SSH用户名 |
password | 否 | SSH密码(如果省略,请使用基于密钥的身份验证) |
host | 是 | 主机名或IP地址 |
port | 无 | SSH端口(默认值:22) |
name | 是 | 工具调用的服务器别名 |
desc | 否 | 人类可读的描述 |
key | 否 | 私钥文件路径(支持 ~/ 扩展) |
timeout | 否 | 连接超时(秒)(默认值:30) |
示例:
# Single server with password authentication
export VORTEX_SSH_SERVERS="ssh://admin:secret@192.168.1.100?name=prod"
# Single server with key-based authentication
export VORTEX_SSH_SERVERS="ssh://deploy@server.example.com?name=deploy&key=~/.ssh/deploy_key"
# Multiple servers (comma-separated)
export VORTEX_SSH_SERVERS="ssh://admin@web1.example.com?name=web1,ssh://admin@db1.example.com:2222?name=db1&key=~/.ssh/db_key"
# With optional description (no spaces)
export VORTEX_SSH_SERVERS="ssh://admin@prod.example.com?name=prod&desc=ProductionServer"注: 这desc参数是可选的。如果您的描述包含空格或特殊字符(&,=,,),您需要对它们进行URL编码(例如空格→%20).为简单起见,我们建议使用没有空格或省略的名称desc完全。
MCP客户端配置
添加到MCP客户端配置中:
{
"mcpServers": {
"vortex": {
"command": "/path/to/vortex",
"args": ["--timeout", "60"],
"env": {
"VORTEX_SSH_SERVERS": "ssh://admin@server.example.com?name=myserver&key=~/.ssh/id_rsa"
}
}
}
}可用工具
外壳执行器
在本地计算机上执行shell命令。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
command | string | Yes | 要执行的shell命令 |
working_dir | string | 否 | 命令执行的工作目录 |
timeout | int | 否 | 超时秒数(默认值:60) |
退货: output (字符串), exit_code (int)
ssh执行
通过SSH在预配置的远程主机上执行命令。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
server | string | 是 | 预配置的服务器名称 |
command | string | 是 | 要执行的命令 |
timeout | int | 否 | 超时秒数(默认值:30) |
退货: output (字符串), exit_code (int)
ssh_list_servers
列出所有预配置的SSH服务器。
退货: 服务器阵列 name, description, host,以及 user 领域。
transfer_upload
通过SFTP将本地文件上传到远程主机。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
server | string | 是 | 预配置的服务器名称 |
local_path | string | 是 | 本地文件的绝对路径 |
remote_path | string | 是 | 远程目标的绝对路径 |
退货: message (字符串), bytes_written (int)
transfer_download
通过SFTP从远程主机下载文件。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
server | string | 是 | 预配置的服务器名称 |
remote_path | string | 是 | 远程文件的绝对路径 |
local_path | string | 是 | 本地目标的绝对路径 |
退货: message (字符串), bytes_written (int)
命令行用法
# Run the server (stdio mode)
vortex
# With custom shell command timeout
vortex --timeout 120
# With debug logging
vortex --log-level debug
# Show version
vortex version
# Show help
vortex --help安全
Vortex实施安全措施以防止意外损坏:
- 命令筛选 -危险命令被阻止:
- rm -rf /, rm -rf ~, rm -rf * - shutdown, reboot, halt, poweroff - mkfs, dd if= - 叉式炸弹和其他破坏性模式
- 文件大小限制 -SFTP传输限制为100MB
- 输出截断 -命令输出被截断为1MB
发展
先决条件
- 转到1.25+
- 任务 (可选,用于构建自动化)
构建命令
# List all tasks
task
# Build binary
task build
# Run tests
task test
# Run tests with coverage
task test:coverage
# Format code
task fmt
# Run linter
task lint
# Clean build artifacts
task clean
# Build for all platforms
task release项目结构
vortex-mcp/
├── cmd/vortex/ # Application entry point
├── internal/
│ ├── config/ # Server configuration and DSN parsing
│ ├── security/ # Command security analysis
│ └── tools/ # MCP tool implementations
│ ├── shell/ # Local shell execution
│ ├── ssh/ # Remote SSH execution
│ └── transfer/ # SFTP file transfer
├── pkg/version/ # Version information
├── Taskfile.yml # Task automation
└── README.md贡献
欢迎投稿!请随时提交拉取请求。
- 克隆该仓库
- 创建功能分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'Add some amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
致谢
- 模型上下文协议 -协议规范
- MCP Go SDK -MCP官方Go SDK
