@zavudev/sdk-mcp 0.26.0 → 0.28.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.
Files changed (109) hide show
  1. package/auth.d.mts +3 -1
  2. package/auth.d.mts.map +1 -1
  3. package/auth.d.ts +3 -1
  4. package/auth.d.ts.map +1 -1
  5. package/auth.js +15 -3
  6. package/auth.js.map +1 -1
  7. package/auth.mjs +12 -1
  8. package/auth.mjs.map +1 -1
  9. package/code-tool-paths.cjs +6 -0
  10. package/code-tool-paths.cjs.map +1 -0
  11. package/code-tool-paths.d.cts +2 -0
  12. package/code-tool-paths.d.cts.map +1 -0
  13. package/code-tool-types.d.mts.map +1 -1
  14. package/code-tool-types.d.ts.map +1 -1
  15. package/code-tool-worker.d.mts +5 -0
  16. package/code-tool-worker.d.mts.map +1 -0
  17. package/code-tool-worker.d.ts +5 -0
  18. package/code-tool-worker.d.ts.map +1 -0
  19. package/code-tool-worker.js +301 -0
  20. package/code-tool-worker.js.map +1 -0
  21. package/code-tool-worker.mjs +296 -0
  22. package/code-tool-worker.mjs.map +1 -0
  23. package/code-tool.d.mts +8 -2
  24. package/code-tool.d.mts.map +1 -1
  25. package/code-tool.d.ts +8 -2
  26. package/code-tool.d.ts.map +1 -1
  27. package/code-tool.js +263 -41
  28. package/code-tool.js.map +1 -1
  29. package/code-tool.mjs +228 -42
  30. package/code-tool.mjs.map +1 -1
  31. package/docs-search-tool.d.mts +9 -3
  32. package/docs-search-tool.d.mts.map +1 -1
  33. package/docs-search-tool.d.ts +9 -3
  34. package/docs-search-tool.d.ts.map +1 -1
  35. package/docs-search-tool.js +24 -7
  36. package/docs-search-tool.js.map +1 -1
  37. package/docs-search-tool.mjs +24 -7
  38. package/docs-search-tool.mjs.map +1 -1
  39. package/http.d.mts +2 -4
  40. package/http.d.mts.map +1 -1
  41. package/http.d.ts +2 -4
  42. package/http.d.ts.map +1 -1
  43. package/http.js +65 -42
  44. package/http.js.map +1 -1
  45. package/http.mjs +66 -43
  46. package/http.mjs.map +1 -1
  47. package/index.js +13 -12
  48. package/index.js.map +1 -1
  49. package/index.mjs +13 -12
  50. package/index.mjs.map +1 -1
  51. package/instructions.d.mts +2 -0
  52. package/instructions.d.mts.map +1 -0
  53. package/instructions.d.ts +2 -0
  54. package/instructions.d.ts.map +1 -0
  55. package/instructions.js +46 -0
  56. package/instructions.js.map +1 -0
  57. package/instructions.mjs +43 -0
  58. package/instructions.mjs.map +1 -0
  59. package/logger.d.mts +7 -0
  60. package/logger.d.mts.map +1 -0
  61. package/logger.d.ts +7 -0
  62. package/logger.d.ts.map +1 -0
  63. package/logger.js +29 -0
  64. package/logger.js.map +1 -0
  65. package/logger.mjs +22 -0
  66. package/logger.mjs.map +1 -0
  67. package/options.d.mts +5 -0
  68. package/options.d.mts.map +1 -1
  69. package/options.d.ts +5 -0
  70. package/options.d.ts.map +1 -1
  71. package/options.js +30 -0
  72. package/options.js.map +1 -1
  73. package/options.mjs +30 -0
  74. package/options.mjs.map +1 -1
  75. package/package.json +42 -5
  76. package/server.d.mts +8 -4
  77. package/server.d.mts.map +1 -1
  78. package/server.d.ts +8 -4
  79. package/server.d.ts.map +1 -1
  80. package/server.js +72 -50
  81. package/server.js.map +1 -1
  82. package/server.mjs +72 -50
  83. package/server.mjs.map +1 -1
  84. package/src/auth.ts +16 -1
  85. package/src/code-tool-paths.cts +3 -0
  86. package/src/code-tool-types.ts +1 -0
  87. package/src/code-tool-worker.ts +347 -0
  88. package/src/code-tool.ts +308 -55
  89. package/src/docs-search-tool.ts +44 -9
  90. package/src/http.ts +72 -44
  91. package/src/index.ts +15 -13
  92. package/src/instructions.ts +65 -0
  93. package/src/logger.ts +28 -0
  94. package/src/options.ts +41 -0
  95. package/src/server.ts +85 -66
  96. package/src/stdio.ts +4 -3
  97. package/src/types.ts +12 -4
  98. package/stdio.d.mts.map +1 -1
  99. package/stdio.d.ts.map +1 -1
  100. package/stdio.js +4 -3
  101. package/stdio.js.map +1 -1
  102. package/stdio.mjs +4 -3
  103. package/stdio.mjs.map +1 -1
  104. package/types.d.mts +8 -1
  105. package/types.d.mts.map +1 -1
  106. package/types.d.ts +8 -1
  107. package/types.d.ts.map +1 -1
  108. package/types.js.map +1 -1
  109. package/types.mjs.map +1 -1
package/src/index.ts CHANGED
@@ -5,15 +5,20 @@ import { McpOptions, parseCLIOptions } from './options';
5
5
  import { launchStdioServer } from './stdio';
6
6
  import { launchStreamableHTTPServer } from './http';
7
7
  import type { McpTool } from './types';
8
+ import { configureLogger, getLogger } from './logger';
8
9
 
9
10
  async function main() {
10
11
  const options = parseOptionsOrError();
12
+ configureLogger({
13
+ level: options.debug ? 'debug' : 'info',
14
+ pretty: options.logFormat === 'pretty',
15
+ });
11
16
 
12
17
  const selectedTools = await selectToolsOrError(options);
13
18
 
14
- console.error(
15
- `MCP Server starting with ${selectedTools.length} tools:`,
16
- selectedTools.map((e) => e.tool.name),
19
+ getLogger().info(
20
+ { tools: selectedTools.map((e) => e.tool.name) },
21
+ `MCP Server starting with ${selectedTools.length} tools`,
17
22
  );
18
23
 
19
24
  switch (options.transport) {
@@ -23,8 +28,7 @@ async function main() {
23
28
  case 'http':
24
29
  await launchStreamableHTTPServer({
25
30
  mcpOptions: options,
26
- debug: options.debug,
27
- port: options.port ?? options.socket,
31
+ port: options.socket ?? options.port,
28
32
  });
29
33
  break;
30
34
  }
@@ -32,7 +36,8 @@ async function main() {
32
36
 
33
37
  if (require.main === module) {
34
38
  main().catch((error) => {
35
- console.error('Fatal error in main():', error);
39
+ // Logger might not be initialized yet
40
+ console.error('Fatal error in main()', error);
36
41
  process.exit(1);
37
42
  });
38
43
  }
@@ -41,7 +46,8 @@ function parseOptionsOrError() {
41
46
  try {
42
47
  return parseCLIOptions();
43
48
  } catch (error) {
44
- console.error('Error parsing options:', error);
49
+ // Logger is initialized after options, so use console.error here
50
+ console.error('Error parsing options', error);
45
51
  process.exit(1);
46
52
  }
47
53
  }
@@ -50,16 +56,12 @@ async function selectToolsOrError(options: McpOptions): Promise<McpTool[]> {
50
56
  try {
51
57
  const includedTools = selectTools(options);
52
58
  if (includedTools.length === 0) {
53
- console.error('No tools match the provided filters.');
59
+ getLogger().error('No tools match the provided filters');
54
60
  process.exit(1);
55
61
  }
56
62
  return includedTools;
57
63
  } catch (error) {
58
- if (error instanceof Error) {
59
- console.error('Error filtering tools:', error.message);
60
- } else {
61
- console.error('Error filtering tools:', error);
62
- }
64
+ getLogger().error({ error }, 'Error filtering tools');
63
65
  process.exit(1);
64
66
  }
65
67
  }
@@ -0,0 +1,65 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { readEnv } from './util';
4
+ import { getLogger } from './logger';
5
+
6
+ const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes
7
+
8
+ interface InstructionsCacheEntry {
9
+ fetchedInstructions: string;
10
+ fetchedAt: number;
11
+ }
12
+
13
+ const instructionsCache = new Map<string, InstructionsCacheEntry>();
14
+
15
+ // Periodically evict stale entries so the cache doesn't grow unboundedly.
16
+ const _cacheCleanupInterval = setInterval(() => {
17
+ const now = Date.now();
18
+ for (const [key, entry] of instructionsCache) {
19
+ if (now - entry.fetchedAt > INSTRUCTIONS_CACHE_TTL_MS) {
20
+ instructionsCache.delete(key);
21
+ }
22
+ }
23
+ }, INSTRUCTIONS_CACHE_TTL_MS);
24
+
25
+ // Don't keep the process alive just for cleanup.
26
+ _cacheCleanupInterval.unref();
27
+
28
+ export async function getInstructions(stainlessApiKey: string | undefined): Promise<string> {
29
+ const cacheKey = stainlessApiKey ?? '';
30
+ const cached = instructionsCache.get(cacheKey);
31
+
32
+ if (cached && Date.now() - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) {
33
+ return cached.fetchedInstructions;
34
+ }
35
+
36
+ const fetchedInstructions = await fetchLatestInstructions(stainlessApiKey);
37
+ instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: Date.now() });
38
+ return fetchedInstructions;
39
+ }
40
+
41
+ async function fetchLatestInstructions(stainlessApiKey: string | undefined): Promise<string> {
42
+ // Setting the stainless API key is optional, but may be required
43
+ // to authenticate requests to the Stainless API.
44
+ const response = await fetch(
45
+ readEnv('CODE_MODE_INSTRUCTIONS_URL') ?? 'https://api.stainless.com/api/ai/instructions/zavudev',
46
+ {
47
+ method: 'GET',
48
+ headers: { ...(stainlessApiKey && { Authorization: stainlessApiKey }) },
49
+ },
50
+ );
51
+
52
+ let instructions: string | undefined;
53
+ if (!response.ok) {
54
+ getLogger().warn(
55
+ 'Warning: failed to retrieve MCP server instructions. Proceeding with default instructions...',
56
+ );
57
+
58
+ instructions =
59
+ '\n This is the zavudev MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
60
+ }
61
+
62
+ instructions ??= ((await response.json()) as { instructions: string }).instructions;
63
+
64
+ return instructions;
65
+ }
package/src/logger.ts ADDED
@@ -0,0 +1,28 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { pino, type Level, type Logger } from 'pino';
4
+ import pretty from 'pino-pretty';
5
+
6
+ let _logger: Logger | undefined;
7
+
8
+ export function configureLogger({ level, pretty: usePretty }: { level: Level; pretty: boolean }): void {
9
+ _logger = pino(
10
+ {
11
+ level,
12
+ timestamp: pino.stdTimeFunctions.isoTime,
13
+ formatters: {
14
+ level(label) {
15
+ return { level: label };
16
+ },
17
+ },
18
+ },
19
+ usePretty ? pretty({ colorize: true, levelFirst: true, destination: 2 }) : process.stderr,
20
+ );
21
+ }
22
+
23
+ export function getLogger(): Logger {
24
+ if (!_logger) {
25
+ throw new Error('Logger has not been configured. Call configureLogger() before using the logger.');
26
+ }
27
+ return _logger;
28
+ }
package/src/options.ts CHANGED
@@ -4,21 +4,28 @@ import qs from 'qs';
4
4
  import yargs from 'yargs';
5
5
  import { hideBin } from 'yargs/helpers';
6
6
  import z from 'zod';
7
+ import { readEnv } from './util';
7
8
 
8
9
  export type CLIOptions = McpOptions & {
9
10
  debug: boolean;
11
+ logFormat: 'json' | 'pretty';
10
12
  transport: 'stdio' | 'http';
11
13
  port: number | undefined;
12
14
  socket: string | undefined;
13
15
  };
14
16
 
15
17
  export type McpOptions = {
18
+ includeCodeTool?: boolean | undefined;
16
19
  includeDocsTools?: boolean | undefined;
20
+ stainlessApiKey?: string | undefined;
17
21
  codeAllowHttpGets?: boolean | undefined;
18
22
  codeAllowedMethods?: string[] | undefined;
19
23
  codeBlockedMethods?: string[] | undefined;
24
+ codeExecutionMode: McpCodeExecutionMode;
20
25
  };
21
26
 
27
+ export type McpCodeExecutionMode = 'stainless-sandbox' | 'local';
28
+
22
29
  export function parseCLIOptions(): CLIOptions {
23
30
  const opts = yargs(hideBin(process.argv))
24
31
  .option('code-allow-http-gets', {
@@ -38,7 +45,19 @@ export function parseCLIOptions(): CLIOptions {
38
45
  description:
39
46
  'Methods to explicitly block for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
40
47
  })
48
+ .option('code-execution-mode', {
49
+ type: 'string',
50
+ choices: ['stainless-sandbox', 'local'],
51
+ default: 'stainless-sandbox',
52
+ description:
53
+ "Where to run code execution in code tool; 'stainless-sandbox' will execute code in Stainless-hosted sandboxes whereas 'local' will execute code locally on the MCP server machine.",
54
+ })
41
55
  .option('debug', { type: 'boolean', description: 'Enable debug logging' })
56
+ .option('log-format', {
57
+ type: 'string',
58
+ choices: ['json', 'pretty'],
59
+ description: 'Format for log output; defaults to json unless tty is detected',
60
+ })
42
61
  .option('no-tools', {
43
62
  type: 'string',
44
63
  array: true,
@@ -51,6 +70,12 @@ export function parseCLIOptions(): CLIOptions {
51
70
  description: 'Port to serve on if using http transport',
52
71
  })
53
72
  .option('socket', { type: 'string', description: 'Unix socket to serve on if using http transport' })
73
+ .option('stainless-api-key', {
74
+ type: 'string',
75
+ default: readEnv('STAINLESS_API_KEY'),
76
+ description:
77
+ 'API key for Stainless. Used to authenticate requests to Stainless-hosted tools endpoints.',
78
+ })
54
79
  .option('tools', {
55
80
  type: 'string',
56
81
  array: true,
@@ -74,17 +99,26 @@ export function parseCLIOptions(): CLIOptions {
74
99
  : argv.tools?.includes(toolType) ? true
75
100
  : undefined;
76
101
 
102
+ const includeCodeTool = shouldIncludeToolType('code');
77
103
  const includeDocsTools = shouldIncludeToolType('docs');
78
104
 
79
105
  const transport = argv.transport as 'stdio' | 'http';
106
+ const logFormat =
107
+ argv.logFormat ? (argv.logFormat as 'json' | 'pretty')
108
+ : process.stderr.isTTY ? 'pretty'
109
+ : 'json';
80
110
 
81
111
  return {
112
+ ...(includeCodeTool !== undefined && { includeCodeTool }),
82
113
  ...(includeDocsTools !== undefined && { includeDocsTools }),
83
114
  debug: !!argv.debug,
115
+ stainlessApiKey: argv.stainlessApiKey,
84
116
  codeAllowHttpGets: argv.codeAllowHttpGets,
85
117
  codeAllowedMethods: argv.codeAllowedMethods,
86
118
  codeBlockedMethods: argv.codeBlockedMethods,
119
+ codeExecutionMode: argv.codeExecutionMode as McpCodeExecutionMode,
87
120
  transport,
121
+ logFormat,
88
122
  port: argv.port,
89
123
  socket: argv.socket,
90
124
  };
@@ -109,12 +143,19 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M
109
143
  const queryObject = typeof query === 'string' ? qs.parse(query) : query;
110
144
  const queryOptions = QueryOptions.parse(queryObject);
111
145
 
146
+ let codeTool: boolean | undefined =
147
+ queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
148
+ : queryOptions.tools?.includes('code') ? true
149
+ : defaultOptions.includeCodeTool;
150
+
112
151
  let docsTools: boolean | undefined =
113
152
  queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
114
153
  : queryOptions.tools?.includes('docs') ? true
115
154
  : defaultOptions.includeDocsTools;
116
155
 
117
156
  return {
157
+ ...(codeTool !== undefined && { includeCodeTool: codeTool }),
118
158
  ...(docsTools !== undefined && { includeDocsTools: docsTools }),
159
+ codeExecutionMode: defaultOptions.codeExecutionMode,
119
160
  };
120
161
  }
package/src/server.ts CHANGED
@@ -11,55 +11,19 @@ import { ClientOptions } from '@zavudev/sdk';
11
11
  import Zavudev from '@zavudev/sdk';
12
12
  import { codeTool } from './code-tool';
13
13
  import docsSearchTool from './docs-search-tool';
14
+ import { getInstructions } from './instructions';
14
15
  import { McpOptions } from './options';
15
16
  import { blockedMethodsForCodeTool } from './methods';
16
- import { HandlerFunction, McpTool } from './types';
17
- import { readEnv } from './util';
17
+ import { HandlerFunction, McpRequestContext, ToolCallResult, McpTool } from './types';
18
18
 
19
- async function getInstructions() {
20
- // This API key is optional; providing it allows the server to fetch instructions for unreleased versions.
21
- const stainlessAPIKey = readEnv('STAINLESS_API_KEY');
22
- const response = await fetch(
23
- readEnv('CODE_MODE_INSTRUCTIONS_URL') ?? 'https://api.stainless.com/api/ai/instructions/zavudev',
24
- {
25
- method: 'GET',
26
- headers: { ...(stainlessAPIKey && { Authorization: stainlessAPIKey }) },
27
- },
28
- );
29
-
30
- let instructions: string | undefined;
31
- if (!response.ok) {
32
- console.warn(
33
- 'Warning: failed to retrieve MCP server instructions. Proceeding with default instructions...',
34
- );
35
-
36
- instructions = `
37
- This is the zavudev MCP server. You will use Code Mode to help the user perform
38
- actions. You can use search_docs tool to learn about how to take action with this server. Then,
39
- you will write TypeScript code using the execute tool take action. It is CRITICAL that you be
40
- thoughtful and deliberate when executing code. Always try to entirely solve the problem in code
41
- block: it can be as long as you need to get the job done!
42
- `;
43
- }
44
-
45
- instructions ??= ((await response.json()) as { instructions: string }).instructions;
46
- instructions = `
47
- The current time in Unix timestamps is ${Date.now()}.
48
-
49
- ${instructions}
50
- `;
51
-
52
- return instructions;
53
- }
54
-
55
- export const newMcpServer = async () =>
19
+ export const newMcpServer = async (stainlessApiKey: string | undefined) =>
56
20
  new McpServer(
57
21
  {
58
22
  name: 'zavudev_sdk_api',
59
- version: '0.26.0',
23
+ version: '0.28.0',
60
24
  },
61
25
  {
62
- instructions: await getInstructions(),
26
+ instructions: await getInstructions(stainlessApiKey),
63
27
  capabilities: { tools: {}, logging: {} },
64
28
  },
65
29
  );
@@ -72,6 +36,7 @@ export async function initMcpServer(params: {
72
36
  server: Server | McpServer;
73
37
  clientOptions?: ClientOptions;
74
38
  mcpOptions?: McpOptions;
39
+ stainlessApiKey?: string | undefined;
75
40
  }) {
76
41
  const server = params.server instanceof McpServer ? params.server.server : params.server;
77
42
 
@@ -90,14 +55,32 @@ export async function initMcpServer(params: {
90
55
  error: logAtLevel('error'),
91
56
  };
92
57
 
93
- let client = new Zavudev({
94
- logger,
95
- ...params.clientOptions,
96
- defaultHeaders: {
97
- ...params.clientOptions?.defaultHeaders,
98
- 'X-Stainless-MCP': 'true',
99
- },
100
- });
58
+ let _client: Zavudev | undefined;
59
+ let _clientError: Error | undefined;
60
+ let _logLevel: 'debug' | 'info' | 'warn' | 'error' | 'off' | undefined;
61
+
62
+ const getClient = (): Zavudev => {
63
+ if (_clientError) throw _clientError;
64
+ if (!_client) {
65
+ try {
66
+ _client = new Zavudev({
67
+ logger,
68
+ ...params.clientOptions,
69
+ defaultHeaders: {
70
+ ...params.clientOptions?.defaultHeaders,
71
+ 'X-Stainless-MCP': 'true',
72
+ },
73
+ });
74
+ if (_logLevel) {
75
+ _client = _client.withOptions({ logLevel: _logLevel });
76
+ }
77
+ } catch (e) {
78
+ _clientError = e instanceof Error ? e : new Error(String(e));
79
+ throw _clientError;
80
+ }
81
+ }
82
+ return _client;
83
+ };
101
84
 
102
85
  const providedTools = selectTools(params.mcpOptions);
103
86
  const toolMap = Object.fromEntries(providedTools.map((mcpTool) => [mcpTool.tool.name, mcpTool]));
@@ -115,29 +98,56 @@ export async function initMcpServer(params: {
115
98
  throw new Error(`Unknown tool: ${name}`);
116
99
  }
117
100
 
118
- return executeHandler(mcpTool.handler, client, args);
101
+ let client: Zavudev;
102
+ try {
103
+ client = getClient();
104
+ } catch (error) {
105
+ return {
106
+ content: [
107
+ {
108
+ type: 'text' as const,
109
+ text: `Failed to initialize client: ${error instanceof Error ? error.message : String(error)}`,
110
+ },
111
+ ],
112
+ isError: true,
113
+ };
114
+ }
115
+
116
+ return executeHandler({
117
+ handler: mcpTool.handler,
118
+ reqContext: {
119
+ client,
120
+ stainlessApiKey: params.stainlessApiKey ?? params.mcpOptions?.stainlessApiKey,
121
+ },
122
+ args,
123
+ });
119
124
  });
120
125
 
121
126
  server.setRequestHandler(SetLevelRequestSchema, async (request) => {
122
127
  const { level } = request.params;
128
+ let logLevel: 'debug' | 'info' | 'warn' | 'error' | 'off';
123
129
  switch (level) {
124
130
  case 'debug':
125
- client = client.withOptions({ logLevel: 'debug' });
131
+ logLevel = 'debug';
126
132
  break;
127
133
  case 'info':
128
- client = client.withOptions({ logLevel: 'info' });
134
+ logLevel = 'info';
129
135
  break;
130
136
  case 'notice':
131
137
  case 'warning':
132
- client = client.withOptions({ logLevel: 'warn' });
138
+ logLevel = 'warn';
133
139
  break;
134
140
  case 'error':
135
- client = client.withOptions({ logLevel: 'error' });
141
+ logLevel = 'error';
136
142
  break;
137
143
  default:
138
- client = client.withOptions({ logLevel: 'off' });
144
+ logLevel = 'off';
139
145
  break;
140
146
  }
147
+ _logLevel = logLevel;
148
+ if (_client) {
149
+ _client = _client.withOptions({ logLevel });
150
+ }
141
151
  return {};
142
152
  });
143
153
  }
@@ -146,11 +156,16 @@ export async function initMcpServer(params: {
146
156
  * Selects the tools to include in the MCP Server based on the provided options.
147
157
  */
148
158
  export function selectTools(options?: McpOptions): McpTool[] {
149
- const includedTools = [
150
- codeTool({
151
- blockedMethods: blockedMethodsForCodeTool(options),
152
- }),
153
- ];
159
+ const includedTools = [];
160
+
161
+ if (options?.includeCodeTool ?? true) {
162
+ includedTools.push(
163
+ codeTool({
164
+ blockedMethods: blockedMethodsForCodeTool(options),
165
+ codeExecutionMode: options?.codeExecutionMode ?? 'stainless-sandbox',
166
+ }),
167
+ );
168
+ }
154
169
  if (options?.includeDocsTools ?? true) {
155
170
  includedTools.push(docsSearchTool);
156
171
  }
@@ -160,10 +175,14 @@ export function selectTools(options?: McpOptions): McpTool[] {
160
175
  /**
161
176
  * Runs the provided handler with the given client and arguments.
162
177
  */
163
- export async function executeHandler(
164
- handler: HandlerFunction,
165
- client: Zavudev,
166
- args: Record<string, unknown> | undefined,
167
- ) {
168
- return await handler(client, args || {});
178
+ export async function executeHandler({
179
+ handler,
180
+ reqContext,
181
+ args,
182
+ }: {
183
+ handler: HandlerFunction;
184
+ reqContext: McpRequestContext;
185
+ args: Record<string, unknown> | undefined;
186
+ }): Promise<ToolCallResult> {
187
+ return await handler({ reqContext, args: args || {} });
169
188
  }
package/src/stdio.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
2
2
  import { McpOptions } from './options';
3
3
  import { initMcpServer, newMcpServer } from './server';
4
+ import { getLogger } from './logger';
4
5
 
5
6
  export const launchStdioServer = async (mcpOptions: McpOptions) => {
6
- const server = await newMcpServer();
7
+ const server = await newMcpServer(mcpOptions.stainlessApiKey);
7
8
 
8
- await initMcpServer({ server, mcpOptions });
9
+ await initMcpServer({ server, mcpOptions, stainlessApiKey: mcpOptions.stainlessApiKey });
9
10
 
10
11
  const transport = new StdioServerTransport();
11
12
  await server.connect(transport);
12
- console.error('MCP Server running on stdio');
13
+ getLogger().info('MCP Server running on stdio');
13
14
  };
package/src/types.ts CHANGED
@@ -42,10 +42,18 @@ export type ToolCallResult = {
42
42
  isError?: boolean;
43
43
  };
44
44
 
45
- export type HandlerFunction = (
46
- client: Zavudev,
47
- args: Record<string, unknown> | undefined,
48
- ) => Promise<ToolCallResult>;
45
+ export type McpRequestContext = {
46
+ client: Zavudev;
47
+ stainlessApiKey?: string | undefined;
48
+ };
49
+
50
+ export type HandlerFunction = ({
51
+ reqContext,
52
+ args,
53
+ }: {
54
+ reqContext: McpRequestContext;
55
+ args: Record<string, unknown> | undefined;
56
+ }) => Promise<ToolCallResult>;
49
57
 
50
58
  export function asTextContentResult(result: unknown): ToolCallResult {
51
59
  return {
package/stdio.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"stdio.d.mts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAGrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,kBAQ7D,CAAC"}
1
+ {"version":3,"file":"stdio.d.mts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAIrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,kBAQ7D,CAAC"}
package/stdio.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAGrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,kBAQ7D,CAAC"}
1
+ {"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAIrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,kBAQ7D,CAAC"}
package/stdio.js CHANGED
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.launchStdioServer = void 0;
4
4
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
5
5
  const server_1 = require("./server.js");
6
+ const logger_1 = require("./logger.js");
6
7
  const launchStdioServer = async (mcpOptions) => {
7
- const server = await (0, server_1.newMcpServer)();
8
- await (0, server_1.initMcpServer)({ server, mcpOptions });
8
+ const server = await (0, server_1.newMcpServer)(mcpOptions.stainlessApiKey);
9
+ await (0, server_1.initMcpServer)({ server, mcpOptions, stainlessApiKey: mcpOptions.stainlessApiKey });
9
10
  const transport = new stdio_js_1.StdioServerTransport();
10
11
  await server.connect(transport);
11
- console.error('MCP Server running on stdio');
12
+ (0, logger_1.getLogger)().info('MCP Server running on stdio');
12
13
  };
13
14
  exports.launchStdioServer = launchStdioServer;
14
15
  //# sourceMappingURL=stdio.js.map
package/stdio.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"stdio.js","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":";;;AAAA,wEAAiF;AAEjF,wCAAuD;AAEhD,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,GAAE,CAAC;IAEpC,MAAM,IAAA,sBAAa,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAE5C,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B"}
1
+ {"version":3,"file":"stdio.js","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":";;;AAAA,wEAAiF;AAEjF,wCAAuD;AACvD,wCAAqC;AAE9B,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,EAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAE9D,MAAM,IAAA,sBAAa,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;IAEzF,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,IAAA,kBAAS,GAAE,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B"}
package/stdio.mjs CHANGED
@@ -1,10 +1,11 @@
1
1
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
2
2
  import { initMcpServer, newMcpServer } from "./server.mjs";
3
+ import { getLogger } from "./logger.mjs";
3
4
  export const launchStdioServer = async (mcpOptions) => {
4
- const server = await newMcpServer();
5
- await initMcpServer({ server, mcpOptions });
5
+ const server = await newMcpServer(mcpOptions.stainlessApiKey);
6
+ await initMcpServer({ server, mcpOptions, stainlessApiKey: mcpOptions.stainlessApiKey });
6
7
  const transport = new StdioServerTransport();
7
8
  await server.connect(transport);
8
- console.error('MCP Server running on stdio');
9
+ getLogger().info('MCP Server running on stdio');
9
10
  };
10
11
  //# sourceMappingURL=stdio.mjs.map
package/stdio.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"stdio.mjs","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C;OAEzE,EAAE,aAAa,EAAE,YAAY,EAAE;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;IAEpC,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAE5C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC"}
1
+ {"version":3,"file":"stdio.mjs","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C;OAEzE,EAAE,aAAa,EAAE,YAAY,EAAE;OAC/B,EAAE,SAAS,EAAE;AAEpB,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAE9D,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;IAEzF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAClD,CAAC,CAAC"}
package/types.d.mts CHANGED
@@ -31,7 +31,14 @@ export type ToolCallResult = {
31
31
  content: ContentBlock[];
32
32
  isError?: boolean;
33
33
  };
34
- export type HandlerFunction = (client: Zavudev, args: Record<string, unknown> | undefined) => Promise<ToolCallResult>;
34
+ export type McpRequestContext = {
35
+ client: Zavudev;
36
+ stainlessApiKey?: string | undefined;
37
+ };
38
+ export type HandlerFunction = ({ reqContext, args, }: {
39
+ reqContext: McpRequestContext;
40
+ args: Record<string, unknown> | undefined;
41
+ }) => Promise<ToolCallResult>;
35
42
  export declare function asTextContentResult(result: unknown): ToolCallResult;
36
43
  export declare function asBinaryContentResult(response: Response): Promise<ToolCallResult>;
37
44
  export declare function asErrorResult(message: string): ToolCallResult;
package/types.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"OAEO,OAAO,MAAM,cAAc;OAC3B,EAAE,IAAI,EAAE,MAAM,oCA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BAAoB,CAAC;AAE3G,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,EAC7B,UAAU,EACV,IAAI,GACL,EAAE;IACD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC3C,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAE9B,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,CASnE;AAED,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CA2BvF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAU7D;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC"}
package/types.d.ts CHANGED
@@ -31,7 +31,14 @@ export type ToolCallResult = {
31
31
  content: ContentBlock[];
32
32
  isError?: boolean;
33
33
  };
34
- export type HandlerFunction = (client: Zavudev, args: Record<string, unknown> | undefined) => Promise<ToolCallResult>;
34
+ export type McpRequestContext = {
35
+ client: Zavudev;
36
+ stainlessApiKey?: string | undefined;
37
+ };
38
+ export type HandlerFunction = ({ reqContext, args, }: {
39
+ reqContext: McpRequestContext;
40
+ args: Record<string, unknown> | undefined;
41
+ }) => Promise<ToolCallResult>;
35
42
  export declare function asTextContentResult(result: unknown): ToolCallResult;
36
43
  export declare function asBinaryContentResult(response: Response): Promise<ToolCallResult>;
37
44
  export declare function asErrorResult(message: string): ToolCallResult;
package/types.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"OAEO,OAAO,MAAM,cAAc;OAC3B,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EACJ;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAE3G,MAAM,MAAM,cAAc,GAAG;IAC3B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