@nirvana-labs/nirvana-mcp 1.26.1 → 1.26.3
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/code-tool.d.mts +44 -2
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +44 -2
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +23 -153
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +23 -117
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +3 -0
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +3 -0
- package/docs-search-tool.mjs.map +1 -1
- package/package.json +2 -18
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/code-tool.ts +33 -148
- package/src/docs-search-tool.ts +7 -0
- package/src/server.ts +1 -1
- package/code-tool-paths.cjs +0 -6
- package/code-tool-paths.cjs.map +0 -1
- package/code-tool-paths.d.cts +0 -2
- package/code-tool-paths.d.cts.map +0 -1
- package/code-tool-worker.d.mts +0 -5
- package/code-tool-worker.d.mts.map +0 -1
- package/code-tool-worker.d.ts +0 -5
- package/code-tool-worker.d.ts.map +0 -1
- package/code-tool-worker.js +0 -329
- package/code-tool-worker.js.map +0 -1
- package/code-tool-worker.mjs +0 -324
- package/code-tool-worker.mjs.map +0 -1
- package/src/code-tool-paths.cts +0 -3
- package/src/code-tool-worker.ts +0 -377
package/code-tool.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Metadata, ToolCallResult } from "./tools/types.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* A tool that runs code against a copy of the SDK.
|
|
4
4
|
*
|
|
@@ -8,5 +8,47 @@ import { Endpoint } from "./tools/types.mjs";
|
|
|
8
8
|
*
|
|
9
9
|
* @param endpoints - The endpoints to include in the list.
|
|
10
10
|
*/
|
|
11
|
-
export declare function codeTool(): Promise<
|
|
11
|
+
export declare function codeTool(): Promise<{
|
|
12
|
+
metadata: Metadata;
|
|
13
|
+
tool: {
|
|
14
|
+
inputSchema: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
type: "object";
|
|
17
|
+
properties?: {
|
|
18
|
+
[x: string]: object;
|
|
19
|
+
} | undefined;
|
|
20
|
+
required?: string[] | undefined;
|
|
21
|
+
};
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
outputSchema?: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
type: "object";
|
|
27
|
+
properties?: {
|
|
28
|
+
[x: string]: object;
|
|
29
|
+
} | undefined;
|
|
30
|
+
required?: string[] | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
annotations?: {
|
|
33
|
+
title?: string | undefined;
|
|
34
|
+
readOnlyHint?: boolean | undefined;
|
|
35
|
+
destructiveHint?: boolean | undefined;
|
|
36
|
+
idempotentHint?: boolean | undefined;
|
|
37
|
+
openWorldHint?: boolean | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
execution?: {
|
|
40
|
+
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
_meta?: {
|
|
43
|
+
[x: string]: unknown;
|
|
44
|
+
} | undefined;
|
|
45
|
+
icons?: {
|
|
46
|
+
src: string;
|
|
47
|
+
mimeType?: string | undefined;
|
|
48
|
+
sizes?: string[] | undefined;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
title?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
handler: (_: unknown, args: any) => Promise<ToolCallResult>;
|
|
53
|
+
}>;
|
|
12
54
|
//# sourceMappingURL=code-tool.d.mts.map
|
package/code-tool.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,cAAc,EAAuB;AAIxD;;;;;;;;GAQG;AACH,wBAAsB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQF,OAAO,QAAQ,GAAG,KAAG,OAAO,CAAC,cAAc,CAAC;GAmCvE"}
|
package/code-tool.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Metadata, ToolCallResult } from "./tools/types.js";
|
|
2
2
|
/**
|
|
3
3
|
* A tool that runs code against a copy of the SDK.
|
|
4
4
|
*
|
|
@@ -8,5 +8,47 @@ import { Endpoint } from "./tools/types.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @param endpoints - The endpoints to include in the list.
|
|
10
10
|
*/
|
|
11
|
-
export declare function codeTool(): Promise<
|
|
11
|
+
export declare function codeTool(): Promise<{
|
|
12
|
+
metadata: Metadata;
|
|
13
|
+
tool: {
|
|
14
|
+
inputSchema: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
type: "object";
|
|
17
|
+
properties?: {
|
|
18
|
+
[x: string]: object;
|
|
19
|
+
} | undefined;
|
|
20
|
+
required?: string[] | undefined;
|
|
21
|
+
};
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
outputSchema?: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
type: "object";
|
|
27
|
+
properties?: {
|
|
28
|
+
[x: string]: object;
|
|
29
|
+
} | undefined;
|
|
30
|
+
required?: string[] | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
annotations?: {
|
|
33
|
+
title?: string | undefined;
|
|
34
|
+
readOnlyHint?: boolean | undefined;
|
|
35
|
+
destructiveHint?: boolean | undefined;
|
|
36
|
+
idempotentHint?: boolean | undefined;
|
|
37
|
+
openWorldHint?: boolean | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
execution?: {
|
|
40
|
+
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
_meta?: {
|
|
43
|
+
[x: string]: unknown;
|
|
44
|
+
} | undefined;
|
|
45
|
+
icons?: {
|
|
46
|
+
src: string;
|
|
47
|
+
mimeType?: string | undefined;
|
|
48
|
+
sizes?: string[] | undefined;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
title?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
handler: (_: unknown, args: any) => Promise<ToolCallResult>;
|
|
53
|
+
}>;
|
|
12
54
|
//# sourceMappingURL=code-tool.d.ts.map
|
package/code-tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,cAAc,EAAuB;AAIxD;;;;;;;;GAQG;AACH,wBAAsB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQF,OAAO,QAAQ,GAAG,KAAG,OAAO,CAAC,cAAc,CAAC;GAmCvE"}
|
package/code-tool.js
CHANGED
|
@@ -1,45 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
4
|
exports.codeTool = codeTool;
|
|
41
|
-
const
|
|
42
|
-
const
|
|
5
|
+
const types_1 = require("./tools/types.js");
|
|
6
|
+
const server_1 = require("./server.js");
|
|
43
7
|
/**
|
|
44
8
|
* A tool that runs code against a copy of the SDK.
|
|
45
9
|
*
|
|
@@ -53,126 +17,32 @@ async function codeTool() {
|
|
|
53
17
|
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
54
18
|
const tool = {
|
|
55
19
|
name: 'execute',
|
|
56
|
-
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
|
|
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.',
|
|
57
21
|
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
58
22
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
'
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
runFlags: [
|
|
72
|
-
`--node-modules-dir=manual`,
|
|
73
|
-
`--allow-read=${allowRead}`,
|
|
74
|
-
`--allow-net=${baseURLHostname}`,
|
|
75
|
-
// Allow environment variables because instantiating the client will try to read from them,
|
|
76
|
-
// even though they are not set.
|
|
77
|
-
'--allow-env',
|
|
78
|
-
],
|
|
79
|
-
printOutput: true,
|
|
80
|
-
spawnOptions: {
|
|
81
|
-
cwd: node_path_1.default.dirname(workerPath),
|
|
23
|
+
const handler = async (_, args) => {
|
|
24
|
+
const code = args.code;
|
|
25
|
+
// this is not required, but passing a Stainless API key for the matching project_name
|
|
26
|
+
// will allow you to run code-mode queries against non-published versions of your SDK.
|
|
27
|
+
const stainlessAPIKey = (0, server_1.readEnv)('STAINLESS_API_KEY');
|
|
28
|
+
const codeModeEndpoint = (0, server_1.readEnv)('CODE_MODE_ENDPOINT_URL') ?? 'https://api.stainless.com/api/ai/code-tool';
|
|
29
|
+
const res = await fetch(codeModeEndpoint, {
|
|
30
|
+
method: 'POST',
|
|
31
|
+
headers: {
|
|
32
|
+
...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
client_envs: JSON.stringify({ NIRVANA_LABS_API_KEY: (0, server_1.readEnv)('NIRVANA_LABS_API_KEY') }),
|
|
82
35
|
},
|
|
36
|
+
body: JSON.stringify({
|
|
37
|
+
project_name: 'nirvana',
|
|
38
|
+
client_opts: {},
|
|
39
|
+
code,
|
|
40
|
+
}),
|
|
83
41
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
worker.addEventListener('exit', (exitCode) => {
|
|
87
|
-
reject(new Error(`Worker exited with code ${exitCode}`));
|
|
88
|
-
});
|
|
89
|
-
const opts = {
|
|
90
|
-
baseURL: client.baseURL,
|
|
91
|
-
apiKey: client.apiKey,
|
|
92
|
-
defaultHeaders: {
|
|
93
|
-
'X-Stainless-MCP': 'true',
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
const req = worker.request('http://localhost', {
|
|
97
|
-
headers: {
|
|
98
|
-
'content-type': 'application/json',
|
|
99
|
-
},
|
|
100
|
-
method: 'POST',
|
|
101
|
-
}, (resp) => {
|
|
102
|
-
const body = [];
|
|
103
|
-
resp.on('error', (err) => {
|
|
104
|
-
reject(err);
|
|
105
|
-
});
|
|
106
|
-
resp.on('data', (chunk) => {
|
|
107
|
-
body.push(chunk);
|
|
108
|
-
});
|
|
109
|
-
resp.on('end', () => {
|
|
110
|
-
resolve(new Response(Buffer.concat(body).toString(), {
|
|
111
|
-
status: resp.statusCode ?? 200,
|
|
112
|
-
headers: resp.headers,
|
|
113
|
-
}));
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
const body = JSON.stringify({
|
|
117
|
-
opts,
|
|
118
|
-
code,
|
|
119
|
-
});
|
|
120
|
-
req.write(body, (err) => {
|
|
121
|
-
if (err != null) {
|
|
122
|
-
reject(err);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
req.end();
|
|
126
|
-
});
|
|
127
|
-
if (resp.status === 200) {
|
|
128
|
-
const { result, logLines, errLines } = (await resp.json());
|
|
129
|
-
const returnOutput = result == null ? null : ({
|
|
130
|
-
type: 'text',
|
|
131
|
-
text: typeof result === 'string' ? result : JSON.stringify(result),
|
|
132
|
-
});
|
|
133
|
-
const logOutput = logLines.length === 0 ?
|
|
134
|
-
null
|
|
135
|
-
: {
|
|
136
|
-
type: 'text',
|
|
137
|
-
text: logLines.join('\n'),
|
|
138
|
-
};
|
|
139
|
-
const errOutput = errLines.length === 0 ?
|
|
140
|
-
null
|
|
141
|
-
: {
|
|
142
|
-
type: 'text',
|
|
143
|
-
text: 'Error output:\n' + errLines.join('\n'),
|
|
144
|
-
};
|
|
145
|
-
return {
|
|
146
|
-
content: [returnOutput, logOutput, errOutput].filter((block) => block !== null),
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
const { message, logLines, errLines } = (await resp.json());
|
|
151
|
-
const messageOutput = message == null ? null : ({
|
|
152
|
-
type: 'text',
|
|
153
|
-
text: message,
|
|
154
|
-
});
|
|
155
|
-
const logOutput = logLines.length === 0 ?
|
|
156
|
-
null
|
|
157
|
-
: {
|
|
158
|
-
type: 'text',
|
|
159
|
-
text: logLines.join('\n'),
|
|
160
|
-
};
|
|
161
|
-
const errOutput = errLines.length === 0 ?
|
|
162
|
-
null
|
|
163
|
-
: {
|
|
164
|
-
type: 'text',
|
|
165
|
-
text: 'Error output:\n' + errLines.join('\n'),
|
|
166
|
-
};
|
|
167
|
-
return {
|
|
168
|
-
content: [messageOutput, logOutput, errOutput].filter((block) => block !== null),
|
|
169
|
-
isError: true,
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
finally {
|
|
174
|
-
worker.terminate();
|
|
42
|
+
if (!res.ok) {
|
|
43
|
+
throw new Error(`${res.status}: ${res.statusText} error when trying to contact Code Tool server. Details: ${await res.text()}`);
|
|
175
44
|
}
|
|
45
|
+
return (0, types_1.asTextContentResult)((await res.json()));
|
|
176
46
|
};
|
|
177
47
|
return { metadata, tool, handler };
|
|
178
48
|
}
|
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
|
|
1
|
+
{"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAetF,4BA2CC;AAxDD,4CAA8E;AAE9E,wCAAmC;AAEnC;;;;;;;;GAQG;AACI,KAAK,UAAU,QAAQ;IAC5B,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,EAAE,oBAAoB,EAAE,IAAA,gBAAO,EAAC,sBAAsB,CAAC,EAAE,CAAC;aACvF;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,YAAY,EAAE,SAAS;gBACvB,WAAW,EAAE,EAAE;gBACf,IAAI;aACL,CAAC;SACH,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,OAAO,IAAA,2BAAmB,EAAC,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAkB,CAAC,CAAC;IAClE,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
package/code-tool.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { asTextContentResult } from "./tools/types.mjs";
|
|
3
|
+
import { readEnv } from "./server.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* A tool that runs code against a copy of the SDK.
|
|
6
6
|
*
|
|
@@ -14,126 +14,32 @@ export async function codeTool() {
|
|
|
14
14
|
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
15
15
|
const tool = {
|
|
16
16
|
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
|
|
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.',
|
|
18
18
|
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
'
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
runFlags: [
|
|
33
|
-
`--node-modules-dir=manual`,
|
|
34
|
-
`--allow-read=${allowRead}`,
|
|
35
|
-
`--allow-net=${baseURLHostname}`,
|
|
36
|
-
// Allow environment variables because instantiating the client will try to read from them,
|
|
37
|
-
// even though they are not set.
|
|
38
|
-
'--allow-env',
|
|
39
|
-
],
|
|
40
|
-
printOutput: true,
|
|
41
|
-
spawnOptions: {
|
|
42
|
-
cwd: path.dirname(workerPath),
|
|
20
|
+
const handler = async (_, args) => {
|
|
21
|
+
const code = args.code;
|
|
22
|
+
// this is not required, but passing a Stainless API key for the matching project_name
|
|
23
|
+
// will allow you to run code-mode queries against non-published versions of your SDK.
|
|
24
|
+
const stainlessAPIKey = readEnv('STAINLESS_API_KEY');
|
|
25
|
+
const codeModeEndpoint = readEnv('CODE_MODE_ENDPOINT_URL') ?? 'https://api.stainless.com/api/ai/code-tool';
|
|
26
|
+
const res = await fetch(codeModeEndpoint, {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
headers: {
|
|
29
|
+
...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
|
|
30
|
+
'Content-Type': 'application/json',
|
|
31
|
+
client_envs: JSON.stringify({ NIRVANA_LABS_API_KEY: readEnv('NIRVANA_LABS_API_KEY') }),
|
|
43
32
|
},
|
|
33
|
+
body: JSON.stringify({
|
|
34
|
+
project_name: 'nirvana',
|
|
35
|
+
client_opts: {},
|
|
36
|
+
code,
|
|
37
|
+
}),
|
|
44
38
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
worker.addEventListener('exit', (exitCode) => {
|
|
48
|
-
reject(new Error(`Worker exited with code ${exitCode}`));
|
|
49
|
-
});
|
|
50
|
-
const opts = {
|
|
51
|
-
baseURL: client.baseURL,
|
|
52
|
-
apiKey: client.apiKey,
|
|
53
|
-
defaultHeaders: {
|
|
54
|
-
'X-Stainless-MCP': 'true',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
const req = worker.request('http://localhost', {
|
|
58
|
-
headers: {
|
|
59
|
-
'content-type': 'application/json',
|
|
60
|
-
},
|
|
61
|
-
method: 'POST',
|
|
62
|
-
}, (resp) => {
|
|
63
|
-
const body = [];
|
|
64
|
-
resp.on('error', (err) => {
|
|
65
|
-
reject(err);
|
|
66
|
-
});
|
|
67
|
-
resp.on('data', (chunk) => {
|
|
68
|
-
body.push(chunk);
|
|
69
|
-
});
|
|
70
|
-
resp.on('end', () => {
|
|
71
|
-
resolve(new Response(Buffer.concat(body).toString(), {
|
|
72
|
-
status: resp.statusCode ?? 200,
|
|
73
|
-
headers: resp.headers,
|
|
74
|
-
}));
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
const body = JSON.stringify({
|
|
78
|
-
opts,
|
|
79
|
-
code,
|
|
80
|
-
});
|
|
81
|
-
req.write(body, (err) => {
|
|
82
|
-
if (err != null) {
|
|
83
|
-
reject(err);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
req.end();
|
|
87
|
-
});
|
|
88
|
-
if (resp.status === 200) {
|
|
89
|
-
const { result, logLines, errLines } = (await resp.json());
|
|
90
|
-
const returnOutput = result == null ? null : ({
|
|
91
|
-
type: 'text',
|
|
92
|
-
text: typeof result === 'string' ? result : JSON.stringify(result),
|
|
93
|
-
});
|
|
94
|
-
const logOutput = logLines.length === 0 ?
|
|
95
|
-
null
|
|
96
|
-
: {
|
|
97
|
-
type: 'text',
|
|
98
|
-
text: logLines.join('\n'),
|
|
99
|
-
};
|
|
100
|
-
const errOutput = errLines.length === 0 ?
|
|
101
|
-
null
|
|
102
|
-
: {
|
|
103
|
-
type: 'text',
|
|
104
|
-
text: 'Error output:\n' + errLines.join('\n'),
|
|
105
|
-
};
|
|
106
|
-
return {
|
|
107
|
-
content: [returnOutput, logOutput, errOutput].filter((block) => block !== null),
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
const { message, logLines, errLines } = (await resp.json());
|
|
112
|
-
const messageOutput = message == null ? null : ({
|
|
113
|
-
type: 'text',
|
|
114
|
-
text: message,
|
|
115
|
-
});
|
|
116
|
-
const logOutput = logLines.length === 0 ?
|
|
117
|
-
null
|
|
118
|
-
: {
|
|
119
|
-
type: 'text',
|
|
120
|
-
text: logLines.join('\n'),
|
|
121
|
-
};
|
|
122
|
-
const errOutput = errLines.length === 0 ?
|
|
123
|
-
null
|
|
124
|
-
: {
|
|
125
|
-
type: 'text',
|
|
126
|
-
text: 'Error output:\n' + errLines.join('\n'),
|
|
127
|
-
};
|
|
128
|
-
return {
|
|
129
|
-
content: [messageOutput, logOutput, errOutput].filter((block) => block !== null),
|
|
130
|
-
isError: true,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
finally {
|
|
135
|
-
worker.terminate();
|
|
39
|
+
if (!res.ok) {
|
|
40
|
+
throw new Error(`${res.status}: ${res.statusText} error when trying to contact Code Tool server. Details: ${await res.text()}`);
|
|
136
41
|
}
|
|
42
|
+
return asTextContentResult((await res.json()));
|
|
137
43
|
};
|
|
138
44
|
return { metadata, tool, handler };
|
|
139
45
|
}
|
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,
|
|
1
|
+
{"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAA4B,mBAAmB,EAAE;OAEjD,EAAE,OAAO,EAAE;AAElB;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,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,CAAC,CAAC;QACrD,MAAM,gBAAgB,GACpB,OAAO,CAAC,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,EAAE,oBAAoB,EAAE,OAAO,CAAC,sBAAsB,CAAC,EAAE,CAAC;aACvF;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,YAAY,EAAE,SAAS;gBACvB,WAAW,EAAE,EAAE;gBACf,IAAI;aACL,CAAC;SACH,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,OAAO,mBAAmB,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAkB,CAAC,CAAC;IAClE,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-search-tool.d.mts","sourceRoot":"","sources":["src/docs-search-tool.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB;OAEjC,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,eAAO,MAAM,QAAQ,EAAE,QAKtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA0BlB,CAAC;AAKF,eAAO,MAAM,OAAO,GAAU,GAAG,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"docs-search-tool.d.mts","sourceRoot":"","sources":["src/docs-search-tool.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB;OAEjC,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,eAAO,MAAM,QAAQ,EAAE,QAKtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA0BlB,CAAC;AAKF,eAAO,MAAM,OAAO,GAAU,GAAG,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,oDAYlF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAZ+B,OAAO,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAcnF,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-search-tool.d.ts","sourceRoot":"","sources":["src/docs-search-tool.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB;OAEjC,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,eAAO,MAAM,QAAQ,EAAE,QAKtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA0BlB,CAAC;AAKF,eAAO,MAAM,OAAO,GAAU,GAAG,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"docs-search-tool.d.ts","sourceRoot":"","sources":["src/docs-search-tool.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB;OAEjC,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,eAAO,MAAM,QAAQ,EAAE,QAKtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA0BlB,CAAC;AAKF,eAAO,MAAM,OAAO,GAAU,GAAG,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,oDAYlF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAZ+B,OAAO,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAcnF,wBAA2C"}
|
package/docs-search-tool.js
CHANGED
|
@@ -41,6 +41,9 @@ const handler = async (_, args) => {
|
|
|
41
41
|
const body = args;
|
|
42
42
|
const query = new URLSearchParams(body).toString();
|
|
43
43
|
const result = await fetch(`${docsSearchURL}?${query}`);
|
|
44
|
+
if (!result.ok) {
|
|
45
|
+
throw new Error(`${result.status}: ${result.statusText} when using doc search tool. Details: ${await result.text()}`);
|
|
46
|
+
}
|
|
44
47
|
return (0, types_1.asTextContentResult)(await result.json());
|
|
45
48
|
};
|
|
46
49
|
exports.handler = handler;
|
package/docs-search-tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-search-tool.js","sourceRoot":"","sources":["src/docs-search-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4CAA8D;AAIjD,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,KAAK;CAClB,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,8EAA8E;IAC3F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yCAAyC;gBACtD,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;aAClG;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;gBAC9C,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;aAC7B;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;KAChC;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEF,MAAM,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,4DAA4D,CAAC;AAE1F,MAAM,OAAO,GAAG,KAAK,EAAE,CAAU,EAAE,IAAyC,EAAE,EAAE;IACrF,MAAM,IAAI,G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EAAE,EAAE;IACrF,MAAM,IAAI,GAAG,IAAW,CAAC;IACzB,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,aAAa,IAAI,KAAK,EAAE,CAAC,CAAC;IAExD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,UAAU,yCAAyC,MAAM,MAAM,CAAC,IAAI,EAAE,EAAE,CACrG,CAAC;IACJ,CAAC;IAED,OAAO,IAAA,2BAAmB,EAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC;AAZW,QAAA,OAAO,WAYlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
package/docs-search-tool.mjs
CHANGED
|
@@ -38,6 +38,9 @@ export const handler = async (_, args) => {
|
|
|
38
38
|
const body = args;
|
|
39
39
|
const query = new URLSearchParams(body).toString();
|
|
40
40
|
const result = await fetch(`${docsSearchURL}?${query}`);
|
|
41
|
+
if (!result.ok) {
|
|
42
|
+
throw new Error(`${result.status}: ${result.statusText} when using doc search tool. Details: ${await result.text()}`);
|
|
43
|
+
}
|
|
41
44
|
return asTextContentResult(await result.json());
|
|
42
45
|
};
|
|
43
46
|
export default { metadata, tool, handler };
|
package/docs-search-tool.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-search-tool.mjs","sourceRoot":"","sources":["src/docs-search-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAY,mBAAmB,EAAE;AAIxC,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,MAAM;IACjB,I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I,KAAK,CACb,GAAG,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,UAAU,yCAAyC,MAAM,MAAM,CAAC,IAAI,EAAE,EAAE,CACrG,CAAC;IACJ,CAAC;IAED,OAAO,mBAAmB,CAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nirvana-labs/nirvana-mcp",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.3",
|
|
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.26.
|
|
21
|
+
"@nirvana-labs/nirvana": "^1.26.3",
|
|
22
22
|
"@cloudflare/cabidela": "^0.2.4",
|
|
23
23
|
"@modelcontextprotocol/sdk": "^1.24.0",
|
|
24
24
|
"@valtown/deno-http-worker": "^0.0.21",
|
|
@@ -49,12 +49,6 @@
|
|
|
49
49
|
"types": "./index.d.mts",
|
|
50
50
|
"default": "./index.mjs"
|
|
51
51
|
},
|
|
52
|
-
"./code-tool-paths": {
|
|
53
|
-
"require": "./code-tool-paths.cjs"
|
|
54
|
-
},
|
|
55
|
-
"./code-tool-paths.cjs": {
|
|
56
|
-
"default": "./code-tool-paths.cjs"
|
|
57
|
-
},
|
|
58
52
|
"./code-tool-types": {
|
|
59
53
|
"import": "./code-tool-types.mjs",
|
|
60
54
|
"require": "./code-tool-types.js"
|
|
@@ -65,16 +59,6 @@
|
|
|
65
59
|
"./code-tool-types.mjs": {
|
|
66
60
|
"default": "./code-tool-types.mjs"
|
|
67
61
|
},
|
|
68
|
-
"./code-tool-worker": {
|
|
69
|
-
"import": "./code-tool-worker.mjs",
|
|
70
|
-
"require": "./code-tool-worker.js"
|
|
71
|
-
},
|
|
72
|
-
"./code-tool-worker.js": {
|
|
73
|
-
"default": "./code-tool-worker.js"
|
|
74
|
-
},
|
|
75
|
-
"./code-tool-worker.mjs": {
|
|
76
|
-
"default": "./code-tool-worker.mjs"
|
|
77
|
-
},
|
|
78
62
|
"./code-tool": {
|
|
79
63
|
"import": "./code-tool.mjs",
|
|
80
64
|
"require": "./code-tool.js"
|
package/server.js
CHANGED
|
@@ -22,7 +22,7 @@ var tools_2 = require("./tools.js");
|
|
|
22
22
|
Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
|
|
23
23
|
const newMcpServer = () => new mcp_js_1.McpServer({
|
|
24
24
|
name: 'nirvana_labs_nirvana_api',
|
|
25
|
-
version: '1.26.
|
|
25
|
+
version: '1.26.3',
|
|
26
26
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
27
27
|
exports.newMcpServer = newMcpServer;
|
|
28
28
|
// Create server instance
|
package/server.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export { ClientType } from "./compat.mjs";
|
|
|
11
11
|
export { endpoints } from "./tools.mjs";
|
|
12
12
|
export const newMcpServer = () => new McpServer({
|
|
13
13
|
name: 'nirvana_labs_nirvana_api',
|
|
14
|
-
version: '1.26.
|
|
14
|
+
version: '1.26.3',
|
|
15
15
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
16
16
|
// Create server instance
|
|
17
17
|
export const server = newMcpServer();
|