@stigg/typescript-mcp 0.1.0-alpha.21 → 0.1.0-alpha.23

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 (57) hide show
  1. package/code-tool-paths.cjs +4 -2
  2. package/code-tool-paths.cjs.map +1 -1
  3. package/code-tool-paths.d.cts +1 -1
  4. package/code-tool-paths.d.cts.map +1 -1
  5. package/code-tool-worker.d.mts.map +1 -1
  6. package/code-tool-worker.d.ts.map +1 -1
  7. package/code-tool-worker.js +1 -2
  8. package/code-tool-worker.js.map +1 -1
  9. package/code-tool-worker.mjs +1 -2
  10. package/code-tool-worker.mjs.map +1 -1
  11. package/code-tool.d.mts.map +1 -1
  12. package/code-tool.d.ts.map +1 -1
  13. package/code-tool.js +29 -23
  14. package/code-tool.js.map +1 -1
  15. package/code-tool.mjs +20 -11
  16. package/code-tool.mjs.map +1 -1
  17. package/http.d.mts.map +1 -1
  18. package/http.d.ts.map +1 -1
  19. package/http.js +41 -2
  20. package/http.js.map +1 -1
  21. package/http.mjs +41 -2
  22. package/http.mjs.map +1 -1
  23. package/instructions.d.mts.map +1 -1
  24. package/instructions.d.ts.map +1 -1
  25. package/instructions.js +8 -12
  26. package/instructions.js.map +1 -1
  27. package/instructions.mjs +8 -12
  28. package/instructions.mjs.map +1 -1
  29. package/methods.d.mts.map +1 -1
  30. package/methods.d.ts.map +1 -1
  31. package/methods.js +6 -12
  32. package/methods.js.map +1 -1
  33. package/methods.mjs +6 -12
  34. package/methods.mjs.map +1 -1
  35. package/package.json +2 -2
  36. package/server.d.mts +1 -0
  37. package/server.d.mts.map +1 -1
  38. package/server.d.ts +1 -0
  39. package/server.d.ts.map +1 -1
  40. package/server.js +2 -1
  41. package/server.js.map +1 -1
  42. package/server.mjs +2 -1
  43. package/server.mjs.map +1 -1
  44. package/src/code-tool-paths.cts +3 -1
  45. package/src/code-tool-worker.ts +1 -2
  46. package/src/code-tool.ts +32 -19
  47. package/src/http.ts +44 -2
  48. package/src/instructions.ts +10 -15
  49. package/src/methods.ts +6 -12
  50. package/src/server.ts +3 -1
  51. package/src/types.ts +1 -0
  52. package/types.d.mts +1 -0
  53. package/types.d.mts.map +1 -1
  54. package/types.d.ts +1 -0
  55. package/types.d.ts.map +1 -1
  56. package/types.js.map +1 -1
  57. package/types.mjs.map +1 -1
package/src/code-tool.ts CHANGED
@@ -1,10 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import url from 'node:url';
6
- import { newDenoHTTPWorker } from '@valtown/deno-http-worker';
7
- import { workerPath } from './code-tool-paths.cjs';
8
3
  import {
9
4
  ContentBlock,
10
5
  McpRequestContext,
@@ -149,19 +144,23 @@ const remoteStainlessHandler = async ({
149
144
 
150
145
  const codeModeEndpoint = readEnv('CODE_MODE_ENDPOINT_URL') ?? 'https://api.stainless.com/api/ai/code-tool';
151
146
 
147
+ const localClientEnvs = {
148
+ STIGG_API_KEY: requireValue(
149
+ readEnv('STIGG_API_KEY') ?? client.apiKey,
150
+ 'set STIGG_API_KEY environment variable or provide apiKey client option',
151
+ ),
152
+ STIGG_BASE_URL: readEnv('STIGG_BASE_URL') ?? client.baseURL ?? undefined,
153
+ };
154
+ // Merge any upstream client envs from the request header, with upstream values taking precedence.
155
+ const mergedClientEnvs = { ...localClientEnvs, ...reqContext.upstreamClientEnvs };
156
+
152
157
  // Setting a Stainless API key authenticates requests to the code tool endpoint.
153
158
  const res = await fetch(codeModeEndpoint, {
154
159
  method: 'POST',
155
160
  headers: {
156
161
  ...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }),
157
162
  'Content-Type': 'application/json',
158
- 'x-stainless-mcp-client-envs': JSON.stringify({
159
- STIGG_API_KEY: requireValue(
160
- readEnv('STIGG_API_KEY') ?? client.apiKey,
161
- 'set STIGG_API_KEY environment variable or provide apiKey client option',
162
- ),
163
- STIGG_BASE_URL: readEnv('STIGG_BASE_URL') ?? client.baseURL ?? undefined,
164
- }),
163
+ 'x-stainless-mcp-client-envs': JSON.stringify(mergedClientEnvs),
165
164
  },
166
165
  body: JSON.stringify({
167
166
  project_name: 'stigg',
@@ -204,6 +203,13 @@ const localDenoHandler = async ({
204
203
  reqContext: McpRequestContext;
205
204
  args: unknown;
206
205
  }): Promise<ToolCallResult> => {
206
+ const fs = await import('node:fs');
207
+ const path = await import('node:path');
208
+ const url = await import('node:url');
209
+ const { newDenoHTTPWorker } = await import('@valtown/deno-http-worker');
210
+ const { getWorkerPath } = await import('./code-tool-paths.cjs');
211
+ const workerPath = getWorkerPath();
212
+
207
213
  const client = reqContext.client;
208
214
  const baseURLHostname = new URL(client.baseURL).hostname;
209
215
  const { code } = args as { code: string };
@@ -265,6 +271,9 @@ const localDenoHandler = async ({
265
271
  printOutput: true,
266
272
  spawnOptions: {
267
273
  cwd: path.dirname(workerPath),
274
+ // Merge any upstream client envs into the Deno subprocess environment,
275
+ // with the upstream env vars taking precedence.
276
+ env: { ...process.env, ...reqContext.upstreamClientEnvs },
268
277
  },
269
278
  });
270
279
 
@@ -274,13 +283,17 @@ const localDenoHandler = async ({
274
283
  reject(new Error(`Worker exited with code ${exitCode}`));
275
284
  });
276
285
 
277
- const opts: ClientOptions = {
278
- baseURL: client.baseURL,
279
- apiKey: client.apiKey,
280
- defaultHeaders: {
281
- 'X-Stainless-MCP': 'true',
282
- },
283
- };
286
+ // Strip null/undefined values so that the worker SDK client can fall back to
287
+ // reading from environment variables (including any upstreamClientEnvs).
288
+ const opts: ClientOptions = Object.fromEntries(
289
+ Object.entries({
290
+ baseURL: client.baseURL,
291
+ apiKey: client.apiKey,
292
+ defaultHeaders: {
293
+ 'X-Stainless-MCP': 'true',
294
+ },
295
+ }).filter(([_, v]) => v != null),
296
+ ) as ClientOptions;
284
297
 
285
298
  const req = worker.request(
286
299
  'http://localhost',
package/src/http.ts CHANGED
@@ -27,14 +27,56 @@ const newServer = async ({
27
27
 
28
28
  const authOptions = parseClientAuthHeaders(req, false);
29
29
 
30
+ let upstreamClientEnvs: Record<string, string> | undefined;
31
+ const clientEnvsHeader = req.headers['x-stainless-mcp-client-envs'];
32
+ if (typeof clientEnvsHeader === 'string') {
33
+ try {
34
+ const parsed = JSON.parse(clientEnvsHeader);
35
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
36
+ upstreamClientEnvs = parsed;
37
+ }
38
+ } catch {
39
+ // Ignore malformed header
40
+ }
41
+ }
42
+
43
+ // Parse x-stainless-mcp-client-permissions header to override permission options
44
+ //
45
+ // Note: Permissions are best-effort and intended to prevent clients from doing unexpected things;
46
+ // they're not a hard security boundary, so we allow arbitrary, client-driven overrides.
47
+ //
48
+ // See the Stainless MCP documentation for more details.
49
+ let effectiveMcpOptions = mcpOptions;
50
+ const clientPermissionsHeader = req.headers['x-stainless-mcp-client-permissions'];
51
+ if (typeof clientPermissionsHeader === 'string') {
52
+ try {
53
+ const parsed = JSON.parse(clientPermissionsHeader);
54
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
55
+ effectiveMcpOptions = {
56
+ ...mcpOptions,
57
+ ...(typeof parsed.allow_http_gets === 'boolean' && { codeAllowHttpGets: parsed.allow_http_gets }),
58
+ ...(Array.isArray(parsed.allowed_methods) && { codeAllowedMethods: parsed.allowed_methods }),
59
+ ...(Array.isArray(parsed.blocked_methods) && { codeBlockedMethods: parsed.blocked_methods }),
60
+ };
61
+ getLogger().info(
62
+ { clientPermissions: parsed },
63
+ 'Overriding code execution permissions from x-stainless-mcp-client-permissions header',
64
+ );
65
+ }
66
+ } catch (error) {
67
+ getLogger().warn({ error }, 'Failed to parse x-stainless-mcp-client-permissions header');
68
+ }
69
+ }
70
+
30
71
  await initMcpServer({
31
72
  server: server,
32
- mcpOptions: mcpOptions,
73
+ mcpOptions: effectiveMcpOptions,
33
74
  clientOptions: {
34
75
  ...clientOptions,
35
76
  ...authOptions,
36
77
  },
37
78
  stainlessApiKey: stainlessApiKey,
79
+ upstreamClientEnvs,
38
80
  });
39
81
 
40
82
  return server;
@@ -72,7 +114,7 @@ const del = async (req: express.Request, res: express.Response) => {
72
114
  };
73
115
 
74
116
  const redactHeaders = (headers: Record<string, any>) => {
75
- const hiddenHeaders = /auth|cookie|key|token/i;
117
+ const hiddenHeaders = /auth|cookie|key|token|x-stainless-mcp-client-envs/i;
76
118
  const filtered = { ...headers };
77
119
  Object.keys(filtered).forEach((key) => {
78
120
  if (hiddenHeaders.test(key)) {
@@ -12,29 +12,24 @@ interface InstructionsCacheEntry {
12
12
 
13
13
  const instructionsCache = new Map<string, InstructionsCacheEntry>();
14
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
15
  export async function getInstructions(stainlessApiKey: string | undefined): Promise<string> {
16
+ const now = Date.now();
29
17
  const cacheKey = stainlessApiKey ?? '';
30
18
  const cached = instructionsCache.get(cacheKey);
31
19
 
32
- if (cached && Date.now() - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) {
20
+ if (cached && now - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) {
33
21
  return cached.fetchedInstructions;
34
22
  }
35
23
 
24
+ // Evict stale entries so the cache doesn't grow unboundedly.
25
+ for (const [key, entry] of instructionsCache) {
26
+ if (now - entry.fetchedAt > INSTRUCTIONS_CACHE_TTL_MS) {
27
+ instructionsCache.delete(key);
28
+ }
29
+ }
30
+
36
31
  const fetchedInstructions = await fetchLatestInstructions(stainlessApiKey);
37
- instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: Date.now() });
32
+ instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: now });
38
33
  return fetchedInstructions;
39
34
  }
40
35
 
package/src/methods.ts CHANGED
@@ -52,6 +52,12 @@ export const sdkMethods: SdkMethod[] = [
52
52
  httpMethod: 'post',
53
53
  httpPath: '/api/v1/customers',
54
54
  },
55
+ {
56
+ clientCallName: 'client.v1.customers.retrieveEntitlements',
57
+ fullyQualifiedName: 'v1.customers.retrieveEntitlements',
58
+ httpMethod: 'get',
59
+ httpPath: '/api/v1/customers/{id}/entitlements',
60
+ },
55
61
  {
56
62
  clientCallName: 'client.v1.customers.unarchive',
57
63
  fullyQualifiedName: 'v1.customers.unarchive',
@@ -334,12 +340,6 @@ export const sdkMethods: SdkMethod[] = [
334
340
  httpMethod: 'delete',
335
341
  httpPath: '/api/v1/addons/{id}/draft',
336
342
  },
337
- {
338
- clientCallName: 'client.v1.addons.setPricing',
339
- fullyQualifiedName: 'v1.addons.setPricing',
340
- httpMethod: 'put',
341
- httpPath: '/api/v1/addons/{id}/charges',
342
- },
343
343
  {
344
344
  clientCallName: 'client.v1.addons.entitlements.create',
345
345
  fullyQualifiedName: 'v1.addons.entitlements.create',
@@ -412,12 +412,6 @@ export const sdkMethods: SdkMethod[] = [
412
412
  httpMethod: 'delete',
413
413
  httpPath: '/api/v1/plans/{id}/draft',
414
414
  },
415
- {
416
- clientCallName: 'client.v1.plans.setPricing',
417
- fullyQualifiedName: 'v1.plans.setPricing',
418
- httpMethod: 'put',
419
- httpPath: '/api/v1/plans/{id}/charges',
420
- },
421
415
  {
422
416
  clientCallName: 'client.v1.plans.entitlements.create',
423
417
  fullyQualifiedName: 'v1.plans.entitlements.create',
package/src/server.ts CHANGED
@@ -20,7 +20,7 @@ export const newMcpServer = async (stainlessApiKey: string | undefined) =>
20
20
  new McpServer(
21
21
  {
22
22
  name: 'stigg_typescript_api',
23
- version: '0.1.0-alpha.21',
23
+ version: '0.1.0-alpha.23',
24
24
  },
25
25
  {
26
26
  instructions: await getInstructions(stainlessApiKey),
@@ -37,6 +37,7 @@ export async function initMcpServer(params: {
37
37
  clientOptions?: ClientOptions;
38
38
  mcpOptions?: McpOptions;
39
39
  stainlessApiKey?: string | undefined;
40
+ upstreamClientEnvs?: Record<string, string> | undefined;
40
41
  }) {
41
42
  const server = params.server instanceof McpServer ? params.server.server : params.server;
42
43
 
@@ -118,6 +119,7 @@ export async function initMcpServer(params: {
118
119
  reqContext: {
119
120
  client,
120
121
  stainlessApiKey: params.stainlessApiKey ?? params.mcpOptions?.stainlessApiKey,
122
+ upstreamClientEnvs: params.upstreamClientEnvs,
121
123
  },
122
124
  args,
123
125
  });
package/src/types.ts CHANGED
@@ -45,6 +45,7 @@ export type ToolCallResult = {
45
45
  export type McpRequestContext = {
46
46
  client: Stigg;
47
47
  stainlessApiKey?: string | undefined;
48
+ upstreamClientEnvs?: Record<string, string> | undefined;
48
49
  };
49
50
 
50
51
  export type HandlerFunction = ({
package/types.d.mts CHANGED
@@ -34,6 +34,7 @@ export type ToolCallResult = {
34
34
  export type McpRequestContext = {
35
35
  client: Stigg;
36
36
  stainlessApiKey?: string | undefined;
37
+ upstreamClientEnvs?: Record<string, string> | undefined;
37
38
  };
38
39
  export type HandlerFunction = ({ reqContext, args, }: {
39
40
  reqContext: McpRequestContext;
package/types.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"OAEO,KAAK,MAAM,mBAAmB;OAC9B,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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AE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,KAAK,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CACzD,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
@@ -34,6 +34,7 @@ export type ToolCallResult = {
34
34
  export type McpRequestContext = {
35
35
  client: Stigg;
36
36
  stainlessApiKey?: string | undefined;
37
+ upstreamClientEnvs?: Record<string, string> | undefined;
37
38
  };
38
39
  export type HandlerFunction = ({ reqContext, args, }: {
39
40
  reqContext: McpRequestContext;
package/types.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"OAEO,KAAK,MAAM,mBAAmB;OAC9B,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,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,KAAK,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,EAC7B,UAAU,EACV,I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