vpsnet-mcp 1.0.3 → 1.0.5

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.
Files changed (3) hide show
  1. package/README.md +137 -6
  2. package/build/index.js +20 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -15,6 +15,22 @@
15
15
  - Ordering new VPS instances
16
16
  - System status & pricing
17
17
 
18
+ ## Prerequisites
19
+
20
+ Before installing, ensure you have:
21
+
22
+ 1. **Node.js 18 or newer**
23
+ - Check: `node --version`
24
+ - Linux/macOS: [nodejs.org](https://nodejs.org) or your package manager
25
+ - Windows: `winget install OpenJS.NodeJS.LTS` or download from [nodejs.org](https://nodejs.org)
26
+ - After installing Node.js, **restart your terminal/editor**
27
+
28
+ 2. **For Claude Code (CLI or VS Code extension) users:**
29
+ - Claude Code CLI installed globally: `npm install -g @anthropic-ai/claude-code`
30
+ - Check: `claude --version`
31
+
32
+ 3. **Active [VPSnet.com](https://www.vpsnet.com) account** with an API key (see [Getting an API key](#getting-an-api-key))
33
+
18
34
  ## SSH access workflow
19
35
 
20
36
  This MCP server manages your VPS infrastructure through the VPSnet.com API, including SSH key provisioning. Once an SSH key is deployed to a VPS, the AI assistant can connect directly using its environment's terminal (e.g. Claude Code's Bash tool, Cline's terminal).
@@ -28,15 +44,38 @@ This MCP server manages your VPS infrastructure through the VPSnet.com API, incl
28
44
 
29
45
  Most AI coding environments (Claude Code, Cline, Cursor, Codex) have built-in terminal access, so the AI can SSH into your VPS immediately after deploying a key — no extra tools needed.
30
46
 
31
- For environments without native SSH access, consider pairing this with a dedicated SSH MCP server for direct server connectivity.
47
+ For environments without native SSH access, pair this with [mcp-server-ssh](https://github.com/bacarrdy/mcp-server-ssh) for direct server connectivity via MCP tools.
32
48
 
33
- ## Requirements
49
+ **Combined config:**
34
50
 
35
- - Node.js 18 or newer
36
- - A [VPSnet.com](https://www.vpsnet.com) account with an API key
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "vpsnet": {
55
+ "command": "npx",
56
+ "args": ["-y", "vpsnet-mcp"],
57
+ "env": {
58
+ "VPSNET_API_KEY": "your_api_key_here"
59
+ }
60
+ },
61
+ "ssh": {
62
+ "command": "npx",
63
+ "args": ["-y", "mcp-server-ssh"]
64
+ }
65
+ }
66
+ }
67
+ ```
37
68
 
38
69
  ## Getting started
39
70
 
71
+ Choose your environment:
72
+
73
+ - [Claude Code (CLI)](#claude-code) — Terminal-based AI coding
74
+ - [Claude Code for VS Code](#claude-code-for-vs-code-extension) — VS Code extension
75
+ - [Claude Desktop](#claude-desktop) — Desktop app
76
+ - [VS Code with GitHub Copilot](#vs-code-with-github-copilot) — Copilot agent mode
77
+ - [Cline](#cline) / [Cursor](#cursor) / [Windsurf](#windsurf) / [Roo Code](#roo-code) / [Codex](#codex) — Other clients
78
+
40
79
  The standard config works across most MCP clients:
41
80
 
42
81
  ```json
@@ -68,6 +107,47 @@ export VPSNET_API_KEY="your_api_key_here"
68
107
 
69
108
  </details>
70
109
 
110
+ <details>
111
+ <summary>Claude Code for VS Code Extension</summary>
112
+
113
+ > This section is for the **Claude Code VS Code extension**, not GitHub Copilot. If you use VS Code with GitHub Copilot, see the [VS Code with GitHub Copilot](#vs-code-with-github-copilot) section instead.
114
+
115
+ **Step 1:** Install Claude Code CLI globally (required for the extension):
116
+
117
+ ```bash
118
+ npm install -g @anthropic-ai/claude-code
119
+ ```
120
+
121
+ **Step 2:** Add the MCP server via CLI:
122
+
123
+ ```bash
124
+ claude mcp add vpsnet -- npx -y vpsnet-mcp
125
+ ```
126
+
127
+ **Step 3:** Add your API key. Edit `~/.claude.json` (or `C:\Users\<username>\.claude.json` on Windows), find the `vpsnet` server section and add the `env` block:
128
+
129
+ ```json
130
+ "vpsnet": {
131
+ "type": "stdio",
132
+ "command": "npx",
133
+ "args": ["-y", "vpsnet-mcp"],
134
+ "env": {
135
+ "VPSNET_API_KEY": "your_api_key_here",
136
+ "VPSNET_API_URL": "https://api.vpsnet.com"
137
+ }
138
+ }
139
+ ```
140
+
141
+ **Step 4:** Restart VS Code completely (Ctrl+Shift+P > "Reload Window" or close and reopen).
142
+
143
+ **Step 5:** Verify by asking Claude: *"Get my VPSnet account info"*
144
+
145
+ > **Windows users:** Use PowerShell or CMD (not Git Bash) when running `claude mcp add` commands.
146
+
147
+ > The `code --add-mcp` command does **NOT** work with Claude Code extension — that's for VS Code Copilot only.
148
+
149
+ </details>
150
+
71
151
  <details>
72
152
  <summary>Claude Desktop</summary>
73
153
 
@@ -164,7 +244,7 @@ Open Roo Code MCP settings and add to `roo_mcp_settings.json`:
164
244
  </details>
165
245
 
166
246
  <details>
167
- <summary>VS Code (Copilot)</summary>
247
+ <summary>VS Code with GitHub Copilot</summary>
168
248
 
169
249
  Install using the VS Code CLI:
170
250
 
@@ -174,6 +254,8 @@ code --add-mcp '{"name":"vpsnet","command":"npx","args":["-y","vpsnet-mcp"],"env
174
254
 
175
255
  Or add to your VS Code MCP config manually using the standard config above.
176
256
 
257
+ > This is for **GitHub Copilot** agent mode in VS Code. For the **Claude Code** extension, see the [Claude Code for VS Code Extension](#claude-code-for-vs-code-extension) section.
258
+
177
259
  </details>
178
260
 
179
261
  <details>
@@ -183,6 +265,14 @@ Follow the [Windsurf MCP documentation](https://docs.windsurf.com/windsurf/mcp).
183
265
 
184
266
  </details>
185
267
 
268
+ ## Windows Users
269
+
270
+ - Use **PowerShell or CMD** (not Git Bash) for `claude mcp add` commands
271
+ - Config file location: `C:\Users\<YourUsername>\.claude.json`
272
+ - Install Node.js: `winget install OpenJS.NodeJS.LTS` or download from [nodejs.org](https://nodejs.org)
273
+ - After installing Node.js, **restart your terminal and VS Code**
274
+ - Environment variables in Claude Code extension must be in the `env` object within `.claude.json`, NOT system environment variables
275
+
186
276
  ## Environment variables
187
277
 
188
278
  | Variable | Required | Description |
@@ -298,10 +388,51 @@ Follow the [Windsurf MCP documentation](https://docs.windsurf.com/windsurf/mcp).
298
388
  1. Log in at [vpsnet.com](https://www.vpsnet.com)
299
389
  2. Go to **Account** > **API Keys**
300
390
  3. Click **Create API Key**
301
- 4. Set the scope to match your needs and copy the key
391
+ 4. Give it a name and copy the key
302
392
 
303
393
  The key is shown only once — store it securely.
304
394
 
395
+ ## Troubleshooting
396
+
397
+ ### MCP tools not appearing in Claude Code VS Code extension
398
+
399
+ 1. Install Claude Code CLI: `npm install -g @anthropic-ai/claude-code`
400
+ 2. Verify: `claude --version` should show a version number
401
+ 3. Add server via CLI: `claude mcp add vpsnet -- npx -y vpsnet-mcp`
402
+ 4. **Completely restart VS Code** (not just reload window)
403
+ 5. Check `~/.claude.json` for correct configuration
404
+
405
+ ### `claude: command not found`
406
+
407
+ Install the Claude Code CLI globally:
408
+
409
+ ```bash
410
+ npm install -g @anthropic-ai/claude-code
411
+ ```
412
+
413
+ Verify your PATH includes npm global packages. On Windows, restart your terminal after installing.
414
+
415
+ ### Environment variables not working
416
+
417
+ For Claude Code extension, environment variables **must** be in the `env` object within `.claude.json`, NOT system environment variables:
418
+
419
+ ```json
420
+ "vpsnet": {
421
+ "type": "stdio",
422
+ "command": "npx",
423
+ "args": ["-y", "vpsnet-mcp"],
424
+ "env": {
425
+ "VPSNET_API_KEY": "your_actual_key_here"
426
+ }
427
+ }
428
+ ```
429
+
430
+ ### API key errors
431
+
432
+ - Verify the key is correct (starts with `vpsnet_`)
433
+ - Keys are shown only once at creation — if lost, create a new one
434
+ - Check that the key hasn't expired (Account > API Keys)
435
+
305
436
  ## License
306
437
 
307
438
  [MIT](LICENSE)
package/build/index.js CHANGED
@@ -26,19 +26,32 @@ const server = new McpServer({ name: "vpsnet", version: "1.0.0" }, {
26
26
  "Use that terminal to run: ssh -o StrictHostKeyChecking=no root@<vps_ip>",
27
27
  "",
28
28
  "### Step-by-step SSH key flow:",
29
- "1. Read YOUR local machine's public key from ~/.ssh/id_rsa.pub or ~/.ssh/id_ed25519.pub",
30
- "2. Upload it via create_ssh_key(name, public_key) — name it descriptively e.g. 'claude-code-key'",
31
- "3. Deploy it to the VPS via deploy_ssh_key(orderNo, ssh_key_id) OR pass sshKey when ordering a new VPS",
32
- "4. SSH directly using your environment's terminal: ssh -o StrictHostKeyChecking=no root@<vps_ip>",
33
- "5. Now you can run any commands inside the VPS (apt install, configure services, deploy apps, etc.)",
29
+ "1. Check if a local SSH public key exists: try reading ~/.ssh/id_rsa.pub, ~/.ssh/id_ed25519.pub, or ~/.ssh/id_ecdsa.pub",
30
+ "2. If NO local key exists, you MUST generate one BEFORE proceeding:",
31
+ " - If mcp-server-ssh is available: use ssh_keygen(type='ecdsa', bits=256) to generate a key pair, then save the files locally",
32
+ " - If a terminal/bash is available: run ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_ed25519",
33
+ " - Then read the newly created public key file",
34
+ "3. Upload the public key via create_ssh_key(name, public_key) — name it descriptively e.g. 'claude-code-key'",
35
+ "4. Deploy it to the VPS via deploy_ssh_key(orderNo, ssh_key_id) OR pass sshKey when ordering a new VPS",
36
+ "5. SSH directly using your environment's terminal: ssh -o StrictHostKeyChecking=no root@<vps_ip>",
37
+ "6. Now you can run any commands inside the VPS (apt install, configure services, deploy apps, etc.)",
34
38
  "",
35
39
  "### Important SSH notes:",
36
40
  "- ALWAYS prefer sshKey over rootPassword — it's more secure and enables direct access.",
37
41
  "- NEVER use someone else's SSH key — always read from the local machine where you are running.",
38
42
  "- Use -o StrictHostKeyChecking=no when connecting to newly created VPS to avoid host key prompts.",
39
43
  "- order_service uses 'sshKey' (camelCase) but deploy_ssh_key uses 'ssh_key' (snake_case) — different field names!",
40
- "- Only fall back to rootPassword if the local machine has no SSH key (e.g. Windows without OpenSSH).",
41
- "- If your environment has no terminal/bash access at all, consider using a dedicated SSH MCP server for connectivity.",
44
+ "- Only fall back to rootPassword if key generation is truly impossible (no ssh-keygen, no mcp-server-ssh, no filesystem write).",
45
+ "",
46
+ "## Pairing with mcp-server-ssh (npm: mcp-server-ssh)",
47
+ "If mcp-server-ssh is also installed, you get powerful SSH tools for direct VPS management:",
48
+ "- ssh_keygen: generate SSH key pairs without needing ssh-keygen binary",
49
+ "- ssh_connect + ssh_exec: execute commands on VPS via pure JS SSH (no native SSH client needed)",
50
+ "- sftp_write/sftp_read: transfer files to/from VPS without scp",
51
+ "Combined workflow: order VPS with vpsnet-mcp → generate key with ssh_keygen → upload with create_ssh_key → connect with ssh_connect → manage with ssh_exec/sftp_*",
52
+ "Combined config for Claude Desktop:",
53
+ ' "vpsnet": { "command": "npx", "args": ["-y", "vpsnet-mcp"], "env": { "VPSNET_API_KEY": "..." } }',
54
+ ' "ssh": { "command": "npx", "args": ["-y", "mcp-server-ssh"] }',
42
55
  "",
43
56
  "## Plan changes",
44
57
  "Plan changes are FREE — remaining time is recalculated (upgrade = shorter expiry, downgrade = longer expiry).",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpsnet-mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "MCP server for managing VPSnet.com virtual private servers",
6
6
  "bin": {