Skip to content

Commit 0fa60f8

Browse files
authored
Merge pull request #25 from stainless-api/release-please--branches--main--changes--next--components--sdk
release: 0.1.0-alpha.23
2 parents 81eecd0 + b211480 commit 0fa60f8

23 files changed

Lines changed: 376 additions & 74 deletions
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ node_modules/
55
# Build outputs
66
dist/
77
**/dist/
8-
build/
9-
**/build/
108

119
# Git
1210
.git/
@@ -28,11 +26,6 @@ build/
2826
.DS_Store
2927
Thumbs.db
3028

31-
# Documentation
32-
*.md
33-
docs/
34-
LICENSE
35-
3629
# Testing
3730
test/
3831
tests/

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up pnpm
3030
uses: pnpm/action-setup@v4
3131
with:
32-
version: '10.24.0'
32+
version: '10.27.0'
3333

3434
- name: Bootstrap
3535
run: ./scripts/bootstrap
@@ -56,7 +56,7 @@ jobs:
5656
- name: Set up pnpm
5757
uses: pnpm/action-setup@v4
5858
with:
59-
version: '10.24.0'
59+
version: '10.27.0'
6060

6161
- name: Bootstrap
6262
run: ./scripts/bootstrap
@@ -103,7 +103,7 @@ jobs:
103103
- name: Set up pnpm
104104
uses: pnpm/action-setup@v4
105105
with:
106-
version: '10.24.0'
106+
version: '10.27.0'
107107

108108
- name: Bootstrap
109109
run: ./scripts/bootstrap

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.22"
2+
".": "0.1.0-alpha.23"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-2726a5c9d1b5921ca1eae4d3074e01d53b6a368df847a21722f30b34de324794.yml
3-
openapi_spec_hash: bdbc8f5388f88acaeff72e8f79e57e46
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-acfed4185515b0f9bfdb9b080df219b3bea1069daeb722d589564aa7d8eb32e6.yml
3+
openapi_spec_hash: 0fb1197c07e1f354f33d96c384e3ca3b
44
config_hash: 3e46d270da9f524c0dee35db0bcf76df

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 0.1.0-alpha.23 (2026-02-17)
4+
5+
Full Changelog: [v0.1.0-alpha.22...v0.1.0-alpha.23](https://github.com/stainless-api/stainless-api-typescript/compare/v0.1.0-alpha.22...v0.1.0-alpha.23)
6+
7+
### Features
8+
9+
* record tree oid and return it in the builds api ([f75de39](https://github.com/stainless-api/stainless-api-typescript/commit/f75de398bde828e6007b775b7a5e4fbf8da38541))
10+
11+
12+
### Bug Fixes
13+
14+
* **client:** avoid removing abort listener too early ([e657e39](https://github.com/stainless-api/stainless-api-typescript/commit/e657e394f7680df026868218af7cf08c425034ad))
15+
16+
17+
### Chores
18+
19+
* **internal:** add health check to MCP server when running in HTTP mode ([01547f9](https://github.com/stainless-api/stainless-api-typescript/commit/01547f9e108bbe5339665f757852267d9baf5c41))
20+
* **internal:** allow basic filtering of methods allowed for MCP code mode ([84bc770](https://github.com/stainless-api/stainless-api-typescript/commit/84bc7701d32df4eac5d471c96f52074cc2557044))
21+
* **internal:** always generate MCP server dockerfiles and upgrade associated dependencies ([c87ed99](https://github.com/stainless-api/stainless-api-typescript/commit/c87ed994b929201c9b25bb22ada52bbaa3ee34d9))
22+
* **internal:** avoid type checking errors with ts-reset ([4a453b6](https://github.com/stainless-api/stainless-api-typescript/commit/4a453b6ebd23ec3eb05bbb5d4328e1cca1e4a928))
23+
* **internal:** codegen related update ([067f371](https://github.com/stainless-api/stainless-api-typescript/commit/067f371829d4a8fa499f6e6ac6a7abc3d3671cd4))
24+
* **internal:** codegen related update ([59776d5](https://github.com/stainless-api/stainless-api-typescript/commit/59776d54e59bd708082e8e634db84a4008d45560))
25+
* **internal:** fix pagination internals not accepting option promises ([89813a0](https://github.com/stainless-api/stainless-api-typescript/commit/89813a0632566f24d6589400d9e0a7b8c9dafa78))
26+
* **internal:** upgrade pnpm ([adc84e0](https://github.com/stainless-api/stainless-api-typescript/commit/adc84e0f1f32dfc793d79d51d943284c05bac350))
27+
328
## 0.1.0-alpha.22 (2026-02-05)
429

530
Full Changelog: [v0.1.0-alpha.21...v0.1.0-alpha.22](https://github.com/stainless-api/stainless-api-typescript/compare/v0.1.0-alpha.21...v0.1.0-alpha.22)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@stainless-api/sdk",
3-
"version": "0.1.0-alpha.22",
3+
"version": "0.1.0-alpha.23",
44
"description": "The official TypeScript library for the Stainless API",
55
"author": "Stainless <support@stainless.com>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",
99
"repository": "github:stainless-api/stainless-api-typescript",
1010
"license": "Apache-2.0",
11-
"packageManager": "pnpm@10.24.0",
11+
"packageManager": "pnpm@10.27.0",
1212
"files": [
1313
"**/*"
1414
],

packages/mcp-server/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
# enables interactive mode, allowing the container to communicate over stdin/stdout.
2323

2424
# Build stage
25-
FROM node:20-alpine AS builder
25+
FROM node:24-alpine AS builder
2626

2727
# Enable corepack to use pnpm
2828
RUN corepack enable && corepack prepare pnpm@latest --activate
29+
2930
# Install bash for build script
3031
RUN apk add --no-cache bash openssl
3132

@@ -35,25 +36,24 @@ WORKDIR /build
3536
# Copy entire repository
3637
COPY . .
3738

39+
# Set CI environment variable so pnpm install runs without prompts
40+
ENV CI=true
41+
3842
# Install all dependencies and build everything
3943
RUN pnpm install --frozen-lockfile && \
4044
pnpm build
4145

4246
# Production stage
43-
FROM node:20-alpine
47+
FROM node:24-alpine
4448

4549
# Add non-root user
4650
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
4751

4852
# Set working directory
4953
WORKDIR /app
5054

51-
# Copy the built mcp-server preserving directory structure
52-
COPY --from=builder /build/packages/mcp-server/dist ./packages/mcp-server/dist
53-
COPY --from=builder /build/packages/mcp-server/node_modules ./packages/mcp-server/node_modules
54-
55-
# Copy node_modules from root (pnpm hoists dependencies here)
56-
COPY --from=builder /build/node_modules ./node_modules
55+
# Copy the build results, preserving directory structure
56+
COPY --from=builder /build .
5757

5858
# Copy the built @stainless-api/sdk into node_modules
5959
COPY --from=builder /build/dist ./node_modules/@stainless-api/sdk

packages/mcp-server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stainless-api/sdk-mcp",
3-
"version": "0.1.0-alpha.22",
3+
"version": "0.1.0-alpha.23",
44
"description": "The official MCP Server for the Stainless API",
55
"author": "Stainless <support@stainless.com>",
66
"types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
1313
},
1414
"homepage": "https://github.com/stainless-api/stainless-api-typescript/tree/main/packages/mcp-server#readme",
1515
"license": "Apache-2.0",
16-
"packageManager": "pnpm@10.24.0",
16+
"packageManager": "pnpm@10.27.0",
1717
"private": false,
1818
"publishConfig": {
1919
"access": "public"

packages/mcp-server/src/code-tool.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import { McpTool, Metadata, ToolCallResult, asErrorResult, asTextContentResult } from './types';
44
import { Tool } from '@modelcontextprotocol/sdk/types.js';
5-
import { readEnv } from './server';
5+
import { readEnv } from './util';
66
import { WorkerInput, WorkerOutput } from './code-tool-types';
7+
import { SdkMethod } from './methods';
78
import { Stainless } from '@stainless-api/sdk';
89

910
const prompt = `Runs JavaScript code to interact with the Stainless API.
@@ -35,7 +36,7 @@ Variables will not persist between calls, so make sure to return or log any data
3536
*
3637
* @param endpoints - The endpoints to include in the list.
3738
*/
38-
export function codeTool(): McpTool {
39+
export function codeTool(params: { blockedMethods: SdkMethod[] | undefined }): McpTool {
3940
const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] };
4041
const tool: Tool = {
4142
name: 'execute',
@@ -59,6 +60,24 @@ export function codeTool(): McpTool {
5960
const code = args.code as string;
6061
const intent = args.intent as string | undefined;
6162

63+
// Do very basic blocking of code that includes forbidden method names.
64+
//
65+
// WARNING: This is not secure against obfuscation and other evasion methods. If
66+
// stronger security blocks are required, then these should be enforced in the downstream
67+
// API (e.g., by having users call the MCP server with API keys with limited permissions).
68+
if (params.blockedMethods) {
69+
const blockedMatches = params.blockedMethods.filter((method) =>
70+
code.includes(method.fullyQualifiedName),
71+
);
72+
if (blockedMatches.length > 0) {
73+
return asErrorResult(
74+
`The following methods have been blocked by the MCP server and cannot be used in code execution: ${blockedMatches
75+
.map((m) => m.fullyQualifiedName)
76+
.join(', ')}`,
77+
);
78+
}
79+
}
80+
6281
// this is not required, but passing a Stainless API key for the matching project_name
6382
// will allow you to run code-mode queries against non-published versions of your SDK.
6483
const stainlessAPIKey = readEnv('STAINLESS_API_KEY');

0 commit comments

Comments
 (0)