SSH MCP 服务器
提供 SSH 功能的模型上下文协议 (MCP) 服务器实现。此服务器允许通过 MCP 协议进行安全的远程访问和执行。
特征
- 使用MCP协议的SSH服务器实现
- SQLite 数据库集成,实现数据持久化
- TypeScript 实现类型安全和更好的开发体验
先决条件
- Node.js(建议使用 v16 或更高版本)
- npm 或 yarn 包管理器
- 开发所需的 TypeScript 知识
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 SSH 服务器:
手动安装
- 克隆存储库:
- 安装依赖项:
- 构建项目:
用法
配置
该服务器使用 SQLite 数据库 ( ssh.db
) 来存储 SSH 凭据。该数据库文件将在服务器启动时自动创建。
工具
该服务器提供以下工具:
ssh_exec
通过 SSH 执行命令。
输入参数:
host
:要连接的主机。(必需)command
:要执行的命令。(必需)username
:用于 SSH 连接的用户名。(必需)privateKeyPath
:私钥文件的路径。(必需)
示例用法:
注意: privateKeyPath
必须是私钥文件的有效路径。
添加凭证
添加新的 SSH 凭证。
输入参数:
name
:凭证的名称。(必需)host
:要连接的主机。(必需)username
:用于 SSH 连接的用户名。(必需)privateKeyPath
:私钥文件的路径。(必需)
示例用法:
注意: privateKeyPath
必须是私钥文件的有效路径。
列出凭据
列出所有存储的 SSH 凭据。
输入参数:
- 没有任何
示例用法:
删除凭据
删除存储的 SSH 凭证。
输入参数:
name
:要删除的凭证的名称。(必需)
示例用法:
启动服务器
服务器将在配置的端口上开始运行(默认设置可以在源代码中修改)。
项目结构
src/
——源代码目录build/
——编译后的 JavaScript 输出node_modules/
——项目依赖项
依赖项
@modelcontextprotocol/sdk
:MCP 协议实现sqlite3
:SQLite 数据库驱动程序typescript
:TypeScript 支持的开发依赖项
发展
要对项目进行更改:
- 在
src/
目录中进行更改 - 重建项目:
- 启动服务器来测试您的更改:
执照
国际学习中心
贡献
- 分叉存储库
- 创建你的功能分支
- 提交你的更改
- 推送到分支
- 创建新的 Pull 请求
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
模型上下文协议服务器实现,可通过 SSH 安全地执行远程命令,并具有管理和使用 SSH 凭据的功能。
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.Last updated -3Python
- -securityFlicense-qualityA secure SSH server implementation for Model Context Protocol that enables remote command execution and file operations, supporting both password and key-based authentication.Last updated -34TypeScript
- -securityAlicense-qualityA Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.Last updated -2PythonMIT License
- AsecurityFlicenseAqualityA server that enables remote command execution over SSH through the Model Context Protocol (MCP), supporting both password and private key authentication.Last updated -1132JavaScript