Skip to content

Commit bcb31d6

Browse files
release: 9.3.0 (#647)
* fix(api): remove invalid transform config * feat(api): api update * chore(internal): codegen related update * chore(ci): skip uploading artifacts on stainless-internal branches * fix(client): preserve URL params already embedded in path * chore(mcp-server): improve instructions * chore(internal): update dependencies to address dependabot vulnerabilities * release: 9.3.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent e8a5783 commit bcb31d6

File tree

26 files changed

+298
-116
lines changed

26 files changed

+298
-116
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,28 @@ jobs:
5555
run: ./scripts/build
5656

5757
- name: Get GitHub OIDC Token
58-
if: github.repository == 'stainless-sdks/finch-typescript'
58+
if: |-
59+
github.repository == 'stainless-sdks/finch-typescript' &&
60+
!startsWith(github.ref, 'refs/heads/stl/')
5961
id: github-oidc
6062
uses: actions/github-script@v8
6163
with:
6264
script: core.setOutput('github_token', await core.getIDToken());
6365

6466
- name: Upload tarball
65-
if: github.repository == 'stainless-sdks/finch-typescript'
67+
if: |-
68+
github.repository == 'stainless-sdks/finch-typescript' &&
69+
!startsWith(github.ref, 'refs/heads/stl/')
6670
env:
6771
URL: https://pkg.stainless.com/s
6872
AUTH: ${{ steps.github-oidc.outputs.github_token }}
6973
SHA: ${{ github.sha }}
7074
run: ./scripts/utils/upload-artifact.sh
7175

7276
- name: Upload MCP Server tarball
73-
if: github.repository == 'stainless-sdks/finch-typescript'
77+
if: |-
78+
github.repository == 'stainless-sdks/finch-typescript' &&
79+
!startsWith(github.ref, 'refs/heads/stl/')
7480
env:
7581
URL: https://pkg.stainless.com/s?subpackage=mcp-server
7682
AUTH: ${{ steps.github-oidc.outputs.github_token }}

.release-please-manifest.json

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

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-46f433f34d440aa1dfcc48cc8d822c598571b68be2f723ec99e1b4fba6c13b1e.yml
3-
openapi_spec_hash: 5b5cd728776723ac773900f7e8a32c05
4-
config_hash: ccdf6a5b4aaa2a0897c89ac8685d8eb0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-093ade6f1d3115b654a73b97855fbe334c9f9c5d906081dad2ec973ab0c0b24d.yml
3+
openapi_spec_hash: 7cc27b8e483d9db9c411875289c42eb9
4+
config_hash: d21a244fc073152c8dbecb8ece970209

CHANGELOG.md

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

3+
## 9.3.0 (2026-03-10)
4+
5+
Full Changelog: [v9.2.0...v9.3.0](https://github.com/Finch-API/finch-api-node/compare/v9.2.0...v9.3.0)
6+
7+
### Features
8+
9+
* **api:** api update ([fa2b60a](https://github.com/Finch-API/finch-api-node/commit/fa2b60a267e9da0df1f8d884ffb47f4d5757f502))
10+
11+
12+
### Bug Fixes
13+
14+
* **api:** remove invalid transform config ([325973d](https://github.com/Finch-API/finch-api-node/commit/325973dd45c7ec667d8e8b061025b07ef0a43571))
15+
* **client:** preserve URL params already embedded in path ([0e6e60b](https://github.com/Finch-API/finch-api-node/commit/0e6e60b12695f3f939e68ed532df8635514e8a28))
16+
17+
18+
### Chores
19+
20+
* **ci:** skip uploading artifacts on stainless-internal branches ([73749d6](https://github.com/Finch-API/finch-api-node/commit/73749d6fa0efd3bc663806c129b97d550d2f5173))
21+
* **internal:** codegen related update ([c3b5362](https://github.com/Finch-API/finch-api-node/commit/c3b536242683da322c746ec84036f5e5f5b4dff9))
22+
* **internal:** update dependencies to address dependabot vulnerabilities ([a4b3eac](https://github.com/Finch-API/finch-api-node/commit/a4b3eac445d4796c00f782a10e2fc74a1eb56624))
23+
* **mcp-server:** improve instructions ([3240242](https://github.com/Finch-API/finch-api-node/commit/32402420f11116f77ceddff72ff66a93573da557))
24+
325
## 9.2.0 (2026-02-26)
426

527
Full Changelog: [v9.1.1...v9.2.0](https://github.com/Finch-API/finch-api-node/compare/v9.1.1...v9.2.0)

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tryfinch/finch-api",
3-
"version": "9.2.0",
3+
"version": "9.3.0",
44
"description": "The official TypeScript library for the Finch API",
55
"author": "Finch <founders@tryfinch.com>",
66
"types": "dist/index.d.ts",
@@ -55,6 +55,17 @@
5555
"bin": {
5656
"tryfinch-finch-api": "bin/cli"
5757
},
58+
"overrides": {
59+
"minimatch": "^9.0.5"
60+
},
61+
"pnpm": {
62+
"overrides": {
63+
"minimatch": "^9.0.5"
64+
}
65+
},
66+
"resolutions": {
67+
"minimatch": "^9.0.5"
68+
},
5869
"exports": {
5970
".": {
6071
"import": "./dist/index.mjs",

packages/mcp-server/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dxt_version": "0.2",
33
"name": "@tryfinch/finch-api-mcp",
4-
"version": "9.2.0",
4+
"version": "9.3.0",
55
"description": "The official MCP Server for the Finch API",
66
"author": {
77
"name": "Finch",

packages/mcp-server/package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tryfinch/finch-api-mcp",
3-
"version": "9.2.0",
3+
"version": "9.3.0",
44
"description": "The official MCP Server for the Finch API",
55
"author": "Finch <founders@tryfinch.com>",
66
"types": "dist/index.d.ts",
@@ -26,21 +26,25 @@
2626
"format": "prettier --write --cache --cache-strategy metadata . !dist",
2727
"prepare": "npm run build",
2828
"tsn": "ts-node -r tsconfig-paths/register",
29-
"lint": "eslint --ext ts,js .",
30-
"fix": "eslint --fix --ext ts,js ."
29+
"lint": "eslint .",
30+
"fix": "eslint --fix ."
3131
},
3232
"dependencies": {
3333
"@tryfinch/finch-api": "file:../../dist/",
34+
"ajv": "^8.18.0",
3435
"@cloudflare/cabidela": "^0.2.4",
35-
"@modelcontextprotocol/sdk": "^1.26.0",
36+
"@hono/node-server": "^1.19.10",
37+
"@modelcontextprotocol/sdk": "^1.27.1",
38+
"hono": "^4.12.4",
3639
"@valtown/deno-http-worker": "^0.0.21",
3740
"cookie-parser": "^1.4.6",
3841
"cors": "^2.8.5",
3942
"express": "^5.1.0",
4043
"fuse.js": "^7.1.0",
4144
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
42-
"morgan": "^1.10.0",
43-
"morgan-body": "^2.6.9",
45+
"pino": "^10.3.1",
46+
"pino-http": "^11.0.0",
47+
"pino-pretty": "^13.1.3",
4448
"qs": "^6.14.1",
4549
"typescript": "5.8.3",
4650
"yargs": "^17.7.2",
@@ -57,14 +61,13 @@
5761
"@types/cors": "^2.8.19",
5862
"@types/express": "^5.0.3",
5963
"@types/jest": "^29.4.0",
60-
"@types/morgan": "^1.9.10",
6164
"@types/qs": "^6.14.0",
6265
"@types/yargs": "^17.0.8",
6366
"@typescript-eslint/eslint-plugin": "8.31.1",
6467
"@typescript-eslint/parser": "8.31.1",
65-
"eslint": "^8.49.0",
66-
"eslint-plugin-prettier": "^5.0.1",
67-
"eslint-plugin-unused-imports": "^3.0.0",
68+
"eslint": "^9.39.1",
69+
"eslint-plugin-prettier": "^5.4.1",
70+
"eslint-plugin-unused-imports": "^4.1.4",
6871
"jest": "^29.4.0",
6972
"prettier": "^3.0.0",
7073
"ts-jest": "^29.1.0",

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

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ import {
1717
import { Tool } from '@modelcontextprotocol/sdk/types.js';
1818
import { readEnv } from './util';
1919
import { WorkerInput, WorkerOutput } from './code-tool-types';
20+
import { getLogger } from './logger';
2021
import { SdkMethod } from './methods';
2122
import { McpCodeExecutionMode } from './options';
2223
import { ClientOptions } from '@tryfinch/finch-api';
2324

2425
const prompt = `Runs JavaScript code to interact with the Finch API.
2526
26-
You are a skilled programmer writing code to interface with the service.
27+
You are a skilled TypeScript programmer writing code to interface with the service.
2728
Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
2829
For example:
2930
@@ -40,7 +41,9 @@ You will be returned anything that your function returns, plus the results of an
4041
Do not add try-catch blocks for single API calls. The tool will handle errors for you.
4142
Do not add comments unless necessary for generating better code.
4243
Code will run in a container, and cannot interact with the network outside of the given SDK client.
43-
Variables will not persist between calls, so make sure to return or log any data you might need later.`;
44+
Variables will not persist between calls, so make sure to return or log any data you might need later.
45+
Remember that you are writing TypeScript code, so you need to be careful with your types.
46+
Always type dynamic key-value stores explicitly as Record<string, YourValueType> instead of {}.`;
4447

4548
/**
4649
* A tool that runs code against a copy of the SDK.
@@ -82,6 +85,8 @@ export function codeTool({
8285
},
8386
};
8487

88+
const logger = getLogger();
89+
8590
const handler = async ({
8691
reqContext,
8792
args,
@@ -106,11 +111,27 @@ export function codeTool({
106111
}
107112
}
108113

114+
let result: ToolCallResult;
115+
const startTime = Date.now();
116+
109117
if (codeExecutionMode === 'local') {
110-
return await localDenoHandler({ reqContext, args });
118+
logger.debug('Executing code in local Deno environment');
119+
result = await localDenoHandler({ reqContext, args });
111120
} else {
112-
return await remoteStainlessHandler({ reqContext, args });
121+
logger.debug('Executing code in remote Stainless environment');
122+
result = await remoteStainlessHandler({ reqContext, args });
113123
}
124+
125+
logger.info(
126+
{
127+
codeExecutionMode,
128+
durationMs: Date.now() - startTime,
129+
isError: result.isError,
130+
contentRows: result.content?.length ?? 0,
131+
},
132+
'Got code tool execution result',
133+
);
134+
return result;
114135
};
115136

116137
return { metadata, tool, handler };
@@ -135,7 +156,7 @@ const remoteStainlessHandler = async ({
135156
headers: {
136157
...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }),
137158
'Content-Type': 'application/json',
138-
client_envs: JSON.stringify({
159+
'x-stainless-mcp-client-envs': JSON.stringify({
139160
FINCH_CLIENT_ID: readEnv('FINCH_CLIENT_ID') ?? client.clientID ?? undefined,
140161
FINCH_CLIENT_SECRET: readEnv('FINCH_CLIENT_SECRET') ?? client.clientSecret ?? undefined,
141162
FINCH_WEBHOOK_SECRET: readEnv('FINCH_WEBHOOK_SECRET') ?? client.webhookSecret ?? undefined,
@@ -151,6 +172,11 @@ const remoteStainlessHandler = async ({
151172
});
152173

153174
if (!res.ok) {
175+
if (res.status === 404 && !reqContext.stainlessApiKey) {
176+
throw new Error(
177+
'Could not access code tool for this project. You may need to provide a Stainless API key via the STAINLESS_API_KEY environment variable, the --stainless-api-key flag, or the x-stainless-api-key HTTP header.',
178+
);
179+
}
154180
throw new Error(
155181
`${res.status}: ${
156182
res.statusText

packages/mcp-server/src/docs-search-tool.ts

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import { Metadata, McpRequestContext, asTextContentResult } from './types';
43
import { Tool } from '@modelcontextprotocol/sdk/types.js';
4+
import { Metadata, McpRequestContext, asTextContentResult } from './types';
5+
import { getLogger } from './logger';
56

67
export const metadata: Metadata = {
78
resource: 'all',
@@ -12,7 +13,8 @@ export const metadata: Metadata = {
1213

1314
export const tool: Tool = {
1415
name: 'search_docs',
15-
description: 'Search for documentation for how to use the client to interact with the API.',
16+
description:
17+
'Search SDK documentation to find methods, parameters, and usage examples for interacting with the API. Use this before writing code when you need to discover the right approach.',
1618
inputSchema: {
1719
type: 'object',
1820
properties: {
@@ -50,19 +52,49 @@ export const handler = async ({
5052
}) => {
5153
const body = args as any;
5254
const query = new URLSearchParams(body).toString();
55+
56+
const startTime = Date.now();
5357
const result = await fetch(`${docsSearchURL}?${query}`, {
5458
headers: {
5559
...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }),
5660
},
5761
});
5862

63+
const logger = getLogger();
64+
5965
if (!result.ok) {
66+
const errorText = await result.text();
67+
logger.warn(
68+
{
69+
durationMs: Date.now() - startTime,
70+
query: body.query,
71+
status: result.status,
72+
statusText: result.statusText,
73+
errorText,
74+
},
75+
'Got error response from docs search tool',
76+
);
77+
78+
if (result.status === 404 && !reqContext.stainlessApiKey) {
79+
throw new Error(
80+
'Could not find docs for this project. You may need to provide a Stainless API key via the STAINLESS_API_KEY environment variable, the --stainless-api-key flag, or the x-stainless-api-key HTTP header.',
81+
);
82+
}
83+
6084
throw new Error(
61-
`${result.status}: ${result.statusText} when using doc search tool. Details: ${await result.text()}`,
85+
`${result.status}: ${result.statusText} when using doc search tool. Details: ${errorText}`,
6286
);
6387
}
6488

65-
return asTextContentResult(await result.json());
89+
const resultBody = await result.json();
90+
logger.info(
91+
{
92+
durationMs: Date.now() - startTime,
93+
query: body.query,
94+
},
95+
'Got docs search result',
96+
);
97+
return asTextContentResult(resultBody);
6698
};
6799

68100
export default { metadata, tool, handler };

0 commit comments

Comments
 (0)