@nirvana-labs/nirvana-mcp 1.35.4 → 1.35.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.
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AAIhF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAwDlC"}
1
+ {"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AAmChF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAuDlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AAIhF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAwDlC"}
1
+ {"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AAmChF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAuDlC"}
package/code-tool.js CHANGED
@@ -4,6 +4,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.codeTool = codeTool;
5
5
  const types_1 = require("./types.js");
6
6
  const server_1 = require("./server.js");
7
+ const prompt = `Runs JavaScript code to interact with the Nirvana Labs API.
8
+
9
+ You are a skilled programmer writing code to interface with the service.
10
+ Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
11
+ For example:
12
+
13
+ \`\`\`
14
+ async function run(client) {
15
+ const operation = await client.compute.vms.create({
16
+ boot_volume: { size: 100, type: 'nvme' },
17
+ cpu_config: { vcpu: 2 },
18
+ memory_config: { size: 2 },
19
+ name: 'my-vm',
20
+ os_image_name: 'ubuntu-noble-2025-10-01',
21
+ public_ip_enabled: true,
22
+ region: 'us-wdc-1',
23
+ ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },
24
+ subnet_id: '123e4567-e89b-12d3-a456-426614174000',
25
+ });
26
+
27
+ console.log(operation.id);
28
+ }
29
+ \`\`\`
30
+
31
+ You will be returned anything that your function returns, plus the results of any console.log statements.
32
+ Do not add try-catch blocks for single API calls. The tool will handle errors for you.
33
+ Do not add comments unless necessary for generating better code.
34
+ Code will run in a container, and cannot interact with the network outside of the given SDK client.
35
+ Variables will not persist between calls, so make sure to return or log any data you might need later.`;
7
36
  /**
8
37
  * A tool that runs code against a copy of the SDK.
9
38
  *
@@ -17,7 +46,7 @@ function codeTool() {
17
46
  const metadata = { resource: 'all', operation: 'write', tags: [] };
18
47
  const tool = {
19
48
  name: 'execute',
20
- description: 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
49
+ description: prompt,
21
50
  inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
22
51
  };
23
52
  const handler = async (_, args) => {
@@ -32,7 +61,7 @@ function codeTool() {
32
61
  ...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
33
62
  'Content-Type': 'application/json',
34
63
  client_envs: JSON.stringify({
35
- NIRVANA_LABS_API_KEY: (0, server_1.readEnv)('NIRVANA_LABS_API_KEY'),
64
+ NIRVANA_LABS_API_KEY: (0, server_1.readEnvOrError)('NIRVANA_LABS_API_KEY'),
36
65
  NIRVANA_LABS_BASE_URL: (0, server_1.readEnv)('NIRVANA_LABS_BASE_URL'),
37
66
  }),
38
67
  },
package/code-tool.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAetF,4BAwDC;AArED,sCAAgG;AAEhG,wCAAmC;AAEnC;;;;;;;;GAQG;AACH,SAAgB,QAAQ;IACtB,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EACT,iiCAAiiC;QACniC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC1E,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,EAAE,CAAU,EAAE,IAAS,EAA2B,EAAE;QACvE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;QAEjC,sFAAsF;QACtF,sFAAsF;QACtF,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,mBAAmB,CAAC,CAAC;QACrD,MAAM,gBAAgB,GACpB,IAAA,gBAAO,EAAC,wBAAwB,CAAC,IAAI,4CAA4C,CAAC;QAEpF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,gBAAgB,EAAE;YACxC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,GAAG,CAAC,eAAe,IAAI,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;gBAC1D,cAAc,EAAE,kBAAkB;gBAClC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC;oBAC1B,oBAAoB,EAAE,IAAA,gB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,CAAC,SAAS,CAAC;gBACnB,YAAY,EAAE,SAAS;gBACvB,IAAI;gBACJ,WAAW,EAAE,EAAE;aACM,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,GAAG,GAAG,CAAC,MAAM,KACX,GAAG,CAAC,UACN,4DAA4D,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAC/E,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAiB,CAAC;QACtF,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG;YACb,MAAM;YACN,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;YAC1C,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;SAC3C,CAAC;QACF,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,IAAA,qBAAa,EAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,IAAA,2BAAmB,EAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
package/code-tool.mjs CHANGED
@@ -1,6 +1,35 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { asErrorResult, asTextContentResult } from "./types.mjs";
3
- import { readEnv } from "./server.mjs";
3
+ import { readEnv, readEnvOrError } from "./server.mjs";
4
+ const prompt = `Runs JavaScript code to interact with the Nirvana Labs API.
5
+
6
+ You are a skilled programmer writing code to interface with the service.
7
+ Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
8
+ For example:
9
+
10
+ \`\`\`
11
+ async function run(client) {
12
+ const operation = await client.compute.vms.create({
13
+ boot_volume: { size: 100, type: 'nvme' },
14
+ cpu_config: { vcpu: 2 },
15
+ memory_config: { size: 2 },
16
+ name: 'my-vm',
17
+ os_image_name: 'ubuntu-noble-2025-10-01',
18
+ public_ip_enabled: true,
19
+ region: 'us-wdc-1',
20
+ ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },
21
+ subnet_id: '123e4567-e89b-12d3-a456-426614174000',
22
+ });
23
+
24
+ console.log(operation.id);
25
+ }
26
+ \`\`\`
27
+
28
+ You will be returned anything that your function returns, plus the results of any console.log statements.
29
+ Do not add try-catch blocks for single API calls. The tool will handle errors for you.
30
+ Do not add comments unless necessary for generating better code.
31
+ Code will run in a container, and cannot interact with the network outside of the given SDK client.
32
+ Variables will not persist between calls, so make sure to return or log any data you might need later.`;
4
33
  /**
5
34
  * A tool that runs code against a copy of the SDK.
6
35
  *
@@ -14,7 +43,7 @@ export function codeTool() {
14
43
  const metadata = { resource: 'all', operation: 'write', tags: [] };
15
44
  const tool = {
16
45
  name: 'execute',
17
- description: 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
46
+ description: prompt,
18
47
  inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
19
48
  };
20
49
  const handler = async (_, args) => {
@@ -29,7 +58,7 @@ export function codeTool() {
29
58
  ...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
30
59
  'Content-Type': 'application/json',
31
60
  client_envs: JSON.stringify({
32
- NIRVANA_LABS_API_KEY: readEnv('NIRVANA_LABS_API_KEY'),
61
+ NIRVANA_LABS_API_KEY: readEnvOrError('NIRVANA_LABS_API_KEY'),
33
62
  NIRVANA_LABS_BASE_URL: readEnv('NIRVANA_LABS_BASE_URL'),
34
63
  }),
35
64
  },
package/code-tool.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAqC,aAAa,EAAE,mBAAmB,EAAE;OAEzE,EAAE,OAAO,EAAE;AAElB;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ;IACtB,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EACT,iiCAAiiC;QACniC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC1E,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,EAAE,CAAU,EAAE,IAAS,EAA2B,EAAE;QACvE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;QAEjC,sFAAsF;QACtF,sFAAsF;QACtF,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAA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IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nirvana-labs/nirvana-mcp",
3
- "version": "1.35.4",
3
+ "version": "1.35.6",
4
4
  "description": "The official MCP Server for the Nirvana Labs API",
5
5
  "author": "Nirvana Labs <engineering@nirvanalabs.io>",
6
6
  "types": "./index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@nirvana-labs/nirvana": "^1.35.4",
21
+ "@nirvana-labs/nirvana": "^1.35.6",
22
22
  "@cloudflare/cabidela": "^0.2.4",
23
23
  "@modelcontextprotocol/sdk": "^1.24.0",
24
24
  "@valtown/deno-http-worker": "^0.0.21",
package/server.js CHANGED
@@ -15,7 +15,7 @@ const code_tool_1 = require("./code-tool.js");
15
15
  const docs_search_tool_1 = __importDefault(require("./docs-search-tool.js"));
16
16
  const newMcpServer = () => new mcp_js_1.McpServer({
17
17
  name: 'nirvana_labs_nirvana_api',
18
- version: '1.35.4',
18
+ version: '1.35.6',
19
19
  }, { capabilities: { tools: {}, logging: {} } });
20
20
  exports.newMcpServer = newMcpServer;
21
21
  // Create server instance
package/server.mjs CHANGED
@@ -6,7 +6,7 @@ import { codeTool } from "./code-tool.mjs";
6
6
  import docsSearchTool from "./docs-search-tool.mjs";
7
7
  export const newMcpServer = () => new McpServer({
8
8
  name: 'nirvana_labs_nirvana_api',
9
- version: '1.35.4',
9
+ version: '1.35.6',
10
10
  }, { capabilities: { tools: {}, logging: {} } });
11
11
  // Create server instance
12
12
  export const server = newMcpServer();
package/src/code-tool.ts CHANGED
@@ -2,8 +2,39 @@
2
2
 
3
3
  import { McpTool, Metadata, ToolCallResult, asErrorResult, asTextContentResult } from './types';
4
4
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
5
- import { readEnv } from './server';
5
+ import { readEnv, readEnvOrError } from './server';
6
6
  import { WorkerInput, WorkerOutput } from './code-tool-types';
7
+
8
+ const prompt = `Runs JavaScript code to interact with the Nirvana Labs API.
9
+
10
+ You are a skilled programmer writing code to interface with the service.
11
+ Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
12
+ For example:
13
+
14
+ \`\`\`
15
+ async function run(client) {
16
+ const operation = await client.compute.vms.create({
17
+ boot_volume: { size: 100, type: 'nvme' },
18
+ cpu_config: { vcpu: 2 },
19
+ memory_config: { size: 2 },
20
+ name: 'my-vm',
21
+ os_image_name: 'ubuntu-noble-2025-10-01',
22
+ public_ip_enabled: true,
23
+ region: 'us-wdc-1',
24
+ ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },
25
+ subnet_id: '123e4567-e89b-12d3-a456-426614174000',
26
+ });
27
+
28
+ console.log(operation.id);
29
+ }
30
+ \`\`\`
31
+
32
+ You will be returned anything that your function returns, plus the results of any console.log statements.
33
+ Do not add try-catch blocks for single API calls. The tool will handle errors for you.
34
+ Do not add comments unless necessary for generating better code.
35
+ Code will run in a container, and cannot interact with the network outside of the given SDK client.
36
+ Variables will not persist between calls, so make sure to return or log any data you might need later.`;
37
+
7
38
  /**
8
39
  * A tool that runs code against a copy of the SDK.
9
40
  *
@@ -17,8 +48,7 @@ export function codeTool(): McpTool {
17
48
  const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] };
18
49
  const tool: Tool = {
19
50
  name: 'execute',
20
- description:
21
- 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
51
+ description: prompt,
22
52
  inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
23
53
  };
24
54
  const handler = async (_: unknown, args: any): Promise<ToolCallResult> => {
@@ -36,7 +66,7 @@ export function codeTool(): McpTool {
36
66
  ...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
37
67
  'Content-Type': 'application/json',
38
68
  client_envs: JSON.stringify({
39
- NIRVANA_LABS_API_KEY: readEnv('NIRVANA_LABS_API_KEY'),
69
+ NIRVANA_LABS_API_KEY: readEnvOrError('NIRVANA_LABS_API_KEY'),
40
70
  NIRVANA_LABS_BASE_URL: readEnv('NIRVANA_LABS_BASE_URL'),
41
71
  }),
42
72
  },
package/src/server.ts CHANGED
@@ -21,7 +21,7 @@ export const newMcpServer = () =>
21
21
  new McpServer(
22
22
  {
23
23
  name: 'nirvana_labs_nirvana_api',
24
- version: '1.35.4',
24
+ version: '1.35.6',
25
25
  },
26
26
  { capabilities: { tools: {}, logging: {} } },
27
27
  );