nvidia-nim-mcp 1.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/.env.example +23 -0
- package/LICENSE +21 -0
- package/README.md +448 -0
- package/dist/client.d.ts +119 -0
- package/dist/client.js +178 -0
- package/dist/config.d.ts +24 -0
- package/dist/config.js +50 -0
- package/dist/handlers.d.ts +26 -0
- package/dist/handlers.js +255 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +107 -0
- package/dist/logger.d.ts +9 -0
- package/dist/logger.js +49 -0
- package/dist/models.d.ts +14 -0
- package/dist/models.js +202 -0
- package/dist/tools.d.ts +624 -0
- package/dist/tools.js +240 -0
- package/package.json +94 -0
- package/scripts/add-shebang.js +29 -0
- package/scripts/postinstall.js +37 -0
- package/scripts/verify-installation.js +56 -0
package/dist/tools.js
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ─── Shared Schemas ───────────────────────────────────────────────────────────
|
|
3
|
+
export const ChatMessageSchema = z.object({
|
|
4
|
+
role: z.enum(["system", "user", "assistant"]),
|
|
5
|
+
content: z.string(),
|
|
6
|
+
});
|
|
7
|
+
export const ToolFunctionSchema = z.object({
|
|
8
|
+
name: z.string().min(1).max(64),
|
|
9
|
+
description: z.string(),
|
|
10
|
+
parameters: z.record(z.unknown()),
|
|
11
|
+
});
|
|
12
|
+
export const ToolSchema = z.object({
|
|
13
|
+
type: z.literal("function"),
|
|
14
|
+
function: ToolFunctionSchema,
|
|
15
|
+
});
|
|
16
|
+
// ─── Tool Schemas ─────────────────────────────────────────────────────────────
|
|
17
|
+
export const ChatCompletionSchema = z.object({
|
|
18
|
+
model: z.string().optional().describe("NIM model ID. Defaults to configured default."),
|
|
19
|
+
messages: z.array(ChatMessageSchema).min(1).describe("Conversation messages"),
|
|
20
|
+
system_prompt: z.string().optional().describe("System prompt (prepended automatically)"),
|
|
21
|
+
temperature: z.number().min(0).max(2).optional().describe("Sampling temperature (0-2)"),
|
|
22
|
+
top_p: z.number().min(0).max(1).optional().describe("Nucleus sampling parameter"),
|
|
23
|
+
max_tokens: z.number().int().positive().max(131072).optional().describe("Max tokens to generate"),
|
|
24
|
+
stop: z.union([z.string(), z.array(z.string())]).optional().describe("Stop sequences"),
|
|
25
|
+
frequency_penalty: z.number().min(-2).max(2).optional(),
|
|
26
|
+
presence_penalty: z.number().min(-2).max(2).optional(),
|
|
27
|
+
seed: z.number().int().optional().describe("Seed for reproducibility"),
|
|
28
|
+
});
|
|
29
|
+
export const ChatStreamSchema = ChatCompletionSchema;
|
|
30
|
+
export const TextGenerationSchema = z.object({
|
|
31
|
+
model: z.string().optional(),
|
|
32
|
+
prompt: z.string().min(1).describe("The text prompt to complete"),
|
|
33
|
+
system_prompt: z.string().optional().describe("Optional system context"),
|
|
34
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
35
|
+
max_tokens: z.number().int().positive().max(131072).optional(),
|
|
36
|
+
stop: z.union([z.string(), z.array(z.string())]).optional(),
|
|
37
|
+
});
|
|
38
|
+
export const EmbeddingsSchema = z.object({
|
|
39
|
+
model: z.string().optional().describe("Embedding model ID"),
|
|
40
|
+
input: z.union([z.string(), z.array(z.string())]).describe("Text(s) to embed"),
|
|
41
|
+
encoding_format: z.enum(["float", "base64"]).optional().default("float"),
|
|
42
|
+
truncate: z.enum(["NONE", "START", "END"]).optional().default("END"),
|
|
43
|
+
});
|
|
44
|
+
export const RerankSchema = z.object({
|
|
45
|
+
model: z.string().optional().describe("Reranking model ID"),
|
|
46
|
+
query: z.string().min(1).describe("The search query"),
|
|
47
|
+
passages: z
|
|
48
|
+
.array(z.union([z.string(), z.object({ text: z.string() })]))
|
|
49
|
+
.min(1)
|
|
50
|
+
.max(100)
|
|
51
|
+
.describe("Passages to rerank"),
|
|
52
|
+
top_k: z.number().int().positive().optional().describe("Return top K results"),
|
|
53
|
+
truncate: z.enum(["NONE", "END"]).optional().default("END"),
|
|
54
|
+
});
|
|
55
|
+
export const FunctionCallingSchema = z.object({
|
|
56
|
+
model: z.string().optional(),
|
|
57
|
+
messages: z.array(ChatMessageSchema).min(1),
|
|
58
|
+
tools: z.array(ToolSchema).min(1).describe("Available tools/functions"),
|
|
59
|
+
tool_choice: z
|
|
60
|
+
.union([
|
|
61
|
+
z.enum(["auto", "none"]),
|
|
62
|
+
z.object({
|
|
63
|
+
type: z.literal("function"),
|
|
64
|
+
function: z.object({ name: z.string() }),
|
|
65
|
+
}),
|
|
66
|
+
])
|
|
67
|
+
.optional()
|
|
68
|
+
.default("auto"),
|
|
69
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
70
|
+
max_tokens: z.number().int().positive().optional(),
|
|
71
|
+
});
|
|
72
|
+
export const ListModelsSchema = z.object({
|
|
73
|
+
category: z
|
|
74
|
+
.enum(["language", "embedding", "reranking", "vision", "code", "multimodal", "all"])
|
|
75
|
+
.optional()
|
|
76
|
+
.default("all")
|
|
77
|
+
.describe("Filter models by category"),
|
|
78
|
+
});
|
|
79
|
+
export const ModelInfoSchema = z.object({
|
|
80
|
+
model_id: z.string().describe("The model ID to get info about"),
|
|
81
|
+
});
|
|
82
|
+
// ─── Tool Definitions ─────────────────────────────────────────────────────────
|
|
83
|
+
export const TOOL_DEFINITIONS = [
|
|
84
|
+
{
|
|
85
|
+
name: "chat_completion",
|
|
86
|
+
description: "Send a multi-turn conversation to a NVIDIA NIM language model and receive a completion. Supports all major open-source LLMs including Llama 3.1, Mistral, Gemma, Qwen, and more.",
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
model: { type: "string", description: "NIM model ID (optional, uses default if not set)" },
|
|
91
|
+
messages: {
|
|
92
|
+
type: "array",
|
|
93
|
+
items: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
role: { type: "string", enum: ["system", "user", "assistant"] },
|
|
97
|
+
content: { type: "string" },
|
|
98
|
+
},
|
|
99
|
+
required: ["role", "content"],
|
|
100
|
+
},
|
|
101
|
+
minItems: 1,
|
|
102
|
+
},
|
|
103
|
+
system_prompt: { type: "string", description: "System prompt to prepend" },
|
|
104
|
+
temperature: { type: "number", minimum: 0, maximum: 2 },
|
|
105
|
+
top_p: { type: "number", minimum: 0, maximum: 1 },
|
|
106
|
+
max_tokens: { type: "integer", minimum: 1, maximum: 131072 },
|
|
107
|
+
stop: { oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }] },
|
|
108
|
+
seed: { type: "integer" },
|
|
109
|
+
},
|
|
110
|
+
required: ["messages"],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "text_generation",
|
|
115
|
+
description: "Generate text from a single prompt (simplified interface). Ideal for one-shot tasks like summarization, translation, extraction, or Q&A.",
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
model: { type: "string" },
|
|
120
|
+
prompt: { type: "string", description: "Text prompt" },
|
|
121
|
+
system_prompt: { type: "string" },
|
|
122
|
+
temperature: { type: "number", minimum: 0, maximum: 2 },
|
|
123
|
+
max_tokens: { type: "integer", minimum: 1, maximum: 131072 },
|
|
124
|
+
stop: { oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }] },
|
|
125
|
+
},
|
|
126
|
+
required: ["prompt"],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "create_embeddings",
|
|
131
|
+
description: "Convert text(s) into vector embeddings using NVIDIA NIM embedding models. Useful for semantic search, RAG, clustering, and similarity comparisons.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
model: { type: "string", description: "Embedding model ID (e.g. nvidia/nv-embed-v1)" },
|
|
136
|
+
input: {
|
|
137
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
|
|
138
|
+
description: "Text or list of texts to embed",
|
|
139
|
+
},
|
|
140
|
+
encoding_format: { type: "string", enum: ["float", "base64"] },
|
|
141
|
+
truncate: { type: "string", enum: ["NONE", "START", "END"] },
|
|
142
|
+
},
|
|
143
|
+
required: ["input"],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "rerank_passages",
|
|
148
|
+
description: "Rerank a list of passages by relevance to a query using NVIDIA NIM reranking models. Essential for RAG pipelines to improve retrieval quality.",
|
|
149
|
+
inputSchema: {
|
|
150
|
+
type: "object",
|
|
151
|
+
properties: {
|
|
152
|
+
model: { type: "string", description: "Reranking model ID" },
|
|
153
|
+
query: { type: "string", description: "Search query" },
|
|
154
|
+
passages: {
|
|
155
|
+
type: "array",
|
|
156
|
+
items: { oneOf: [{ type: "string" }, { type: "object", properties: { text: { type: "string" } }, required: ["text"] }] },
|
|
157
|
+
minItems: 1,
|
|
158
|
+
maxItems: 100,
|
|
159
|
+
},
|
|
160
|
+
top_k: { type: "integer", minimum: 1, description: "Return top K results" },
|
|
161
|
+
truncate: { type: "string", enum: ["NONE", "END"] },
|
|
162
|
+
},
|
|
163
|
+
required: ["query", "passages"],
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "function_calling",
|
|
168
|
+
description: "Use NIM models with tool/function calling capabilities. The model will decide which function to call and with what arguments.",
|
|
169
|
+
inputSchema: {
|
|
170
|
+
type: "object",
|
|
171
|
+
properties: {
|
|
172
|
+
model: { type: "string" },
|
|
173
|
+
messages: {
|
|
174
|
+
type: "array",
|
|
175
|
+
items: {
|
|
176
|
+
type: "object",
|
|
177
|
+
properties: {
|
|
178
|
+
role: { type: "string", enum: ["system", "user", "assistant"] },
|
|
179
|
+
content: { type: "string" },
|
|
180
|
+
},
|
|
181
|
+
required: ["role", "content"],
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
tools: {
|
|
185
|
+
type: "array",
|
|
186
|
+
items: {
|
|
187
|
+
type: "object",
|
|
188
|
+
properties: {
|
|
189
|
+
type: { type: "string", enum: ["function"] },
|
|
190
|
+
function: {
|
|
191
|
+
type: "object",
|
|
192
|
+
properties: {
|
|
193
|
+
name: { type: "string" },
|
|
194
|
+
description: { type: "string" },
|
|
195
|
+
parameters: { type: "object" },
|
|
196
|
+
},
|
|
197
|
+
required: ["name", "description", "parameters"],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
required: ["type", "function"],
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
tool_choice: {
|
|
204
|
+
oneOf: [
|
|
205
|
+
{ type: "string", enum: ["auto", "none"] },
|
|
206
|
+
{ type: "object", properties: { type: { type: "string" }, function: { type: "object" } } },
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
temperature: { type: "number" },
|
|
210
|
+
max_tokens: { type: "integer" },
|
|
211
|
+
},
|
|
212
|
+
required: ["messages", "tools"],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "list_models",
|
|
217
|
+
description: "List available NVIDIA NIM models, optionally filtered by category (language, embedding, reranking, vision, code).",
|
|
218
|
+
inputSchema: {
|
|
219
|
+
type: "object",
|
|
220
|
+
properties: {
|
|
221
|
+
category: {
|
|
222
|
+
type: "string",
|
|
223
|
+
enum: ["language", "embedding", "reranking", "vision", "code", "multimodal", "all"],
|
|
224
|
+
description: "Filter by model category",
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "get_model_info",
|
|
231
|
+
description: "Get detailed information about a specific NVIDIA NIM model.",
|
|
232
|
+
inputSchema: {
|
|
233
|
+
type: "object",
|
|
234
|
+
properties: {
|
|
235
|
+
model_id: { type: "string", description: "The model ID" },
|
|
236
|
+
},
|
|
237
|
+
required: ["model_id"],
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nvidia-nim-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Production-ready MCP server for NVIDIA NIM models with GLM-5 specialization for software development and architecture",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"nvidia-nim-mcp": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"scripts",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE",
|
|
16
|
+
".env.example"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc src/index.ts --outDir dist --module NodeNext --moduleResolution NodeNext --target ES2022 --declaration --skipLibCheck && node scripts/add-shebang.js",
|
|
20
|
+
"start": "node dist/index.js",
|
|
21
|
+
"dev": "tsx src/index.ts",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"prebuild": "npm run clean",
|
|
24
|
+
"lint": "eslint src/**/*.ts",
|
|
25
|
+
"test": "jest",
|
|
26
|
+
"check": "npm run lint && npm test",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
28
|
+
"pack": "npm run build && npm pack",
|
|
29
|
+
"verify": "node scripts/verify-installation.js",
|
|
30
|
+
"postinstall": "node scripts/postinstall.js"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"mcp",
|
|
34
|
+
"model-context-protocol",
|
|
35
|
+
"nvidia",
|
|
36
|
+
"nim",
|
|
37
|
+
"glm5",
|
|
38
|
+
"ai",
|
|
39
|
+
"llm",
|
|
40
|
+
"chat",
|
|
41
|
+
"embeddings",
|
|
42
|
+
"reranking",
|
|
43
|
+
"function-calling",
|
|
44
|
+
"code-generation",
|
|
45
|
+
"software-development"
|
|
46
|
+
],
|
|
47
|
+
"author": "David Gonzalez <david.eve.za@gmail.com>",
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": ""
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": ""
|
|
55
|
+
},
|
|
56
|
+
"homepage": "",
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=18.0.0"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
62
|
+
"axios": "^1.7.7",
|
|
63
|
+
"axios-retry": "^4.5.0",
|
|
64
|
+
"dotenv": "^16.4.5",
|
|
65
|
+
"winston": "^3.14.2",
|
|
66
|
+
"zod": "^3.23.8"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@babel/core": "^7.29.0",
|
|
70
|
+
"@babel/preset-env": "^7.29.0",
|
|
71
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
72
|
+
"@eslint/js": "^10.0.1",
|
|
73
|
+
"@types/jest": "^30.0.0",
|
|
74
|
+
"@types/node": "^22.0.0",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
76
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
77
|
+
"babel-jest": "^30.2.0",
|
|
78
|
+
"eslint": "^10.0.2",
|
|
79
|
+
"jest": "^30.2.0",
|
|
80
|
+
"ts-jest": "^29.4.6",
|
|
81
|
+
"tsx": "^4.19.1",
|
|
82
|
+
"typescript": "^5.6.2",
|
|
83
|
+
"typescript-eslint": "^8.56.1"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
87
|
+
},
|
|
88
|
+
"exports": {
|
|
89
|
+
".": {
|
|
90
|
+
"import": "./dist/index.js",
|
|
91
|
+
"types": "./dist/index.d.ts"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, existsSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
|
|
4
|
+
// Add shebang to the compiled index.js file
|
|
5
|
+
const indexPath = join(process.cwd(), 'dist', 'index.js');
|
|
6
|
+
|
|
7
|
+
// Wait for file to exist (up to 5 seconds)
|
|
8
|
+
let attempts = 0;
|
|
9
|
+
const maxAttempts = 50; // 5 seconds with 100ms intervals
|
|
10
|
+
|
|
11
|
+
function waitForFile() {
|
|
12
|
+
if (existsSync(indexPath)) {
|
|
13
|
+
const content = readFileSync(indexPath, 'utf8');
|
|
14
|
+
if (!content.startsWith('#!/usr/bin/env node')) {
|
|
15
|
+
writeFileSync(indexPath, '#!/usr/bin/env node\n' + content);
|
|
16
|
+
console.log('Shebang added to dist/index.js');
|
|
17
|
+
} else {
|
|
18
|
+
console.log('Shebang already present in dist/index.js');
|
|
19
|
+
}
|
|
20
|
+
} else if (attempts < maxAttempts) {
|
|
21
|
+
attempts++;
|
|
22
|
+
setTimeout(waitForFile, 100);
|
|
23
|
+
} else {
|
|
24
|
+
console.error('dist/index.js not found after waiting');
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
waitForFile();
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-installation script for NVIDIA NIM MCP Server
|
|
5
|
+
*
|
|
6
|
+
* This script runs after the package is installed and provides
|
|
7
|
+
* helpful information to the user.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
console.log(`
|
|
11
|
+
🎉 Thank you for installing NVIDIA NIM MCP Server!
|
|
12
|
+
|
|
13
|
+
🚀 Quick Start:
|
|
14
|
+
npx nvidia-nim-mcp
|
|
15
|
+
|
|
16
|
+
🔐 Configuration:
|
|
17
|
+
1. Set your NVIDIA API key: NVIDIA_API_KEY=nvapi-your-key
|
|
18
|
+
2. See .env.example for all configuration options
|
|
19
|
+
|
|
20
|
+
📚 Documentation:
|
|
21
|
+
- README.md for detailed usage instructions
|
|
22
|
+
- Visit https://build.nvidia.com for API key registration
|
|
23
|
+
|
|
24
|
+
⚡ Next Steps:
|
|
25
|
+
npx nvidia-nim-mcp --help
|
|
26
|
+
|
|
27
|
+
💡 Having trouble? Run:
|
|
28
|
+
npm run verify
|
|
29
|
+
`);
|
|
30
|
+
|
|
31
|
+
// Only show advanced tips if this is a global installation
|
|
32
|
+
if (process.env.npm_config_global === 'true') {
|
|
33
|
+
console.log(`🔧 Global Installation Detected:
|
|
34
|
+
You can now run 'nvidia-nim-mcp' from anywhere!
|
|
35
|
+
For configuration, create a .env file in your working directory.
|
|
36
|
+
`);
|
|
37
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Installation verification script for NVIDIA NIM MCP Server
|
|
5
|
+
*
|
|
6
|
+
* This script checks if the environment is properly set up to run the server.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { existsSync } from 'fs';
|
|
10
|
+
import { join } from 'path';
|
|
11
|
+
|
|
12
|
+
console.log('🔍 Verifying NVIDIA NIM MCP Server installation...\n');
|
|
13
|
+
|
|
14
|
+
// Check Node.js version
|
|
15
|
+
const nodeVersion = process.version;
|
|
16
|
+
const nodeMajorVersion = parseInt(nodeVersion.split('.')[0].replace('v', ''));
|
|
17
|
+
console.log(`✅ Node.js version: ${nodeVersion}`);
|
|
18
|
+
|
|
19
|
+
if (nodeMajorVersion < 18) {
|
|
20
|
+
console.log('⚠️ Warning: Node.js 18+ is recommended for optimal performance');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Check if we're running from source or installed package
|
|
24
|
+
const isSource = existsSync(join(process.cwd(), 'src'));
|
|
25
|
+
const isInstalled = existsSync(join(process.cwd(), 'dist')) || existsSync(join(process.cwd(), 'node_modules'));
|
|
26
|
+
|
|
27
|
+
if (isSource) {
|
|
28
|
+
console.log('📁 Running from source directory');
|
|
29
|
+
console.log('📋 To build the project, run: npm run build');
|
|
30
|
+
} else if (isInstalled) {
|
|
31
|
+
console.log('📦 Running from installed package');
|
|
32
|
+
} else {
|
|
33
|
+
console.log('❓ Unknown installation type');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Check required environment variables (don't actually validate values)
|
|
37
|
+
const requiredEnvVars = ['NVIDIA_API_KEY'];
|
|
38
|
+
const missingEnvVars = requiredEnvVars.filter(envVar => !process.env[envVar]);
|
|
39
|
+
|
|
40
|
+
if (missingEnvVars.length > 0) {
|
|
41
|
+
console.log('\n⚠️ Warning: Missing required environment variables:');
|
|
42
|
+
missingEnvVars.forEach(envVar => console.log(` - ${envVar}`));
|
|
43
|
+
console.log('\n📝 Please set these variables before running the server.');
|
|
44
|
+
console.log(' Example: NVIDIA_API_KEY=nvapi-your-key-here nvidia-nim-mcp');
|
|
45
|
+
} else {
|
|
46
|
+
console.log('\n✅ All required environment variables are set');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
console.log('\n✨ Installation verification complete!');
|
|
50
|
+
console.log('\n🚀 To start the server, run one of:');
|
|
51
|
+
console.log(' nvidia-nim-mcp');
|
|
52
|
+
console.log(' npm start');
|
|
53
|
+
console.log(' node dist/index.js');
|
|
54
|
+
console.log(' docker run nvidia-nim-mcp');
|
|
55
|
+
|
|
56
|
+
console.log('\n📖 For detailed configuration, see .env.example file');
|