Switch to primary constructor

This commit is contained in:
2026-05-24 15:31:59 -07:00
parent 9d05553df9
commit b569be9088

View File

@@ -7,18 +7,13 @@ using ModelContextProtocol.Server;
namespace McpSsh.Server.Tools; namespace McpSsh.Server.Tools;
[McpServerToolType] [McpServerToolType]
public sealed class SshTools public sealed class SshTools(SshExecService sshExecService,
TerminalSessionManager terminalSessionManager,
SftpService sftpService)
{ {
private readonly SshExecService _sshExecService; private readonly SshExecService _sshExecService = sshExecService;
private readonly TerminalSessionManager _terminalSessionManager; private readonly TerminalSessionManager _terminalSessionManager = terminalSessionManager;
private readonly SftpService _sftpService; private readonly SftpService _sftpService = sftpService;
public SshTools(SshExecService sshExecService, TerminalSessionManager terminalSessionManager, SftpService sftpService)
{
_sshExecService = sshExecService;
_terminalSessionManager = terminalSessionManager;
_sftpService = sftpService;
}
[McpServerTool(Name = "ssh_exec", Destructive = false)] [McpServerTool(Name = "ssh_exec", Destructive = false)]
[Description("Execute a single command over SSH using key-based authentication.")] [Description("Execute a single command over SSH using key-based authentication.")]