mcp-ssh-manager 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +87 -0
- package/.flake8 +15 -0
- package/.hooks-config.json +131 -0
- package/.pre-commit-config.yaml +105 -0
- package/CHANGELOG.md +137 -0
- package/CLAUDE.md +190 -0
- package/CONTRIBUTING.md +114 -0
- package/DESCRIPTION +1 -0
- package/INSTALLATION.md +180 -0
- package/LICENSE +21 -0
- package/QUICKSTART.md +77 -0
- package/README.md +718 -0
- package/cli/README.md +286 -0
- package/cli/build.sh +199 -0
- package/cli/commands/server.sh +284 -0
- package/cli/demo.sh +107 -0
- package/cli/install.sh +164 -0
- package/cli/lib/colors.sh +174 -0
- package/cli/lib/config.sh +284 -0
- package/cli/lib/menu.sh +430 -0
- package/cli/migrate.sh +168 -0
- package/cli/ssh-manager +525 -0
- package/docs/ALIASES_AND_HOOKS.md +285 -0
- package/docs/BACKUP_GUIDE.md +500 -0
- package/docs/DEPLOYMENT_GUIDE.md +241 -0
- package/docs/SEO.md +257 -0
- package/examples/backup-workflow.js +481 -0
- package/examples/claude-code-config.example.json +40 -0
- package/examples/codex-ssh-config.example.toml +71 -0
- package/examples/deploy-workflow.py +183 -0
- package/glama.json +6 -0
- package/package.json +85 -0
- package/profiles/README.md +40 -0
- package/profiles/default.json +52 -0
- package/profiles/docker.json +62 -0
- package/profiles/frappe.json +107 -0
- package/profiles/nodejs.json +63 -0
- package/pyproject.toml +17 -0
- package/scripts/setup-hooks.sh +60 -0
- package/scripts/validate.sh +76 -0
- package/src/backup-manager.js +469 -0
- package/src/command-aliases.js +151 -0
- package/src/config-loader.js +281 -0
- package/src/database-manager.js +555 -0
- package/src/deploy-helper.js +176 -0
- package/src/health-monitor.js +428 -0
- package/src/hooks-system.js +327 -0
- package/src/index.js +4499 -0
- package/src/logger.js +276 -0
- package/src/profile-loader.js +187 -0
- package/src/server-aliases.js +150 -0
- package/src/server-groups.js +409 -0
- package/src/session-manager.js +410 -0
- package/src/ssh-key-manager.js +378 -0
- package/src/ssh-manager.js +435 -0
- package/src/tunnel-manager.js +576 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Contributing to MCP SSH Manager
|
|
2
|
+
|
|
3
|
+
First off, thank you for considering contributing to MCP SSH Manager! It's people like you that make this tool better for everyone.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
|
|
8
|
+
|
|
9
|
+
## How Can I Contribute?
|
|
10
|
+
|
|
11
|
+
### Reporting Bugs
|
|
12
|
+
|
|
13
|
+
Before creating bug reports, please check existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
|
|
14
|
+
|
|
15
|
+
- **Use a clear and descriptive title**
|
|
16
|
+
- **Describe the exact steps to reproduce the problem**
|
|
17
|
+
- **Provide specific examples**
|
|
18
|
+
- **Describe the behavior you observed and expected**
|
|
19
|
+
- **Include logs and error messages**
|
|
20
|
+
- **Include your environment details** (OS, Node.js version, Python version)
|
|
21
|
+
|
|
22
|
+
### Suggesting Enhancements
|
|
23
|
+
|
|
24
|
+
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
|
|
25
|
+
|
|
26
|
+
- **Use a clear and descriptive title**
|
|
27
|
+
- **Provide a detailed description of the suggested enhancement**
|
|
28
|
+
- **Provide specific examples to demonstrate the enhancement**
|
|
29
|
+
- **Describe the current behavior and expected behavior**
|
|
30
|
+
- **Explain why this enhancement would be useful**
|
|
31
|
+
|
|
32
|
+
### Pull Requests
|
|
33
|
+
|
|
34
|
+
1. Fork the repo and create your branch from `main`
|
|
35
|
+
2. If you've added code that should be tested, add tests
|
|
36
|
+
3. Ensure the test suite passes
|
|
37
|
+
4. Make sure your code follows the existing code style
|
|
38
|
+
5. Write a clear commit message
|
|
39
|
+
|
|
40
|
+
## Development Process
|
|
41
|
+
|
|
42
|
+
1. Clone your fork:
|
|
43
|
+
```bash
|
|
44
|
+
git clone https://github.com/your-username/mcp-ssh-manager.git
|
|
45
|
+
cd mcp-ssh-manager
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. Install dependencies:
|
|
49
|
+
```bash
|
|
50
|
+
npm install
|
|
51
|
+
pip install -r tools/requirements.txt
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. Create a branch:
|
|
55
|
+
```bash
|
|
56
|
+
git checkout -b feature/your-feature-name
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
4. Make your changes and test them
|
|
60
|
+
|
|
61
|
+
5. Commit your changes:
|
|
62
|
+
```bash
|
|
63
|
+
git add .
|
|
64
|
+
git commit -m "Add your descriptive commit message"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
6. Push to your fork:
|
|
68
|
+
```bash
|
|
69
|
+
git push origin feature/your-feature-name
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
7. Open a Pull Request
|
|
73
|
+
|
|
74
|
+
## Style Guidelines
|
|
75
|
+
|
|
76
|
+
### JavaScript Style
|
|
77
|
+
- Use ES6+ features
|
|
78
|
+
- Use async/await for asynchronous code
|
|
79
|
+
- Add JSDoc comments for functions
|
|
80
|
+
- Use meaningful variable names
|
|
81
|
+
|
|
82
|
+
### Python Style
|
|
83
|
+
- Follow PEP 8
|
|
84
|
+
- Use type hints where appropriate
|
|
85
|
+
- Add docstrings to functions and classes
|
|
86
|
+
- Use meaningful variable names
|
|
87
|
+
|
|
88
|
+
### Commit Messages
|
|
89
|
+
- Use the present tense ("Add feature" not "Added feature")
|
|
90
|
+
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
|
91
|
+
- Limit the first line to 72 characters or less
|
|
92
|
+
- Reference issues and pull requests liberally after the first line
|
|
93
|
+
|
|
94
|
+
## Testing
|
|
95
|
+
|
|
96
|
+
Before submitting a pull request:
|
|
97
|
+
|
|
98
|
+
1. Test your changes manually
|
|
99
|
+
2. Ensure existing functionality still works
|
|
100
|
+
3. Test with different server configurations
|
|
101
|
+
4. Verify Claude Code integration works
|
|
102
|
+
|
|
103
|
+
## Documentation
|
|
104
|
+
|
|
105
|
+
- Update README.md if you change functionality
|
|
106
|
+
- Add JSDoc/docstrings for new functions
|
|
107
|
+
- Update examples if needed
|
|
108
|
+
- Keep documentation clear and concise
|
|
109
|
+
|
|
110
|
+
## Questions?
|
|
111
|
+
|
|
112
|
+
Feel free to open an issue with your question or reach out to the maintainers.
|
|
113
|
+
|
|
114
|
+
Thank you for contributing! 🎉
|
package/DESCRIPTION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MCP SSH Manager: Model Context Protocol server for SSH remote server management from Claude Code and OpenAI Codex. Execute commands, transfer files, manage databases, automate backups, monitor health, and streamline DevOps workflows with AI-powered SSH automation.
|
package/INSTALLATION.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Installation Guide for MCP SSH Manager
|
|
2
|
+
|
|
3
|
+
## 📋 Prerequisites
|
|
4
|
+
|
|
5
|
+
- **Node.js** (v18 or higher) - [Download](https://nodejs.org/)
|
|
6
|
+
- **Claude Code CLI** - [Installation Guide](https://claude.ai/code)
|
|
7
|
+
- **Bash** (4.0+) - Pre-installed on macOS/Linux
|
|
8
|
+
- **Git** - For cloning the repository
|
|
9
|
+
|
|
10
|
+
Verify installations:
|
|
11
|
+
```bash
|
|
12
|
+
node --version # Should show v18.x.x or higher
|
|
13
|
+
claude --version # Should show Claude Code version
|
|
14
|
+
bash --version # Should show version 4.0 or higher
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 🚀 Quick Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# 1. Clone the repository
|
|
21
|
+
git clone https://github.com/bvisible/mcp-ssh-manager.git
|
|
22
|
+
cd mcp-ssh-manager
|
|
23
|
+
|
|
24
|
+
# 2. Install dependencies
|
|
25
|
+
npm install
|
|
26
|
+
|
|
27
|
+
# 3. Install the Bash CLI
|
|
28
|
+
cd cli && ./install.sh
|
|
29
|
+
cd ..
|
|
30
|
+
|
|
31
|
+
# 4. Install to Claude Code
|
|
32
|
+
claude mcp add ssh-manager node $(pwd)/src/index.js
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 🔧 Server Configuration
|
|
36
|
+
|
|
37
|
+
### Interactive Mode (Recommended)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Launch interactive menu
|
|
41
|
+
ssh-manager
|
|
42
|
+
|
|
43
|
+
# Choose "Server Management" → "Add New Server"
|
|
44
|
+
# Follow the guided wizard
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Direct Commands
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
ssh-manager server add # Add new server
|
|
51
|
+
ssh-manager server list # List all servers
|
|
52
|
+
ssh-manager server test # Test connection
|
|
53
|
+
ssh-manager server remove # Remove server
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Manual Configuration
|
|
57
|
+
|
|
58
|
+
Edit the `.env` file directly:
|
|
59
|
+
|
|
60
|
+
```env
|
|
61
|
+
# Pattern: SSH_SERVER_[NAME]_[PROPERTY]
|
|
62
|
+
|
|
63
|
+
# Password authentication
|
|
64
|
+
SSH_SERVER_PROD1_HOST=example.com
|
|
65
|
+
SSH_SERVER_PROD1_USER=admin
|
|
66
|
+
SSH_SERVER_PROD1_PASSWORD=secure_password
|
|
67
|
+
SSH_SERVER_PROD1_PORT=22
|
|
68
|
+
SSH_SERVER_PROD1_DESCRIPTION="Production Server"
|
|
69
|
+
|
|
70
|
+
# SSH key authentication (recommended)
|
|
71
|
+
SSH_SERVER_DEV1_HOST=dev.example.com
|
|
72
|
+
SSH_SERVER_DEV1_USER=developer
|
|
73
|
+
SSH_SERVER_DEV1_KEYPATH=~/.ssh/id_rsa
|
|
74
|
+
SSH_SERVER_DEV1_PORT=22
|
|
75
|
+
SSH_SERVER_DEV1_DEFAULT_DIR=/var/www
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## ✅ Verification
|
|
79
|
+
|
|
80
|
+
### 1. Check CLI Installation
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
ssh-manager --version
|
|
84
|
+
# Should show: SSH Manager CLI v2.0.0
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2. Check MCP Installation
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
claude mcp list
|
|
91
|
+
# Should show: ssh-manager
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 3. Test in Claude Code
|
|
95
|
+
|
|
96
|
+
Open Claude Code and try:
|
|
97
|
+
```
|
|
98
|
+
"List all SSH servers"
|
|
99
|
+
"Connect to production server"
|
|
100
|
+
"Upload file to staging"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 🛠️ Troubleshooting
|
|
104
|
+
|
|
105
|
+
### CLI not found
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Add to your PATH
|
|
109
|
+
echo 'export PATH="$PATH:/usr/local/bin"' >> ~/.bashrc
|
|
110
|
+
source ~/.bashrc
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Servers not showing
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Check .env file location
|
|
117
|
+
export SSH_MANAGER_ENV="$(pwd)/.env"
|
|
118
|
+
ssh-manager server list
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Permission denied
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Fix SSH key permissions
|
|
125
|
+
chmod 600 ~/.ssh/your_key
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### MCP tools not available
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Restart Claude Code and re-add
|
|
132
|
+
claude mcp remove ssh-manager
|
|
133
|
+
claude mcp add ssh-manager node $(pwd)/src/index.js
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## 🌍 Environment Variables
|
|
137
|
+
|
|
138
|
+
Set these in your shell profile (`~/.bashrc` or `~/.zshrc`):
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Point to your .env file
|
|
142
|
+
export SSH_MANAGER_ENV="/path/to/your/.env"
|
|
143
|
+
|
|
144
|
+
# Optional: Set default log level
|
|
145
|
+
export SSH_LOG_LEVEL="INFO"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## 📦 Project Scope Installation
|
|
149
|
+
|
|
150
|
+
To share with your team:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Create project configuration
|
|
154
|
+
claude mcp add ssh-manager --scope project node $(pwd)/src/index.js
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
This creates `.mcp.json` that can be committed to Git.
|
|
158
|
+
|
|
159
|
+
## 🗑️ Uninstallation
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Remove from Claude Code
|
|
163
|
+
claude mcp remove ssh-manager
|
|
164
|
+
|
|
165
|
+
# Uninstall CLI
|
|
166
|
+
sudo rm /usr/local/bin/ssh-manager
|
|
167
|
+
|
|
168
|
+
# Remove configuration
|
|
169
|
+
rm -rf ~/.ssh-manager
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## 📚 Next Steps
|
|
173
|
+
|
|
174
|
+
After installation:
|
|
175
|
+
1. Add your servers using the interactive wizard
|
|
176
|
+
2. Test connections: `ssh-manager server test`
|
|
177
|
+
3. Try quick SSH: `ssh-manager ssh servername`
|
|
178
|
+
4. Explore features: `ssh-manager --help`
|
|
179
|
+
|
|
180
|
+
For more information, see the [README](README.md).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 MCP SSH Manager Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/QUICKSTART.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Quick Start Guide - MCP SSH Manager
|
|
2
|
+
|
|
3
|
+
Get up and running in 5 minutes! 🚀
|
|
4
|
+
|
|
5
|
+
## 1️⃣ Clone & Install (1 minute)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/bvisible/mcp-ssh-manager.git
|
|
9
|
+
cd mcp-ssh-manager
|
|
10
|
+
npm install
|
|
11
|
+
cd cli && ./install.sh
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 2️⃣ Add Your First Server (2 minutes)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Launch interactive menu
|
|
18
|
+
ssh-manager
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Choose: `1) Server Management` → `1) Add New Server`
|
|
22
|
+
|
|
23
|
+
Enter:
|
|
24
|
+
- Name: `myserver`
|
|
25
|
+
- Host: `your.server.com`
|
|
26
|
+
- Username: `yourusername`
|
|
27
|
+
- Port: `22`
|
|
28
|
+
- Choose authentication method (SSH key recommended)
|
|
29
|
+
|
|
30
|
+
## 3️⃣ Install to Claude Code (1 minute)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
claude mcp add ssh-manager node $(pwd)/src/index.js
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 4️⃣ Test It! (1 minute)
|
|
37
|
+
|
|
38
|
+
In Claude Code:
|
|
39
|
+
```bash
|
|
40
|
+
claude
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Try these commands:
|
|
44
|
+
```
|
|
45
|
+
"List my SSH servers"
|
|
46
|
+
"Execute 'hostname' on myserver"
|
|
47
|
+
"Run 'ls -la' on myserver"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 🎉 That's it!
|
|
51
|
+
|
|
52
|
+
You're now connected to your server through Claude Code!
|
|
53
|
+
|
|
54
|
+
## 📝 Common Commands
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ssh-manager # Interactive menu
|
|
58
|
+
ssh-manager server list # List servers
|
|
59
|
+
ssh-manager ssh myserver # Quick SSH
|
|
60
|
+
ssh-manager server test # Test connections
|
|
61
|
+
ssh-manager sync push myserver ./app /var/www/ # Upload files
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 💡 Pro Tips
|
|
65
|
+
|
|
66
|
+
1. **Set environment variable** in `~/.bashrc` or `~/.zshrc`:
|
|
67
|
+
```bash
|
|
68
|
+
export SSH_MANAGER_ENV="/path/to/your/.env"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
2. **Create shortcuts**:
|
|
72
|
+
```bash
|
|
73
|
+
alias ssm="ssh-manager"
|
|
74
|
+
alias ssm-list="ssh-manager server list"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Need help? Run `ssh-manager --help`
|