vme-mcp-server 0.1.12 → 0.1.13
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 +38 -8
- package/dist/README.md +68 -12
- package/dist/server.js +54 -5
- package/package.json +1 -1
package/README.md
CHANGED
@@ -18,18 +18,37 @@ npm install -g vme-mcp-server
|
|
18
18
|
|
19
19
|
### 2. Configure VME API Access
|
20
20
|
|
21
|
+
**Option A: Command Line Arguments (Recommended)**
|
22
|
+
|
23
|
+
```bash
|
24
|
+
vme-mcp-server --endpoint https://your-vme-instance.com/api --token your-bearer-token
|
25
|
+
# Or use short forms:
|
26
|
+
vme-mcp-server -e https://your-vme-instance.com/api -t your-bearer-token
|
27
|
+
```
|
28
|
+
|
29
|
+
**Option B: Environment Variables**
|
30
|
+
|
31
|
+
```bash
|
32
|
+
export VME_ENDPOINT=https://your-vme-instance.com/api
|
33
|
+
export VME_TOKEN=your-bearer-token-here
|
34
|
+
```
|
35
|
+
|
36
|
+
**Option C: Configuration File**
|
37
|
+
|
21
38
|
Create a `.env` file:
|
22
39
|
```env
|
23
|
-
|
24
|
-
|
40
|
+
VME_ENDPOINT=https://your-vme-instance.com/api
|
41
|
+
VME_TOKEN=your-bearer-token-here
|
25
42
|
```
|
26
43
|
|
44
|
+
**Priority Order**: Command line arguments → Environment variables → .env files
|
45
|
+
|
27
46
|
### 3. Add to Claude Code
|
28
47
|
|
29
48
|
**Option A: Using Claude Code CLI (Recommended)**
|
30
49
|
|
31
50
|
```bash
|
32
|
-
claude mcp add vme-server -- vme-mcp-server
|
51
|
+
claude mcp add vme-server -- vme-mcp-server --endpoint https://your-vme-instance.com/api --token your-bearer-token
|
33
52
|
```
|
34
53
|
|
35
54
|
**Option B: Manual Configuration**
|
@@ -40,12 +59,23 @@ Add to your Claude Code configuration file:
|
|
40
59
|
{
|
41
60
|
"mcpServers": {
|
42
61
|
"vme-server": {
|
43
|
-
"command": "
|
44
|
-
"args": ["
|
45
|
-
|
62
|
+
"command": "vme-mcp-server",
|
63
|
+
"args": ["--endpoint", "https://your-vme-instance.com/api", "--token", "your-bearer-token"]
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
```
|
68
|
+
|
69
|
+
**Option C: Using Environment Variables**
|
70
|
+
|
71
|
+
```json
|
72
|
+
{
|
73
|
+
"mcpServers": {
|
74
|
+
"vme-server": {
|
75
|
+
"command": "vme-mcp-server",
|
46
76
|
"env": {
|
47
|
-
"
|
48
|
-
"
|
77
|
+
"VME_ENDPOINT": "https://your-vme-instance.com/api",
|
78
|
+
"VME_TOKEN": "your-bearer-token"
|
49
79
|
}
|
50
80
|
}
|
51
81
|
}
|
package/dist/README.md
CHANGED
@@ -10,20 +10,39 @@ npm install -g vme-mcp-server
|
|
10
10
|
|
11
11
|
## Quick Start
|
12
12
|
|
13
|
-
### 1. Configure
|
13
|
+
### 1. Configure VME API Access
|
14
|
+
|
15
|
+
**Option A: Command Line Arguments (Recommended)**
|
16
|
+
|
17
|
+
```bash
|
18
|
+
vme-mcp-server --endpoint https://your-hpe-vme-instance.com/api --token your-bearer-token
|
19
|
+
# Or use short forms:
|
20
|
+
vme-mcp-server -e https://your-hpe-vme-instance.com/api -t your-bearer-token
|
21
|
+
```
|
22
|
+
|
23
|
+
**Option B: Environment Variables**
|
24
|
+
|
25
|
+
```bash
|
26
|
+
export VME_ENDPOINT=https://your-hpe-vme-instance.com/api
|
27
|
+
export VME_TOKEN=your-bearer-token
|
28
|
+
```
|
29
|
+
|
30
|
+
**Option C: Configuration File**
|
14
31
|
|
15
32
|
Create a `.env` file:
|
16
33
|
|
17
34
|
```bash
|
18
35
|
# HPE VM Essentials Configuration
|
19
|
-
|
20
|
-
|
36
|
+
VME_ENDPOINT=https://your-hpe-vme-instance.com/api
|
37
|
+
VME_TOKEN=your-bearer-token
|
21
38
|
|
22
39
|
# Privacy Controls (Optional)
|
23
40
|
ENABLE_AI_TRAINING_DATA=false
|
24
41
|
AI_TRAINING_DATA_RETENTION_DAYS=30
|
25
42
|
```
|
26
43
|
|
44
|
+
**Priority Order**: Command line arguments → Environment variables → .env files
|
45
|
+
|
27
46
|
### 2. Add to Claude Desktop
|
28
47
|
|
29
48
|
Add to your Claude Desktop configuration file:
|
@@ -31,6 +50,37 @@ Add to your Claude Desktop configuration file:
|
|
31
50
|
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
32
51
|
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
|
33
52
|
|
53
|
+
**Option A: With Command Line Arguments**
|
54
|
+
|
55
|
+
```json
|
56
|
+
{
|
57
|
+
"mcpServers": {
|
58
|
+
"vme": {
|
59
|
+
"command": "vme-mcp-server",
|
60
|
+
"args": ["--endpoint", "https://your-hpe-vme-instance.com/api", "--token", "your-bearer-token"]
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
```
|
65
|
+
|
66
|
+
**Option B: With Environment Variables**
|
67
|
+
|
68
|
+
```json
|
69
|
+
{
|
70
|
+
"mcpServers": {
|
71
|
+
"vme": {
|
72
|
+
"command": "vme-mcp-server",
|
73
|
+
"env": {
|
74
|
+
"VME_ENDPOINT": "https://your-hpe-vme-instance.com/api",
|
75
|
+
"VME_TOKEN": "your-bearer-token"
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
```
|
81
|
+
|
82
|
+
**Option C: Using .env File**
|
83
|
+
|
34
84
|
```json
|
35
85
|
{
|
36
86
|
"mcpServers": {
|
@@ -101,9 +151,15 @@ The server automatically searches for `.env` files in multiple locations:
|
|
101
151
|
|
102
152
|
### Recommended Configuration Methods
|
103
153
|
|
104
|
-
**Method 1:
|
154
|
+
**Method 1: Command Line Arguments (Recommended)**
|
155
|
+
|
156
|
+
```bash
|
157
|
+
vme-mcp-server --endpoint https://your-hpe-vme-instance.com/api --token your-bearer-token
|
158
|
+
```
|
159
|
+
|
160
|
+
**Method 2: Direct Environment Variables**
|
105
161
|
|
106
|
-
Add to your Claude Desktop config
|
162
|
+
Add to your Claude Desktop config:
|
107
163
|
|
108
164
|
```json
|
109
165
|
{
|
@@ -111,15 +167,15 @@ Add to your Claude Desktop config (`~/.config/claude-desktop/config.json`):
|
|
111
167
|
"vme-mcp-server": {
|
112
168
|
"command": "vme-mcp-server",
|
113
169
|
"env": {
|
114
|
-
"
|
115
|
-
"
|
170
|
+
"VME_ENDPOINT": "https://your-hpe-vme-instance.com/api",
|
171
|
+
"VME_TOKEN": "your-bearer-token"
|
116
172
|
}
|
117
173
|
}
|
118
174
|
}
|
119
175
|
}
|
120
176
|
```
|
121
177
|
|
122
|
-
**Method
|
178
|
+
**Method 3: .env File (Good for Local Development)**
|
123
179
|
|
124
180
|
Create `.env` file in any of the supported locations above.
|
125
181
|
|
@@ -127,8 +183,8 @@ Create `.env` file in any of the supported locations above.
|
|
127
183
|
|
128
184
|
| Variable | Description | Example |
|
129
185
|
|----------|-------------|---------|
|
130
|
-
| `
|
131
|
-
| `
|
186
|
+
| `VME_ENDPOINT` | HPE VM Essentials API endpoint | `https://vme.company.com/api` |
|
187
|
+
| `VME_TOKEN` | Bearer token for authentication | `your-bearer-token` |
|
132
188
|
|
133
189
|
### Optional Environment Variables
|
134
190
|
|
@@ -148,8 +204,8 @@ Create `.env` file in any of the supported locations above.
|
|
148
204
|
- Verify MCP configuration syntax in `claude_desktop_config.json`
|
149
205
|
|
150
206
|
**"API connection failed"**
|
151
|
-
- Verify `
|
152
|
-
- Check that `
|
207
|
+
- Verify `VME_ENDPOINT` is correct and accessible
|
208
|
+
- Check that `VME_TOKEN` has sufficient permissions
|
153
209
|
- Ensure network connectivity to HPE VM Essentials infrastructure
|
154
210
|
|
155
211
|
**"VM creation failed"**
|
package/dist/server.js
CHANGED
@@ -8,6 +8,41 @@ import { join } from "path";
|
|
8
8
|
import { homedir } from "os";
|
9
9
|
import { readFileSync } from "fs";
|
10
10
|
import { allTools, toolHandlers } from "./tools/index.js";
|
11
|
+
// Parse command line arguments
|
12
|
+
function parseArgs() {
|
13
|
+
const args = process.argv.slice(2);
|
14
|
+
const result = {};
|
15
|
+
for (let i = 0; i < args.length; i++) {
|
16
|
+
const arg = args[i];
|
17
|
+
if ((arg === '--endpoint' || arg === '-e') && i + 1 < args.length) {
|
18
|
+
result.endpoint = args[i + 1];
|
19
|
+
i++; // Skip next arg since we consumed it
|
20
|
+
}
|
21
|
+
else if ((arg === '--token' || arg === '-t') && i + 1 < args.length) {
|
22
|
+
result.token = args[i + 1];
|
23
|
+
i++; // Skip next arg since we consumed it
|
24
|
+
}
|
25
|
+
else if (arg === '--help' || arg === '-h') {
|
26
|
+
console.log(`VME MCP Server - Natural Language Infrastructure Management
|
27
|
+
|
28
|
+
Usage: vme-mcp-server [options]
|
29
|
+
|
30
|
+
Options:
|
31
|
+
-e, --endpoint <url> VME API endpoint URL
|
32
|
+
-t, --token <token> VME API bearer token
|
33
|
+
-h, --help Show this help message
|
34
|
+
|
35
|
+
Environment Variables:
|
36
|
+
VME_ENDPOINT VME API endpoint URL
|
37
|
+
VME_TOKEN VME API bearer token
|
38
|
+
|
39
|
+
Note: Command line arguments take precedence over environment variables.
|
40
|
+
If no configuration is provided, the server will look for .env files.`);
|
41
|
+
process.exit(0);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return result;
|
45
|
+
}
|
11
46
|
// Get version from package.json
|
12
47
|
function getPackageVersion() {
|
13
48
|
const packagePath = new URL('../package.json', import.meta.url);
|
@@ -15,7 +50,7 @@ function getPackageVersion() {
|
|
15
50
|
return packageJson.version;
|
16
51
|
}
|
17
52
|
// Load environment variables from multiple locations for global install support
|
18
|
-
function loadEnvironmentConfig() {
|
53
|
+
function loadEnvironmentConfig(cliArgs) {
|
19
54
|
// Priority order for .env file locations:
|
20
55
|
const envPaths = [
|
21
56
|
// 1. Current working directory (for local development)
|
@@ -32,13 +67,27 @@ function loadEnvironmentConfig() {
|
|
32
67
|
if (existsSync(envPath)) {
|
33
68
|
dotenv.config({ path: envPath });
|
34
69
|
console.error(`VME MCP: Loaded config from ${envPath}`);
|
35
|
-
|
70
|
+
break;
|
36
71
|
}
|
37
72
|
}
|
38
|
-
//
|
39
|
-
|
73
|
+
// Command line arguments take highest priority - override any env vars
|
74
|
+
if (cliArgs.endpoint) {
|
75
|
+
process.env.VME_ENDPOINT = cliArgs.endpoint;
|
76
|
+
console.error('VME MCP: Using endpoint from command line argument');
|
77
|
+
}
|
78
|
+
if (cliArgs.token) {
|
79
|
+
process.env.VME_TOKEN = cliArgs.token;
|
80
|
+
console.error('VME MCP: Using token from command line argument');
|
81
|
+
}
|
82
|
+
// If no configuration found at all, warn the user
|
83
|
+
if (!process.env.VME_ENDPOINT || !process.env.VME_TOKEN) {
|
84
|
+
console.error('VME MCP: Warning - Missing VME_ENDPOINT or VME_TOKEN configuration');
|
85
|
+
console.error('VME MCP: Use --endpoint and --token arguments or set environment variables');
|
86
|
+
}
|
40
87
|
}
|
41
|
-
|
88
|
+
// Parse CLI arguments and load configuration
|
89
|
+
const cliArgs = parseArgs();
|
90
|
+
loadEnvironmentConfig(cliArgs);
|
42
91
|
// Disable TLS verification for VME API (if needed)
|
43
92
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
44
93
|
// Create VME MCP server with modular architecture
|