Switch to primary constructor
This commit is contained in:
@@ -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.")]
|
||||||
|
|||||||
Reference in New Issue
Block a user