Skip to main content
Glama

SSH MCP Server

SSH MCP 服务器

提供 SSH 功能的模型上下文协议 (MCP) 服务器实现。此服务器允许通过 MCP 协议进行安全的远程访问和执行。

特征

  • 使用MCP协议的SSH服务器实现
  • SQLite 数据库集成,实现数据持久化
  • TypeScript 实现类型安全和更好的开发体验

先决条件

  • Node.js(建议使用 v16 或更高版本)
  • npm 或 yarn 包管理器
  • 开发所需的 TypeScript 知识

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 SSH 服务器:

npx -y @smithery/cli install @KinoThe-Kafkaesque/ssh-mcp-server --client claude

手动安装

  1. 克隆存储库:
git clone <repository-url> cd ssh-server
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build

用法

配置

该服务器使用 SQLite 数据库 ( ssh.db ) 来存储 SSH 凭据。该数据库文件将在服务器启动时自动创建。

工具

该服务器提供以下工具:

ssh_exec

通过 SSH 执行命令。

输入参数:

  • host :要连接的主机。(必需)
  • command :要执行的命令。(必需)
  • username :用于 SSH 连接的用户名。(必需)
  • privateKeyPath :私钥文件的路径。(必需)

示例用法:

{ "tool_name": "ssh_exec", "arguments": { "host": "example.com", "command": "ls -l", "username": "user", "privateKeyPath": "/path/to/private/key" } }

注意: privateKeyPath必须是私钥文件的有效路径。

添加凭证

添加新的 SSH 凭证。

输入参数:

  • name :凭证的名称。(必需)
  • host :要连接的主机。(必需)
  • username :用于 SSH 连接的用户名。(必需)
  • privateKeyPath :私钥文件的路径。(必需)

示例用法:

{ "tool_name": "add_credential", "arguments": { "name": "my_credential", "host": "example.com", "username": "user", "privateKeyPath": "/path/to/private/key" } }

注意: privateKeyPath必须是私钥文件的有效路径。

列出凭据

列出所有存储的 SSH 凭据。

输入参数:

  • 没有任何

示例用法:

{ "tool_name": "list_credentials", "arguments": {} }
删除凭据

删除存储的 SSH 凭证。

输入参数:

  • name :要删除的凭证的名称。(必需)

示例用法:

{ "tool_name": "remove_credential", "arguments": { "name": "my_credential" } }

启动服务器

npm start

服务器将在配置的端口上开始运行(默认设置可以在源代码中修改)。

项目结构

  • src/ ——源代码目录
  • build/ ——编译后的 JavaScript 输出
  • node_modules/ ——项目依赖项

依赖项

  • @modelcontextprotocol/sdk :MCP 协议实现
  • sqlite3 :SQLite 数据库驱动程序
  • typescript :TypeScript 支持的开发依赖项

发展

要对项目进行更改:

  1. src/目录中进行更改
  2. 重建项目:
npm run build
  1. 启动服务器来测试您的更改:
npm start

执照

国际学习中心

贡献

  1. 分叉存储库
  2. 创建你的功能分支
  3. 提交你的更改
  4. 推送到分支
  5. 创建新的 Pull 请求

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

模型上下文协议服务器实现,可通过 SSH 安全地执行远程命令,并具有管理和使用 SSH 凭据的功能。

  1. 特征
    1. 先决条件
      1. 安装
        1. 通过 Smithery 安装
        2. 手动安装
      2. 用法
        1. 配置
        2. 工具
        3. 启动服务器
      3. 项目结构
        1. 依赖项
          1. 发展
            1. 执照
              1. 贡献

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A secure terminal execution server that enables controlled command execution with security features and resource limits via the Model Context Protocol (MCP).
                  Last updated -
                  1
                  12
                  1
                  JavaScript
                  MIT License
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A 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 -
                  8
                  TypeScript
                • -
                  security
                  A
                  license
                  -
                  quality
                  A 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 -
                  2
                  Python
                  MIT License
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server that enables remote execution of shell commands across different operating systems, automatically handling platform-specific differences between Windows and Unix-like systems.
                  Last updated -
                  JavaScript
                  MIT License
                  • Linux

                View all related MCP servers

                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/KinoThe-Kafkaesque/ssh-mcp-server'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server