vpsnet-mcp 1.0.4 → 1.0.6
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/README.md +117 -6
- package/build/index.js +7 -7
- 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).
|
|
@@ -50,12 +66,15 @@ For environments without native SSH access, pair this with [mcp-server-ssh](http
|
|
|
50
66
|
}
|
|
51
67
|
```
|
|
52
68
|
|
|
53
|
-
##
|
|
69
|
+
## Getting started
|
|
54
70
|
|
|
55
|
-
|
|
56
|
-
- A [VPSnet.com](https://www.vpsnet.com) account with an API key
|
|
71
|
+
Choose your environment:
|
|
57
72
|
|
|
58
|
-
|
|
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
|
|
59
78
|
|
|
60
79
|
The standard config works across most MCP clients:
|
|
61
80
|
|
|
@@ -88,6 +107,47 @@ export VPSNET_API_KEY="your_api_key_here"
|
|
|
88
107
|
|
|
89
108
|
</details>
|
|
90
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
|
+
|
|
91
151
|
<details>
|
|
92
152
|
<summary>Claude Desktop</summary>
|
|
93
153
|
|
|
@@ -184,7 +244,7 @@ Open Roo Code MCP settings and add to `roo_mcp_settings.json`:
|
|
|
184
244
|
</details>
|
|
185
245
|
|
|
186
246
|
<details>
|
|
187
|
-
<summary>VS Code
|
|
247
|
+
<summary>VS Code with GitHub Copilot</summary>
|
|
188
248
|
|
|
189
249
|
Install using the VS Code CLI:
|
|
190
250
|
|
|
@@ -194,6 +254,8 @@ code --add-mcp '{"name":"vpsnet","command":"npx","args":["-y","vpsnet-mcp"],"env
|
|
|
194
254
|
|
|
195
255
|
Or add to your VS Code MCP config manually using the standard config above.
|
|
196
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
|
+
|
|
197
259
|
</details>
|
|
198
260
|
|
|
199
261
|
<details>
|
|
@@ -203,6 +265,14 @@ Follow the [Windsurf MCP documentation](https://docs.windsurf.com/windsurf/mcp).
|
|
|
203
265
|
|
|
204
266
|
</details>
|
|
205
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
|
+
|
|
206
276
|
## Environment variables
|
|
207
277
|
|
|
208
278
|
| Variable | Required | Description |
|
|
@@ -318,10 +388,51 @@ Follow the [Windsurf MCP documentation](https://docs.windsurf.com/windsurf/mcp).
|
|
|
318
388
|
1. Log in at [vpsnet.com](https://www.vpsnet.com)
|
|
319
389
|
2. Go to **Account** > **API Keys**
|
|
320
390
|
3. Click **Create API Key**
|
|
321
|
-
4.
|
|
391
|
+
4. Give it a name and copy the key
|
|
322
392
|
|
|
323
393
|
The key is shown only once — store it securely.
|
|
324
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
|
+
|
|
325
436
|
## License
|
|
326
437
|
|
|
327
438
|
[MIT](LICENSE)
|
package/build/index.js
CHANGED
|
@@ -16,6 +16,7 @@ const server = new McpServer({ name: "vpsnet", version: "1.0.0" }, {
|
|
|
16
16
|
"rootPassword rules: 6-40 chars, alphanumeric only, MUST contain uppercase + lowercase + digit. Example: 'MyPass123'.",
|
|
17
17
|
"sshKey and rootPassword are mutually exclusive — provide one or the other (or neither for auto-generated password).",
|
|
18
18
|
"After placing an order, wait 10-30 seconds before attempting SSH — the VPS needs time to boot and start SSH daemon.",
|
|
19
|
+
"deploy_ssh_key is also async — wait 15-30 seconds after deploying a key before attempting SSH to any VPS (not just new ones).",
|
|
19
20
|
"",
|
|
20
21
|
"## SSH key workflow (IMPORTANT for deploying software to VPS)",
|
|
21
22
|
"",
|
|
@@ -23,6 +24,7 @@ const server = new McpServer({ name: "vpsnet", version: "1.0.0" }, {
|
|
|
23
24
|
"You MUST deploy YOUR OWN SSH key first, then connect directly via SSH.",
|
|
24
25
|
"After deploying your key, you can INSTANTLY access the VPS — no extra tools needed.",
|
|
25
26
|
"Most AI environments (Claude Code, Cline, Cursor, Codex) have a built-in terminal/bash tool.",
|
|
27
|
+
"IMPORTANT: Grant FULL permissions/access to the AI tool — restricted/sandbox modes may block npm installs or SSH connections.",
|
|
26
28
|
"Use that terminal to run: ssh -o StrictHostKeyChecking=no root@<vps_ip>",
|
|
27
29
|
"",
|
|
28
30
|
"### Step-by-step SSH key flow:",
|
|
@@ -244,7 +246,7 @@ server.registerTool("toggle_extra_settings", {
|
|
|
244
246
|
return { content: [{ type: "text", text: formatJson(data) }] };
|
|
245
247
|
});
|
|
246
248
|
server.registerTool("deploy_ssh_key", {
|
|
247
|
-
description: "Deploy an SSH key to VPS. Use list_ssh_keys to get available key IDs. To add your own key first: read ~/.ssh/id_rsa.pub from local machine, then create_ssh_key, then deploy it here.",
|
|
249
|
+
description: "Deploy an SSH key to VPS. Returns noty UUID for tracking. ASYNC — wait 15-30 seconds after deploying before attempting SSH. Use list_ssh_keys to get available key IDs. To add your own key first: read ~/.ssh/id_rsa.pub from local machine, then create_ssh_key, then deploy it here.",
|
|
248
250
|
inputSchema: {
|
|
249
251
|
orderNo: z.string().describe("Order number"),
|
|
250
252
|
ssh_key: z.number().describe("SSH key ID from list_ssh_keys"),
|
|
@@ -558,7 +560,6 @@ server.registerTool("create_api_key", {
|
|
|
558
560
|
description: "Create a new API key",
|
|
559
561
|
inputSchema: {
|
|
560
562
|
name: z.string().describe("Key name"),
|
|
561
|
-
scope: z.string().describe("Permission scope"),
|
|
562
563
|
allowed_ips: z
|
|
563
564
|
.string()
|
|
564
565
|
.optional()
|
|
@@ -568,8 +569,8 @@ server.registerTool("create_api_key", {
|
|
|
568
569
|
.optional()
|
|
569
570
|
.describe("Expiry date (YYYY-MM-DD)"),
|
|
570
571
|
},
|
|
571
|
-
}, async ({ name,
|
|
572
|
-
const body = { name
|
|
572
|
+
}, async ({ name, allowed_ips, expires_at }) => {
|
|
573
|
+
const body = { name };
|
|
573
574
|
if (allowed_ips)
|
|
574
575
|
body.allowed_ips = allowed_ips;
|
|
575
576
|
if (expires_at)
|
|
@@ -582,7 +583,6 @@ server.registerTool("update_api_key", {
|
|
|
582
583
|
inputSchema: {
|
|
583
584
|
id: z.number().describe("API key ID"),
|
|
584
585
|
name: z.string().describe("Key name"),
|
|
585
|
-
scope: z.string().describe("Permission scope"),
|
|
586
586
|
allowed_ips: z
|
|
587
587
|
.string()
|
|
588
588
|
.optional()
|
|
@@ -592,8 +592,8 @@ server.registerTool("update_api_key", {
|
|
|
592
592
|
.optional()
|
|
593
593
|
.describe("Expiry date (YYYY-MM-DD)"),
|
|
594
594
|
},
|
|
595
|
-
}, async ({ id, name,
|
|
596
|
-
const body = { name
|
|
595
|
+
}, async ({ id, name, allowed_ips, expires_at }) => {
|
|
596
|
+
const body = { name };
|
|
597
597
|
if (allowed_ips)
|
|
598
598
|
body.allowed_ips = allowed_ips;
|
|
599
599
|
if (expires_at)
|