TermSSH MCP
Terminal-first SSH access for MCP clients and AI agents, enabling interactive remote sessions, file uploads, and stateful workflows.
Ask AI about TermSSH MCP
Powered by Claude Β· Grounded in docs
I know everything about TermSSH MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
TermSSH MCP
Terminal-first SSH access for MCP clients, AI agents, and remote automation.
Turn remote machines into agent-friendly, interactive terminal workflows β not just one-shot command execution.
β¨ Why TermSSH MCP
Most SSH tooling for AI workflows is built around run command β get output β done.
That falls apart when the real task is interactive:
- installers ask questions
- shells keep state
- debugging needs multiple steps
- deployments need uploads plus terminal control
- agents need to observe, react, and continue
TermSSH MCP is built for that gap.
Instead of pretending everything is a single command, it gives MCP clients a real operator-style workflow:
open a shell β write input β read output β keep context β upload files β continue working
π§ What makes it different
Terminal-firstInteractive terminal sessions are the core model, not an afterthought. |
Agent-readyDesigned for MCP clients, coding agents, and automation loops. |
Stateful workflowsReuse active sessions so multi-step tasks feel natural and reliable. |
Upload includedMove scripts, configs, payloads, and generated artifacts over SFTP. |
Cross-platformWorks against Linux and Windows SSH targets. |
Clean tool surfaceFocused MCP tools for terminal control and remote file delivery. |
π Core capabilities
- Interactive SSH terminal sessions
- Incremental terminal read / write flow
- Managed terminal session reuse by default
- Optional forced multi-session creation
- Local file upload through SFTP
- Direct text and base64 content upload
- Terminal resize support
- Linux and Windows SSH target support
- MCP-native interface for AI tooling
π§° Tool set
upload-file
Upload a local file from the MCP host machine to the remote SSH server using SFTP.
Parameters
localPathβ local source file pathremotePathβ destination path on the remote hostcreateDirectoriesβ create missing parent directories if neededoverwriteβ replace an existing remote file if presentmodeβ optional POSIX mode such as0644
upload-content
Upload direct text or base64 content to the remote server.
Parameters
contentβ raw text or base64 payloadencodingβutf8orbase64remotePathβ destination path on the remote hostcreateDirectoriesβ create missing parent directories if neededoverwriteβ replace an existing remote file if presentmodeβ optional POSIX mode such as0644
terminal-start
Start an interactive remote terminal session.
Parameters
cwdβ optional working directory after shell startupshellβ optional shell binaryplatformHintβauto,linux, orwindowselevatedβ attemptsuelevation when configuredcolsβ terminal widthrowsβ terminal heightenvβ optional environment variablesmultiSessionβ settrueto force a new managed session instead of reusing an existing one
terminal-write
Write input into an active terminal session.
Parameters
sessionIdβ target session idinputβ text to sendappendNewlineβ append a newline automatically if needed
terminal-read
Read buffered output from a terminal session.
Parameters
sessionIdβ target session idsinceSequenceβ only return output newer than a given sequence numbermaxCharsβ limit the size of returned outputwaitForMsβ optional short polling delay
terminal-resize
Resize an active terminal session.
Parameters
sessionIdβ target session idcolsβ new widthrowsβ new height
terminal-close
Close a terminal session locally.
Parameters
sessionIdβ target session id
π Typical workflow
flowchart LR
A[terminal-start] --> B[terminal-write]
B --> C[terminal-read]
C --> D{Need file?}
D -- Yes --> E[upload-file / upload-content]
D -- No --> F{Continue session?}
E --> F
F -- Yes --> B
F -- No --> G[terminal-close]
This works especially well for:
- interactive package installs
- remote setup and provisioning
- deployments with artifact upload
- debugging services across multiple steps
- stateful shell workflows where context matters
π Installation
Clone the repository
git clone https://github.com/rayss868/termssh-mcp.git
cd termssh-mcp
npm install
npm run build
Install globally
npm install -g termssh-mcp
β Configuration
Required CLI parameters
hostβ hostname or IP address of the remote machineuserβ SSH username
Optional CLI parameters
portβ SSH port, default22passwordβ SSH passwordkeyβ path to a private SSH keysudoPasswordβ optional password for sudo-oriented workflowssuPasswordβ optional password forsu-based elevationtimeoutβ SSH ready timeout in milliseconds, default60000maxCharsβ command-length validation limit, default1000; usenoneor0for unlimited mode
π§© MCP configuration example
{
"mcpServers": {
"termssh-mcp": {
"command": "npx",
"args": [
"-y",
"termssh-mcp",
"--",
"--host=1.2.3.4",
"--port=22",
"--user=root",
"--password=pass",
"--timeout=30000",
"--maxChars=none"
]
}
}
}
SSH key example
{
"mcpServers": {
"termssh-mcp": {
"command": "npx",
"args": [
"-y",
"termssh-mcp",
"--",
"--host=example.com",
"--user=root",
"--key=/path/to/private/key"
]
}
}
}
π€ Claude Code example
Register the server in Claude Code:
claude mcp add --transport stdio termssh-mcp -- npx -y termssh-mcp -- --host=YOUR_HOST --user=YOUR_USER --password=YOUR_PASSWORD
With SSH key authentication:
claude mcp add --transport stdio termssh-mcp -- npx -y termssh-mcp -- --host=example.com --user=root --key=/path/to/private/key
With extended timeout:
claude mcp add --transport stdio termssh-mcp -- npx -y termssh-mcp -- --host=192.168.1.100 --user=admin --password=your_password --timeout=120000 --maxChars=none
π― Great fit for
Developers
|
DevOps / infra teams
|
Agent builders
|
π Development
Build the project:
npm run build
Run tests:
npm test
Use the MCP Inspector:
npm run inspect
π Project structure
src/index.tsβ MCP server entrypoint and tool registrationsrc/ssh-connection-manager.tsβ SSH connection and terminal lifecycle handlingsrc/upload.tsβ upload helpers and interactive session metadata helperssrc/core.tsβ shared validation and SSH utility primitivestest/upload-and-terminal.test.tsβ upload/session unit coveragetest/maxChars.test.tsβ command validation coveragetest/smoke.ssh.test.tsβ smoke tests for current exported behavior
πΊ Roadmap ideas
- richer session metadata inspection
- better remote session observability
- optional session persistence features
- more examples for Claude Code and MCP tools
- deployment-oriented workflow templates
π Security note
TermSSH MCP gives remote access to systems over SSH.
Use it only on infrastructure you own or are explicitly authorized to manage.
π License
Released under the MIT License.
π€ Contributing
Contributions are welcome.
See CONTRIBUTING.md for contribution guidance and CODE_OF_CONDUCT.md for expected behavior.
