Enables persistent terminal sessions with state preservation, allowing execution of commands across SSH connections while maintaining context, environment variables, and working directories between operations.
Provides session management capabilities for creating, listing, and closing isolated terminal sessions, enabling parallel operations and separate execution environments.
Facilitates shell command execution with support for SSH connections, file transfers up to 10MB, and stateful terminal operations including working through jump hosts and bastion servers.
π MCP ShellKeeper
Persistent Terminal Sessions + File Transfer for AI Assistants
SSH into servers, run commands, transfer files β all through your AI assistant. No more stateless limitations.
Real-World Example β’ Installation β’ Core Features β’ Use Cases β’ Tools
π― The Problem
AI assistants like Cursor execute commands statelessly β each command runs in a fresh environment:
β¨ The Solution
ShellKeeper transforms AI assistants into stateful operators with persistent sessions and file transfer capabilities.
π Core Features
π Stateful Execution
Traditional AI (Stateless)
ShellKeeper (Stateful)
AI maintains full context between your questions!
π― Persistent Sessions
Natural Conversation Flow
The AI remembers everything:
β Your SSH connections
β Current directories
β Environment variables
β All previous context
π Seamless File Transfer
Just Ask in Natural Language
It just works:
β Through any SSH session
β Multiple jump hosts
β Up to 10MB files
β Binary and text files
π¬ Real-World Example
Watch how a natural conversation becomes automated operations:
π¦ Installation
Configuration
Cursor
Settings JSON:
(Cmd+Shift+P β Preferences: Open Settings)
Claude Code
Config file:
(~/.config/claude/config.json)
VS Code (Cline)
Settings JSON:
Restart your AI assistant and you're ready! π
π‘ Use Cases
Scenario | What You Ask | What AI Does |
π Debug Production | "Why is prod-api slow?" | SSH β Check CPU/memory β Download logs β Analyze β Upload fix β Restart |
π Deploy Updates | "Deploy v2.0 to staging" | SSH β Backup β Upload files β Migrate DB β Restart β Verify |
π§ Update Configs | "Update SSL certs on web servers" | SSH β Download old certs β Upload new β Test β Reload nginx |
ποΈ Backup Database | "Backup prod DB to local" | SSH through bastion β Dump DB β Compress β Download β Verify |
π Analyze Logs | "Find all 500 errors today" | SSH β Parse logs β Download β Analyze locally β Report patterns |
π Batch Operations | "Update configs on all servers" | Parallel sessions β Upload β Restart β Download results |
All through natural conversation with your AI! No scripts, no manual SSH juggling.
π Available Tools
The AI uses these tools automatically, but you can reference them for advanced use:
Tool | Purpose | Key Features |
| Run commands in persistent session | Timeout config, exit code capture, clean output |
| Upload local β remote (max 10MB) | Auto-detect directory, handle duplicates, works through SSH |
| Download remote β local (max 10MB) | Auto-create dirs, preserve permissions, verify integrity |
| Create isolated session | Parallel operations, separate environments |
| View all active sessions | Status, uptime, last command |
| Clean up session | Free resources when done |
| Debug raw output | Useful for troubleshooting |
π‘ Tip: The AI handles these automatically based on your natural language requests!
π Security Best Practices
β DO:
Use SSH key authentication (not passwords):
ssh-keygen -t ed25519Jump through bastion hosts for production:
ssh -J bastion.com user@prodLimit file upload destinations (avoid
/etc,/root,.ssh/)Use read-only accounts for investigation
Clean up sessions after tasks
Audit all AI operations
β DON'T:
Store passwords in commands or configs
Upload untrusted files to production
Download sensitive data without encryption
Run destructive commands without verification
Grant unnecessary permissions
π οΈ How It Works
Persistent Sessions:
Uses PTY (Pseudo-Terminal) for full TTY emulation with state persistence
Smart markers detect command completion automatically
Exit codes captured for error detection
Output parsed clean (no ANSI codes)
File Transfer:
Base64 encoding through existing SSH sessions (no separate SCP/SFTP)
Works through jump hosts without re-authentication
Max 10MB, 5-minute timeout (completes early if faster)
π Troubleshooting
π§ͺ Development
π€ Contributing
Contributions welcome! Help make AI-assisted server management better.
Fork the repository
Create feature branch (
git checkout -b feature/amazing-feature)Commit changes (
git commit -m 'Add amazing feature')Push to branch (
git push origin feature/amazing-feature)Open Pull Request
π License
MIT License - see LICENSE file for details.
You can:
β Use commercially
β Modify
β Distribute
β Private use
π Acknowledgments
Built with Model Context Protocol SDK
Uses node-pty for terminal emulation
Inspired by the need for stateful command execution in AI workflows
π Support
Issues: GitHub Issues
Discussions: GitHub Discussions
MCP Community: Discord
Built with β€οΈ for the AI developer community
Stateful execution + File transfer = Limitless possibilities
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables AI assistants to maintain persistent SSH terminal sessions and transfer files to/from remote servers. Allows stateful command execution, natural language server management, and seamless file operations through SSH connections.