Description
Currently, ssh-mcp-server does not support parsing or honoring the ForwardAgent directive from ~/.ssh/config. This limits the ability to use pre-configured SSH agent forwarding settings defined in standard SSH configuration files.
Requested Feature
Add support for the ForwardAgent SSH config directive so that users can configure agent forwarding through their ~/.ssh/config file, similar to how native SSH clients work.
Expected behavior:
- Parse
ForwardAgent yes/no from host blocks in ~/.ssh/config
- When
ForwardAgent yes is set for a host alias and that alias is used with --host, automatically enable agent forwarding without requiring explicit --agent parameter
Current Workaround
Users currently must:
- Manually determine their SSH agent socket path (e.g.,
$SSH_AUTH_SOCK)
- Explicitly pass it via
--agent /path/to/socket for each connection
This is less convenient than leveraging existing SSH config settings.
Related Code
- SSH config parser:
src/utils/ssh-config-parser.ts (currently only extracts hostname, user, port, identityfile)
- SSH connection config types:
src/models/types.ts (has agent?: string field)
- SSH connection manager:
src/services/ssh-connection-manager.ts (handles agent authentication)
Benefits
- Better integration with standard SSH configuration workflows
- Reduced need for manual parameter specification
- Consistency with native SSH client behavior
Description
Currently,
ssh-mcp-serverdoes not support parsing or honoring theForwardAgentdirective from~/.ssh/config. This limits the ability to use pre-configured SSH agent forwarding settings defined in standard SSH configuration files.Requested Feature
Add support for the
ForwardAgentSSH config directive so that users can configure agent forwarding through their~/.ssh/configfile, similar to how native SSH clients work.Expected behavior:
ForwardAgent yes/nofrom host blocks in~/.ssh/configForwardAgent yesis set for a host alias and that alias is used with--host, automatically enable agent forwarding without requiring explicit--agentparameterCurrent Workaround
Users currently must:
$SSH_AUTH_SOCK)--agent /path/to/socketfor each connectionThis is less convenient than leveraging existing SSH config settings.
Related Code
src/utils/ssh-config-parser.ts(currently only extractshostname,user,port,identityfile)src/models/types.ts(hasagent?: stringfield)src/services/ssh-connection-manager.ts(handles agent authentication)Benefits