Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
76cc049
chore(internal): update dependencies to address dependabot vulnerabil…
stainless-app[bot] Mar 10, 2026
003b4db
chore(internal): bump @modelcontextprotocol/sdk, @hono/node-server, a…
stainless-app[bot] Mar 12, 2026
954b319
chore(internal): make generated MCP servers compatible with Cloudflar…
stainless-app[bot] Mar 14, 2026
7e94c06
chore(internal): support x-stainless-mcp-client-envs header in MCP se…
stainless-app[bot] Mar 14, 2026
c41604c
chore(internal): tweak CI branches
stainless-app[bot] Mar 17, 2026
8a89be6
chore(internal): support x-stainless-mcp-client-permissions headers i…
stainless-app[bot] Mar 17, 2026
4946281
chore(internal): update gitignore
stainless-app[bot] Mar 24, 2026
7801653
chore(internal): fix MCP server TS errors that occur with required cl…
stainless-app[bot] Mar 24, 2026
a11ee3a
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 25, 2026
22d4962
chore(internal): support custom-instructions-path flag in MCP servers
stainless-app[bot] Mar 27, 2026
f36982d
chore(internal): codegen related update
stainless-app[bot] Mar 28, 2026
525f106
chore(internal): support local docs search in MCP servers
stainless-app[bot] Mar 28, 2026
87b3e28
chore(ci): escape input path in publish-npm workflow
stainless-app[bot] Mar 28, 2026
c1d2de2
feat(api): api update
stainless-app[bot] Mar 30, 2026
a5f0540
chore(mcp-server): add support for session id, forward client info
stainless-app[bot] Mar 31, 2026
dee7e64
chore(internal): improve local docs search for MCP servers
stainless-app[bot] Mar 31, 2026
c2f664b
codegen metadata
stainless-app[bot] Mar 31, 2026
6f05d28
chore(internal): improve local docs search for MCP servers
stainless-app[bot] Apr 1, 2026
20a84fe
fix(internal): gitignore generated `oidc` dir
stainless-app[bot] Apr 1, 2026
80d4290
chore(internal): support type annotations when running MCP in local e…
stainless-app[bot] Apr 2, 2026
fba6e9e
release: 0.14.0
stainless-app[bot] Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -17,7 +19,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/fashn-sdk-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6

Expand All @@ -36,7 +38,7 @@ jobs:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/fashn-sdk-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
permissions:
contents: read
id-token: write
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ jobs:

- name: Publish to NPM
run: |
if [ -n "${{ github.event.inputs.path }}" ]; then
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
if [ -n "$INPUT_PATH" ]; then
PATHS_RELEASED="[\"$INPUT_PATH\"]"
else
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
fi
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
env:
INPUT_PATH: ${{ github.event.inputs.path }}

- name: Upload MCP Server DXT GitHub release asset
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
node_modules
yarn-error.log
codegen.log
Expand All @@ -10,3 +11,4 @@ dist-deno
.eslintcache
dist-bundle
*.mcpb
oidc
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.13.0"
".": "0.14.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 2
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/fashn%2Ffashn-sdk-c1aad2cbe1916bd03657c1367803b8a99ea78014866aeea471fc7465b4325032.yml
openapi_spec_hash: e798e6979266d63c7bbcb9ad3c14d633
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/fashn%2Ffashn-sdk-bce0e6c4dfce389c1bfafe9f37e5355f7c04377511d8a602b044bdf4074a421b.yml
openapi_spec_hash: 6469ac566c9e5abd890668e97aeebf1b
config_hash: 6f35cc512a77534117eeac956e613816
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## 0.14.0 (2026-04-02)

Full Changelog: [v0.13.0...v0.14.0](https://github.com/fashn-AI/fashn-typescript-sdk/compare/v0.13.0...v0.14.0)

### Features

* **api:** api update ([c1d2de2](https://github.com/fashn-AI/fashn-typescript-sdk/commit/c1d2de2661f2ec7f7003dcd04e0a6e3559504ab7))


### Bug Fixes

* **internal:** gitignore generated `oidc` dir ([20a84fe](https://github.com/fashn-AI/fashn-typescript-sdk/commit/20a84fed4bf9063a883378f15e42a1593eea47a5))


### Chores

* **ci:** escape input path in publish-npm workflow ([87b3e28](https://github.com/fashn-AI/fashn-typescript-sdk/commit/87b3e285269a09b33655ac1dfc0ee7ef28104b6a))
* **ci:** skip lint on metadata-only changes ([a11ee3a](https://github.com/fashn-AI/fashn-typescript-sdk/commit/a11ee3a1b13f15308a3d41bd3fe04e516b5e9704))
* **internal:** bump @modelcontextprotocol/sdk, @hono/node-server, and minimatch ([003b4db](https://github.com/fashn-AI/fashn-typescript-sdk/commit/003b4db8eb8f21efa2576ec3f4ffeaa5611e16c5))
* **internal:** codegen related update ([f36982d](https://github.com/fashn-AI/fashn-typescript-sdk/commit/f36982d698013fca5f606ca16c8175ebde5f8ae2))
* **internal:** fix MCP server TS errors that occur with required client options ([7801653](https://github.com/fashn-AI/fashn-typescript-sdk/commit/780165379e43287465336902be1db3b60316627b))
* **internal:** improve local docs search for MCP servers ([6f05d28](https://github.com/fashn-AI/fashn-typescript-sdk/commit/6f05d28f0adf9641d231589dd113983aaff64259))
* **internal:** improve local docs search for MCP servers ([dee7e64](https://github.com/fashn-AI/fashn-typescript-sdk/commit/dee7e644a50d810ec342037209dc9cdaa911ac88))
* **internal:** make generated MCP servers compatible with Cloudflare worker environments ([954b319](https://github.com/fashn-AI/fashn-typescript-sdk/commit/954b31937721eaa6fcf41a2bf80babfaca1ca18a))
* **internal:** support custom-instructions-path flag in MCP servers ([22d4962](https://github.com/fashn-AI/fashn-typescript-sdk/commit/22d4962aa9462e5d6a8b4b128857e2a55d34d043))
* **internal:** support local docs search in MCP servers ([525f106](https://github.com/fashn-AI/fashn-typescript-sdk/commit/525f106e4967b2cfef564b955549d10590255804))
* **internal:** support type annotations when running MCP in local execution mode ([80d4290](https://github.com/fashn-AI/fashn-typescript-sdk/commit/80d4290b4400b082c38b7d2bfff628df6649e894))
* **internal:** support x-stainless-mcp-client-envs header in MCP servers ([7e94c06](https://github.com/fashn-AI/fashn-typescript-sdk/commit/7e94c062f4c52dd0ad50ef930fc6a58a2c9dfc3d))
* **internal:** support x-stainless-mcp-client-permissions headers in MCP servers ([8a89be6](https://github.com/fashn-AI/fashn-typescript-sdk/commit/8a89be6761c35abb106dcfcf4ef54d71bb71d50d))
* **internal:** tweak CI branches ([c41604c](https://github.com/fashn-AI/fashn-typescript-sdk/commit/c41604c0c2ed791573e30ae681e58412b2e6c72d))
* **internal:** update dependencies to address dependabot vulnerabilities ([76cc049](https://github.com/fashn-AI/fashn-typescript-sdk/commit/76cc04944bbdeeb6d67645e2e888b8b229af31e1))
* **internal:** update gitignore ([4946281](https://github.com/fashn-AI/fashn-typescript-sdk/commit/4946281612ac223eec1130fa7714ca95b7f8a7e5))
* **mcp-server:** add support for session id, forward client info ([a5f0540](https://github.com/fashn-AI/fashn-typescript-sdk/commit/a5f0540527e93916e96621e71473c9faffc0541c))

## 0.13.0 (2026-03-09)

Full Changelog: [v0.12.0...v0.13.0](https://github.com/fashn-AI/fashn-typescript-sdk/compare/v0.12.0...v0.13.0)
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ const client = new Fashn({

const response = await client.predictions.subscribe({
inputs: {
garment_image: 'https://example.com/garment.jpg',
model_image: 'https://example.com/model.jpg',
product_image: 'https://example.com/garment.jpg',
},
model_name: 'tryon-v1.6',
model_name: 'tryon-max',
});

console.log(response.output);
Expand All @@ -68,10 +68,10 @@ const client = new Fashn({

const params: Fashn.PredictionSubscribeParams = {
inputs: {
garment_image: 'https://example.com/garment.jpg',
model_image: 'https://example.com/model.jpg',
product_image: 'https://example.com/garment.jpg',
},
model_name: 'tryon-v1.6',
model_name: 'tryon-max',
};
const response: Fashn.PredictionSubscribeResponse = await client.predictions.subscribe(params);
```
Expand All @@ -89,10 +89,10 @@ a subclass of `APIError` will be thrown:
const response = await client.predictions
.subscribe({
inputs: {
garment_image: 'https://example.com/garment.jpg',
model_image: 'https://example.com/model.jpg',
product_image: 'https://example.com/garment.jpg',
},
model_name: 'tryon-v1.6',
model_name: 'tryon-max',
})
.catch(async (err) => {
if (err instanceof Fashn.APIError) {
Expand Down Expand Up @@ -135,8 +135,8 @@ const client = new Fashn({

// Or, configure per-request:
await client.predictions.run({
inputs: { garment_image: 'https://example.com/garment.jpg', model_image: 'https://example.com/model.jpg' },
model_name: 'tryon-v1.6',
inputs: { model_image: 'https://example.com/model.jpg', product_image: 'https://example.com/garment.jpg' },
model_name: 'tryon-max',
}, {
maxRetries: 5,
});
Expand All @@ -155,8 +155,8 @@ const client = new Fashn({

// Override per-request:
await client.predictions.run({
inputs: { garment_image: 'https://example.com/garment.jpg', model_image: 'https://example.com/model.jpg' },
model_name: 'tryon-v1.6',
inputs: { model_image: 'https://example.com/model.jpg', product_image: 'https://example.com/garment.jpg' },
model_name: 'tryon-max',
}, {
timeout: 5 * 1000,
});
Expand All @@ -183,10 +183,10 @@ const client = new Fashn();
const response = await client.predictions
.run({
inputs: {
garment_image: 'https://example.com/garment.jpg',
model_image: 'https://example.com/model.jpg',
product_image: 'https://example.com/garment.jpg',
},
model_name: 'tryon-v1.6',
model_name: 'tryon-max',
})
.asResponse();
console.log(response.headers.get('X-My-Header'));
Expand All @@ -195,10 +195,10 @@ console.log(response.statusText); // access the underlying Response object
const { data: response, response: raw } = await client.predictions
.run({
inputs: {
garment_image: 'https://example.com/garment.jpg',
model_image: 'https://example.com/model.jpg',
product_image: 'https://example.com/garment.jpg',
},
model_name: 'tryon-v1.6',
model_name: 'tryon-max',
})
.withResponse();
console.log(raw.headers.get('X-My-Header'));
Expand Down
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fashn",
"version": "0.13.0",
"version": "0.14.0",
"description": "The official TypeScript library for the Fashn API",
"author": "Fashn <>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -50,6 +50,17 @@
"typescript": "5.8.3",
"typescript-eslint": "8.31.1"
},
"overrides": {
"minimatch": "^9.0.5"
},
"pnpm": {
"overrides": {
"minimatch": "^9.0.5"
}
},
"resolutions": {
"minimatch": "^9.0.5"
},
"exports": {
".": {
"import": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "fashn-mcp",
"version": "0.13.0",
"version": "0.14.0",
"description": "The official MCP Server for the Fashn API",
"author": {
"name": "Fashn"
Expand Down
18 changes: 11 additions & 7 deletions packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fashn-mcp",
"version": "0.13.0",
"version": "0.14.0",
"description": "The official MCP Server for the Fashn API",
"author": "Fashn <>",
"types": "dist/index.d.ts",
Expand All @@ -26,18 +26,22 @@
"format": "prettier --write --cache --cache-strategy metadata . !dist",
"prepare": "npm run build",
"tsn": "ts-node -r tsconfig-paths/register",
"lint": "eslint --ext ts,js .",
"fix": "eslint --fix --ext ts,js ."
"lint": "eslint .",
"fix": "eslint --fix ."
},
"dependencies": {
"fashn": "file:../../dist/",
"ajv": "^8.18.0",
"@cloudflare/cabidela": "^0.2.4",
"@modelcontextprotocol/sdk": "^1.26.0",
"@hono/node-server": "^1.19.10",
"@modelcontextprotocol/sdk": "^1.27.1",
"hono": "^4.12.4",
"@valtown/deno-http-worker": "^0.0.21",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"express": "^5.1.0",
"fuse.js": "^7.1.0",
"minisearch": "^7.2.0",
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
"pino": "^10.3.1",
"pino-http": "^11.0.0",
Expand All @@ -62,9 +66,9 @@
"@types/yargs": "^17.0.8",
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^8.49.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-unused-imports": "^3.0.0",
"eslint": "^9.39.1",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
"jest": "^29.4.0",
"prettier": "^3.0.0",
"ts-jest": "^29.1.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/mcp-server/src/code-tool-paths.cts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export const workerPath = require.resolve('./code-tool-worker.mjs');
export function getWorkerPath(): string {
return require.resolve('./code-tool-worker.mjs');
}
12 changes: 10 additions & 2 deletions packages/mcp-server/src/code-tool-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import ts from 'typescript';
import { WorkerOutput } from './code-tool-types';
import { Fashn, ClientOptions } from 'fashn';

async function tseval(code: string) {
return import('data:application/typescript;charset=utf-8;base64,' + Buffer.from(code).toString('base64'));
}

function getRunFunctionSource(code: string): {
type: 'declaration' | 'expression';
client: string | undefined;
Expand Down Expand Up @@ -235,7 +239,9 @@ const fetch = async (req: Request): Promise<Response> => {

const log_lines: string[] = [];
const err_lines: string[] = [];
const console = {
const originalConsole = globalThis.console;
globalThis.console = {
...originalConsole,
log: (...args: unknown[]) => {
log_lines.push(util.format(...args));
},
Expand All @@ -245,7 +251,7 @@ const fetch = async (req: Request): Promise<Response> => {
};
try {
let run_ = async (client: any) => {};
eval(`${code}\nrun_ = run;`);
run_ = (await tseval(`${code}\nexport default run;`)).default;
const result = await run_(makeSdkProxy(client, { path: ['client'] }));
return Response.json({
is_error: false,
Expand All @@ -263,6 +269,8 @@ const fetch = async (req: Request): Promise<Response> => {
} satisfies WorkerOutput,
{ status: 400, statusText: 'Code execution error' },
);
} finally {
globalThis.console = originalConsole;
}
};

Expand Down
Loading
Loading