Skip to main content
Glama
nwnusun-cool

MCP SSH Tools Server

by nwnusun-cool

add_server_config

Easily add and manage SSH server configurations by specifying name, IP, user, password, and port for remote server access. Supports default and custom SSH settings.

Instructions

动态添加服务器配置 参数:

  • name: 服务器名称

  • ip: 服务器IP地址

  • user: SSH用户名

  • password: SSH密码

  • port: SSH端口,默认22

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes
nameYes
passwordYes
portNo
userYes

Implementation Reference

  • main.py:532-559 (handler)
    MCP tool handler for add_server_config. Decorated with @mcp.tool() for registration. Calls mcp_manager.add_server and returns structured response.
    @mcp.tool() def add_server_config(name: str, ip: str, user: str, password: str, port: int = 22) -> Dict[str, Any]: """ 动态添加服务器配置 参数: - name: 服务器名称 - ip: 服务器IP地址 - user: SSH用户名 - password: SSH密码 - port: SSH端口,默认22 """ try: mcp_manager.add_server(name, ip, user, password, port) return { "success": True, "message": f"服务器配置添加成功: {name}", "server": { "name": name, "ip": ip, "user": user, "port": port } } except Exception as e: return { "success": False, "error": str(e) }
  • main.py:69-78 (helper)
    Core helper method in MCPManager class that stores the new server configuration in the server_configs dictionary using ServerConfig.
    def add_server(self, name: str, ip: str, user: str, password: str, port: int = 22): """添加服务器配置""" self.server_configs[name] = ServerConfig( name=name, ssh_ip=ip, ssh_user=user, ssh_password=password, ssh_port=port ) logger.info(f"添加服务器配置: {name} ({ip}:{port})")
  • Docstring describing the input parameters for the add_server_config tool, serving as schema documentation.
    """ 动态添加服务器配置 参数: - name: 服务器名称 - ip: 服务器IP地址 - user: SSH用户名 - password: SSH密码 - port: SSH端口,默认22 """

Other Tools

Related Tools

Latest Blog Posts

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/nwnusun-cool/mcp-server-ssh-tools'

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