Skip to content

Commit 0328338

Browse files
release: 0.1.0-alpha.12 (#13)
* chore(internal): codegen related update * feat: add timestamp to builds api * chore: move sdkjson generation api out of v0 scope * chore(internal): codegen related update * chore: make some internal functions async * codegen metadata * feat(api): add FileInput model * feat(mcp): support filtering tool results by a jq expression * fix(mcp): relax input type for asTextContextResult * codegen metadata * feat(api): add staging environment * docs: add pagination segment * codegen metadata * fix(mcp): support jq filtering on cloudflare workers * chore(mcp): rework imports in tools * feat(api): add more models * feat(api): add models * codegen metadata * codegen metadata * feat(api): add check step model * fix(api): catch more errors * feat(api): manual updates * codegen metadata * feat: Codegen(php): unset optional parameters in constructor * feat(api): manual updates * chore(ts): reorder package.json imports * chore(mcp): formatting * feat: php: generate stub union classes with discrimminator info * feat(C#, PHP): codegen stats * fix(java): ensure error handling always occurs * feat: productionize repo caching * fix(mcp): include required section for top-level properties and support naming transformations * codegen metadata * codegen metadata * feat(api): manual updates * codegen metadata * feat(api): manual updates * codegen metadata * feat: flesh out project branches endpoints * chore(internal): codegen related update * codegen metadata * codegen metadata * feat(api): manual updates * codegen metadata * codegen metadata * feat(api): manual updates * codegen metadata * codegen metadata * codegen metadata * codegen metadata * codegen metadata * chore(internal): remove redundant imports config * fix(mcp): fix tool description of jq_filter * fix(mcp): reverse validJson capability option and limit scope * fix(mcp): avoid sending `jq_filter` to base API * feat(mcp): add logging when environment variable is set * feat(mcp): remote server with passthru auth * fix(mcp): fix bug in header handling * chore(internal): move publish config * chore(mcp): refactor streamable http transport * feat(mcp): add unix socket option for remote MCP * feat(api): don't default to "main" branch * chore: update @stainless-api/prism-cli to v5.15.0 * chore(internal): update comment in script * chore(internal): codegen related update * codegen metadata * feat(api): discrim like this * feat(api): add install_url to build step; remove upload step * release: 0.1.0-alpha.12 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Stainless Bot <[email protected]>
1 parent fa562d4 commit 0328338

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1272
-885
lines changed

.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.11"
2+
".": "0.1.0-alpha.12"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-f8b160dfac6cc8d6951e42fe594883938f255f414d30e4e27a63dbb3060b5010.yml
3-
openapi_spec_hash: 0de103ac1222087e3b8779ceb9ac54cd
4-
config_hash: 63f70c18bae6c2b8fab57901a1050afc
1+
configured_endpoints: 18
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-c9dbcee416d3ce938a657e6fa1883ea8c40202b0bfb46d7dd5617cf2e844786c.yml
3+
openapi_spec_hash: 4bf38db5a15196d74647490ceebfbb9b
4+
config_hash: e968e8b5403abb8f4faa0b9753db713e

CHANGELOG.md

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

3+
## 0.1.0-alpha.12 (2025-08-12)
4+
5+
Full Changelog: [v0.1.0-alpha.11...v0.1.0-alpha.12](https://github.com/stainless-api/stainless-api-typescript/compare/v0.1.0-alpha.11...v0.1.0-alpha.12)
6+
7+
### Features
8+
9+
* add timestamp to builds api ([8e63219](https://github.com/stainless-api/stainless-api-typescript/commit/8e6321972c972be1a366fd532c24e406e2f96161))
10+
* **api:** add check step model ([4e28836](https://github.com/stainless-api/stainless-api-typescript/commit/4e28836d14a812227a7db451e90db3f8489de6e4))
11+
* **api:** add FileInput model ([b12f5a8](https://github.com/stainless-api/stainless-api-typescript/commit/b12f5a8f41326a16a0dabb29edfab64a9a2a66c1))
12+
* **api:** add models ([f503b4c](https://github.com/stainless-api/stainless-api-typescript/commit/f503b4c3be3b1ddedf224cdbfde4e7d254323949))
13+
* **api:** add more models ([818efd0](https://github.com/stainless-api/stainless-api-typescript/commit/818efd095889ae076b0e8623626ea6f1ed9c31ab))
14+
* **api:** add staging environment ([fdbd3aa](https://github.com/stainless-api/stainless-api-typescript/commit/fdbd3aaf8594ef5c451933ba4b7e9419ed9b9450))
15+
* **api:** discrim like this ([df5155c](https://github.com/stainless-api/stainless-api-typescript/commit/df5155caa6efc0732e14193c7ea03c5c5ad7828c))
16+
* **api:** don't default to "main" branch ([4cb1928](https://github.com/stainless-api/stainless-api-typescript/commit/4cb19288979480d5fac8e7b25f27170405f1d91f))
17+
* **api:** manual updates ([1e6eee5](https://github.com/stainless-api/stainless-api-typescript/commit/1e6eee5b94e1c992085d74aeed33f3346cd10003))
18+
* **api:** manual updates ([fa2cfdf](https://github.com/stainless-api/stainless-api-typescript/commit/fa2cfdf1d05e610588d176b56b99354fe567a02c))
19+
* **api:** manual updates ([19ff34d](https://github.com/stainless-api/stainless-api-typescript/commit/19ff34d2608a1509322c4e50c880e82fdeebff4c))
20+
* **api:** manual updates ([a8d7964](https://github.com/stainless-api/stainless-api-typescript/commit/a8d796418b8c92b72b59b9ab1c73806723036ddf))
21+
* **api:** manual updates ([91e6b32](https://github.com/stainless-api/stainless-api-typescript/commit/91e6b329986dcf343e6cfb0282da4d9bda889776))
22+
* **api:** manual updates ([54e2cdb](https://github.com/stainless-api/stainless-api-typescript/commit/54e2cdb8d8b9b044b4237db42762768c85ad8e2f))
23+
* **C#, PHP:** codegen stats ([eb15616](https://github.com/stainless-api/stainless-api-typescript/commit/eb156164cec1f5dd5f208b2069a0d8ae43ae6d1e))
24+
* Codegen(php): unset optional parameters in constructor ([55967d5](https://github.com/stainless-api/stainless-api-typescript/commit/55967d5c65d5ef7736b10afbfa7c5c93b4311014))
25+
* flesh out project branches endpoints ([f609ac7](https://github.com/stainless-api/stainless-api-typescript/commit/f609ac72c11bc67e47bafc0dd339e5072902b8ce))
26+
* **mcp:** add logging when environment variable is set ([5039c32](https://github.com/stainless-api/stainless-api-typescript/commit/5039c320334c05b8693a00c445a81926c96f3132))
27+
* **mcp:** add unix socket option for remote MCP ([e90cea6](https://github.com/stainless-api/stainless-api-typescript/commit/e90cea690700d047331917e52ef1a20b6fdfdbd9))
28+
* **mcp:** remote server with passthru auth ([25ebe60](https://github.com/stainless-api/stainless-api-typescript/commit/25ebe606f12120c9240bb627ad8ae010232f0b61))
29+
* **mcp:** support filtering tool results by a jq expression ([3ce621d](https://github.com/stainless-api/stainless-api-typescript/commit/3ce621d03b8a75e06bab4a70f5aac08b46acd59b))
30+
* php: generate stub union classes with discrimminator info ([6211878](https://github.com/stainless-api/stainless-api-typescript/commit/62118780200757b7f6eb94a27eee353eeaec4d1b))
31+
* productionize repo caching ([d1bdd86](https://github.com/stainless-api/stainless-api-typescript/commit/d1bdd86fe9291cc75a54d2b2a1da8dc079634993))
32+
33+
34+
### Bug Fixes
35+
36+
* **api:** catch more errors ([6255a02](https://github.com/stainless-api/stainless-api-typescript/commit/6255a02d2e2f5cda518f942ef42300a64b40c267))
37+
* **java:** ensure error handling always occurs ([4eb767c](https://github.com/stainless-api/stainless-api-typescript/commit/4eb767c1f3d03fda46d9029bd2122684fa735b84))
38+
* **mcp:** avoid sending `jq_filter` to base API ([85fd1d5](https://github.com/stainless-api/stainless-api-typescript/commit/85fd1d51101066bb6e285d28cd2740b345e0e5eb))
39+
* **mcp:** fix bug in header handling ([344163a](https://github.com/stainless-api/stainless-api-typescript/commit/344163a18629fce7f66fdc2437b9c016f45c6257))
40+
* **mcp:** fix tool description of jq_filter ([a92e0c2](https://github.com/stainless-api/stainless-api-typescript/commit/a92e0c2e79d4a3ac7386f6163008c16e0f3297d3))
41+
* **mcp:** include required section for top-level properties and support naming transformations ([d6ec40e](https://github.com/stainless-api/stainless-api-typescript/commit/d6ec40e7052a6077629d3c55dbd372e02b9c14e1))
42+
* **mcp:** relax input type for asTextContextResult ([8bb8201](https://github.com/stainless-api/stainless-api-typescript/commit/8bb820122ad75126ff6c88124e0af8c1887f9d1d))
43+
* **mcp:** reverse validJson capability option and limit scope ([653bd8d](https://github.com/stainless-api/stainless-api-typescript/commit/653bd8d33fada02157202c1e80390c73dfe2627e))
44+
* **mcp:** support jq filtering on cloudflare workers ([075f9da](https://github.com/stainless-api/stainless-api-typescript/commit/075f9daa3a0c5fd0e6ff0da9ebe2ce3e8ec9cb24))
45+
46+
47+
### Chores
48+
49+
* **internal:** codegen related update ([2bac3a2](https://github.com/stainless-api/stainless-api-typescript/commit/2bac3a2c685b6f9664b9d98de3572324320fb8ee))
50+
* **internal:** codegen related update ([fe68259](https://github.com/stainless-api/stainless-api-typescript/commit/fe68259438f3db5b8a994dc33630c84a5396ae72))
51+
* **internal:** codegen related update ([7b4fa85](https://github.com/stainless-api/stainless-api-typescript/commit/7b4fa857a86e4c49f1405a2ed6631bed7387a01e))
52+
* **internal:** codegen related update ([7dc4748](https://github.com/stainless-api/stainless-api-typescript/commit/7dc4748dfc988d5f6dff153a2fb658f92213f6b2))
53+
* **internal:** move publish config ([0b13ceb](https://github.com/stainless-api/stainless-api-typescript/commit/0b13cebc68850c93ff1953c00e7cae251d125b34))
54+
* **internal:** remove redundant imports config ([6328f05](https://github.com/stainless-api/stainless-api-typescript/commit/6328f057271afc8c8f7ec2807e16caa6b369d042))
55+
* **internal:** update comment in script ([017c2e8](https://github.com/stainless-api/stainless-api-typescript/commit/017c2e8494251ea492ad32c5b664770783baa1a6))
56+
* make some internal functions async ([a8433ef](https://github.com/stainless-api/stainless-api-typescript/commit/a8433ef35afab98e9c0d99aa3dd130fcf3047a3f))
57+
* **mcp:** formatting ([33c572a](https://github.com/stainless-api/stainless-api-typescript/commit/33c572a0957229da7ac9ca8b96e143d1a472c007))
58+
* **mcp:** refactor streamable http transport ([9e9f468](https://github.com/stainless-api/stainless-api-typescript/commit/9e9f4689eed8bc3712b511241398153e17752f38))
59+
* **mcp:** rework imports in tools ([a54a6f4](https://github.com/stainless-api/stainless-api-typescript/commit/a54a6f413824e2c9e1c73fc634ec7d822c37233b))
60+
* move sdkjson generation api out of v0 scope ([c42eba6](https://github.com/stainless-api/stainless-api-typescript/commit/c42eba6252eadc02392dc121b20597dbc4fd1058))
61+
* **ts:** reorder package.json imports ([e58856e](https://github.com/stainless-api/stainless-api-typescript/commit/e58856e8f8cbb977595b53323958b0cdb9a2515b))
62+
* update @stainless-api/prism-cli to v5.15.0 ([79a7d9e](https://github.com/stainless-api/stainless-api-typescript/commit/79a7d9edaeef60665f3074a34fe4dddd20af1ca2))
63+
* update mcp documentation ([fa562d4](https://github.com/stainless-api/stainless-api-typescript/commit/fa562d4acb4fdf8f483d519f663ac213f28227ad))
64+
65+
66+
### Documentation
67+
68+
* add pagination segment ([c0a456b](https://github.com/stainless-api/stainless-api-typescript/commit/c0a456b27a0f1104b8096dcf6954f841686fe8c5))
69+
370
## 0.1.0-alpha.11 (2025-07-07)
471

572
Full Changelog: [v0.1.0-alpha.10...v0.1.0-alpha.11](https://github.com/stainless-api/stainless-api-typescript/compare/v0.1.0-alpha.10...v0.1.0-alpha.11)

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Stainless from '@stainless-api/sdk';
2424

2525
const client = new Stainless({
2626
apiKey: process.env['STAINLESS_API_KEY'], // This is the default and can be omitted
27+
environment: 'staging', // defaults to 'production'
2728
});
2829

2930
const buildObject = await client.builds.create({ project: 'project', revision: 'string' });
@@ -41,6 +42,7 @@ import Stainless from '@stainless-api/sdk';
4142

4243
const client = new Stainless({
4344
apiKey: process.env['STAINLESS_API_KEY'], // This is the default and can be omitted
45+
environment: 'staging', // defaults to 'production'
4446
});
4547

4648
const params: Stainless.BuildCreateParams = { project: 'project', revision: 'string' };
@@ -125,6 +127,37 @@ On timeout, an `APIConnectionTimeoutError` is thrown.
125127

126128
Note that requests which time out will be [retried twice by default](#retries).
127129

130+
## Auto-pagination
131+
132+
List methods in the Stainless API are paginated.
133+
You can use the `for await … of` syntax to iterate through items across all pages:
134+
135+
```ts
136+
async function fetchAllBuildObjects(params) {
137+
const allBuildObjects = [];
138+
// Automatically fetches more pages as needed.
139+
for await (const buildObject of client.builds.list({ project: 'project' })) {
140+
allBuildObjects.push(buildObject);
141+
}
142+
return allBuildObjects;
143+
}
144+
```
145+
146+
Alternatively, you can request a single page at a time:
147+
148+
```ts
149+
let page = await client.builds.list({ project: 'project' });
150+
for (const buildObject of page.data) {
151+
console.log(buildObject);
152+
}
153+
154+
// Convenience methods are provided for manually paginating:
155+
while (page.hasNextPage()) {
156+
page = await page.getNextPage();
157+
// ...
158+
}
159+
```
160+
128161
## Advanced Usage
129162

130163
### Accessing raw Response data (e.g., headers)

api.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
1+
# Shared
2+
3+
Types:
4+
5+
- <code><a href="./src/resources/shared.ts">Commit</a></code>
6+
- <code><a href="./src/resources/shared.ts">FileInput</a></code>
7+
18
# Projects
29

310
Types:
411

5-
- <code><a href="./src/resources/projects/projects.ts">ProjectCreateResponse</a></code>
6-
- <code><a href="./src/resources/projects/projects.ts">ProjectRetrieveResponse</a></code>
7-
- <code><a href="./src/resources/projects/projects.ts">ProjectUpdateResponse</a></code>
8-
- <code><a href="./src/resources/projects/projects.ts">ProjectListResponse</a></code>
12+
- <code><a href="./src/resources/projects/projects.ts">Project</a></code>
913

1014
Methods:
1115

12-
- <code title="post /v0/projects">client.projects.<a href="./src/resources/projects/projects.ts">create</a>({ ...params }) -> ProjectCreateResponse</code>
13-
- <code title="get /v0/projects/{project}">client.projects.<a href="./src/resources/projects/projects.ts">retrieve</a>({ ...params }) -> ProjectRetrieveResponse</code>
14-
- <code title="patch /v0/projects/{project}">client.projects.<a href="./src/resources/projects/projects.ts">update</a>({ ...params }) -> ProjectUpdateResponse</code>
15-
- <code title="get /v0/projects">client.projects.<a href="./src/resources/projects/projects.ts">list</a>({ ...params }) -> ProjectListResponsesPage</code>
16+
- <code title="post /v0/projects">client.projects.<a href="./src/resources/projects/projects.ts">create</a>({ ...params }) -> Project</code>
17+
- <code title="get /v0/projects/{project}">client.projects.<a href="./src/resources/projects/projects.ts">retrieve</a>({ ...params }) -> Project</code>
18+
- <code title="patch /v0/projects/{project}">client.projects.<a href="./src/resources/projects/projects.ts">update</a>({ ...params }) -> Project</code>
19+
- <code title="get /v0/projects">client.projects.<a href="./src/resources/projects/projects.ts">list</a>({ ...params }) -> ProjectsPage</code>
1620

1721
## Branches
1822

1923
Types:
2024

2125
- <code><a href="./src/resources/projects/branches.ts">ProjectBranch</a></code>
26+
- <code><a href="./src/resources/projects/branches.ts">BranchListResponse</a></code>
27+
- <code><a href="./src/resources/projects/branches.ts">BranchDeleteResponse</a></code>
2228

2329
Methods:
2430

2531
- <code title="post /v0/projects/{project}/branches">client.projects.branches.<a href="./src/resources/projects/branches.ts">create</a>({ ...params }) -> ProjectBranch</code>
2632
- <code title="get /v0/projects/{project}/branches/{branch}">client.projects.branches.<a href="./src/resources/projects/branches.ts">retrieve</a>(branch, { ...params }) -> ProjectBranch</code>
33+
- <code title="get /v0/projects/{project}/branches">client.projects.branches.<a href="./src/resources/projects/branches.ts">list</a>({ ...params }) -> BranchListResponsesPage</code>
34+
- <code title="delete /v0/projects/{project}/branches/{branch}">client.projects.branches.<a href="./src/resources/projects/branches.ts">delete</a>(branch, { ...params }) -> unknown</code>
2735

2836
## Configs
2937

@@ -43,6 +51,7 @@ Types:
4351

4452
- <code><a href="./src/resources/builds/builds.ts">BuildObject</a></code>
4553
- <code><a href="./src/resources/builds/builds.ts">BuildTarget</a></code>
54+
- <code><a href="./src/resources/builds/builds.ts">CheckStep</a></code>
4655
- <code><a href="./src/resources/builds/builds.ts">BuildCompareResponse</a></code>
4756

4857
Methods:
@@ -56,6 +65,7 @@ Methods:
5665

5766
Types:
5867

68+
- <code><a href="./src/resources/builds/diagnostics.ts">Target</a></code>
5969
- <code><a href="./src/resources/builds/diagnostics.ts">DiagnosticListResponse</a></code>
6070

6171
Methods:
@@ -76,20 +86,10 @@ Methods:
7686

7787
Types:
7888

79-
- <code><a href="./src/resources/orgs.ts">OrgRetrieveResponse</a></code>
89+
- <code><a href="./src/resources/orgs.ts">Org</a></code>
8090
- <code><a href="./src/resources/orgs.ts">OrgListResponse</a></code>
8191

8292
Methods:
8393

84-
- <code title="get /v0/orgs/{org}">client.orgs.<a href="./src/resources/orgs.ts">retrieve</a>(org) -> OrgRetrieveResponse</code>
94+
- <code title="get /v0/orgs/{org}">client.orgs.<a href="./src/resources/orgs.ts">retrieve</a>(org) -> Org</code>
8595
- <code title="get /v0/orgs">client.orgs.<a href="./src/resources/orgs.ts">list</a>() -> OrgListResponse</code>
86-
87-
# Generate
88-
89-
Types:
90-
91-
- <code><a href="./src/resources/generate.ts">GenerateCreateSpecResponse</a></code>
92-
93-
Methods:
94-
95-
- <code title="post /v0/generate/spec">client.generate.<a href="./src/resources/generate.ts">createSpec</a>({ ...params }) -> GenerateCreateSpecResponse</code>

bin/publish-npm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ else
5858
fi
5959

6060
# Publish with the appropriate tag
61-
yarn publish --access public --tag "$TAG"
61+
yarn publish --tag "$TAG"

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stainless-api/sdk",
3-
"version": "0.1.0-alpha.11",
3+
"version": "0.1.0-alpha.12",
44
"description": "The official TypeScript library for the Stainless API",
55
"author": "Stainless <>",
66
"types": "dist/index.d.ts",
@@ -13,6 +13,9 @@
1313
"**/*"
1414
],
1515
"private": false,
16+
"publishConfig": {
17+
"access": "public"
18+
},
1619
"scripts": {
1720
"test": "./scripts/test",
1821
"build": "./scripts/build",
@@ -30,7 +33,6 @@
3033
"@swc/jest": "^0.2.29",
3134
"@types/jest": "^29.4.0",
3235
"@types/node": "^20.17.6",
33-
"typescript-eslint": "8.31.1",
3436
"@typescript-eslint/eslint-plugin": "8.31.1",
3537
"@typescript-eslint/parser": "8.31.1",
3638
"eslint": "^9.20.1",
@@ -44,11 +46,8 @@
4446
"ts-node": "^10.5.0",
4547
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.8/tsc-multi.tgz",
4648
"tsconfig-paths": "^4.0.0",
47-
"typescript": "5.8.3"
48-
},
49-
"imports": {
50-
"@stainless-api/sdk": ".",
51-
"@stainless-api/sdk/*": "./src/*"
49+
"typescript": "5.8.3",
50+
"typescript-eslint": "8.31.1"
5251
},
5352
"exports": {
5453
".": {

packages/mcp-server/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ You can run the MCP Server directly via `npx`:
2222
```sh
2323
export STAINLESS_API_KEY="My API Key"
2424
export STAINLESS_PROJECT="example-project"
25+
export STAINLESS_ENVIRONMENT="production"
2526
npx -y @stainless-api/sdk-mcp@latest
2627
```
2728

@@ -40,7 +41,8 @@ For clients with a configuration JSON, it might look something like this:
4041
"args": ["-y", "@stainless-api/sdk-mcp", "--client=claude", "--tools=all"],
4142
"env": {
4243
"STAINLESS_API_KEY": "My API Key",
43-
"STAINLESS_PROJECT": "example-project"
44+
"STAINLESS_PROJECT": "example-project",
45+
"STAINLESS_ENVIRONMENT": "production"
4446
}
4547
}
4648
}
@@ -189,6 +191,8 @@ The following tools are available in this MCP server.
189191

190192
- `create_projects_branches` (`write`): Create a new branch for a project
191193
- `retrieve_projects_branches` (`read`): Retrieve a project branch
194+
- `list_projects_branches` (`read`): List project branches
195+
- `delete_projects_branches` (`write`): Delete a project branch
192196

193197
### Resource `projects.configs`:
194198

@@ -214,7 +218,3 @@ The following tools are available in this MCP server.
214218

215219
- `retrieve_orgs` (`read`): Retrieve an organization by name
216220
- `list_orgs` (`read`): List organizations the user has access to
217-
218-
### Resource `generate`:
219-
220-
- `create_spec_generate` (`write`):

packages/mcp-server/package.json

Lines changed: 4 additions & 1 deletion
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.11",
3+
"version": "0.1.0-alpha.12",
44
"description": "The official MCP Server for the Stainless API",
55
"author": "Stainless <>",
66
"types": "dist/index.d.ts",
@@ -29,6 +29,8 @@
2929
"dependencies": {
3030
"@stainless-api/sdk": "file:../../dist/",
3131
"@modelcontextprotocol/sdk": "^1.11.5",
32+
"express": "^5.1.0",
33+
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz",
3234
"yargs": "^17.7.2",
3335
"@cloudflare/cabidela": "^0.2.4",
3436
"zod": "^3.25.20",
@@ -39,6 +41,7 @@
3941
},
4042
"devDependencies": {
4143
"@types/jest": "^29.4.0",
44+
"@types/express": "^5.0.3",
4245
"@typescript-eslint/eslint-plugin": "8.31.1",
4346
"@typescript-eslint/parser": "8.31.1",
4447
"eslint": "^8.49.0",

packages/mcp-server/src/compat.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ export function parseEmbeddedJSON(args: Record<string, unknown>, schema: Record<
7070
if (typeof value === 'string') {
7171
try {
7272
const parsed = JSON.parse(value);
73-
newArgs[key] = parsed;
74-
updated = true;
73+
// Only parse if result is a plain object (not array, null, or primitive)
74+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
75+
newArgs[key] = parsed;
76+
updated = true;
77+
}
7578
} catch (e) {
7679
// Not valid JSON, leave as is
7780
}

0 commit comments

Comments
 (0)