ssh_reload_config
Reload SSH configuration files to apply changes without restarting services, ensuring updated policies and security controls take effect immediately.
Instructions
Reload configuration files.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_ssh/mcp_server.py:1388-1404 (handler)The handler function for ssh_reload_config tool. Decorated with @mcp.tool() for registration in FastMCP. Calls config.reload() to reload configuration files from disk and returns success/error status.def ssh_reload_config(ctx: Context | None = None) -> ToolResult: """Reload configuration files.""" try: config.reload() _ctx_log(ctx, "info", "ssh_reload_config", {"status": "reloaded"}) return {"status": "reloaded"} except Exception as e: error_str = str(e) log_json({"level": "error", "msg": "reload_exception", "error": error_str}) _ctx_log( ctx, "debug", "ssh_reload_config_error", {"error": sanitize_error(error_str)}, ) return {"status": "error", "error": sanitize_error(error_str)}
- src/mcp_ssh/config.py:532-538 (helper)The Config.reload() helper method invoked by the tool handler. Loads the three YAML config files (servers.yml, credentials.yml, policy.yml) into the Config instance's _data.def reload(self) -> None: """Reload configuration from disk.""" servers = _load_yaml(os.path.join(self.config_dir, "servers.yml")) creds = _load_yaml(os.path.join(self.config_dir, "credentials.yml")) policy = _load_yaml(os.path.join(self.config_dir, "policy.yml")) self._data = {"servers": servers, "credentials": creds, "policy": policy}
- src/mcp_ssh/mcp_server.py:1388-1404 (registration)The @mcp.tool() decorator registers ssh_reload_config as an MCP tool, with auto-generated schema from type hints (optional ctx parameter).def ssh_reload_config(ctx: Context | None = None) -> ToolResult: """Reload configuration files.""" try: config.reload() _ctx_log(ctx, "info", "ssh_reload_config", {"status": "reloaded"}) return {"status": "reloaded"} except Exception as e: error_str = str(e) log_json({"level": "error", "msg": "reload_exception", "error": error_str}) _ctx_log( ctx, "debug", "ssh_reload_config_error", {"error": sanitize_error(error_str)}, ) return {"status": "error", "error": sanitize_error(error_str)}