Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,28 @@ jobs:
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/isaacus-typescript'
if: |-
github.repository == 'stainless-sdks/isaacus-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/isaacus-typescript'
if: |-
github.repository == 'stainless-sdks/isaacus-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh

- name: Upload MCP Server tarball
if: github.repository == 'stainless-sdks/isaacus-typescript'
if: |-
github.repository == 'stainless-sdks/isaacus-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s?subpackage=mcp-server
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand Down
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.21.0"
".": "0.22.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: 5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-baf5ebdd05d1b5192759a356c2701131c47cfb5b7239a49fcb94e68d4210648c.yml
openapi_spec_hash: 6ea786d56726e18156adf57915fcbe5f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-3fc0da1b03c07a47ee0a04ff61443710b99e6d24e8ba5986aab0b1c023c6f0d5.yml
openapi_spec_hash: 5992dd036e090cc43fa15ea5ff985f77
config_hash: 9040e7359f066240ad536041fb2c5185
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 0.22.0 (2026-03-11)

Full Changelog: [v0.21.0...v0.22.0](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.21.0...v0.22.0)

### Features

* **api:** add kanon-2-reranker ([6874725](https://github.com/isaacus-dev/isaacus-typescript/commit/68747257c2b6c34baa76d78e9c889d240189a83b))
* **api:** drop mini models ([f08dc45](https://github.com/isaacus-dev/isaacus-typescript/commit/f08dc4595a60ced58c376960be99d73cfcf1658c))


### Bug Fixes

* **client:** preserve URL params already embedded in path ([2acb447](https://github.com/isaacus-dev/isaacus-typescript/commit/2acb447b0308ed21983f1c8d665016e8bcf802a4))


### Chores

* **ci:** skip uploading artifacts on stainless-internal branches ([ade18ff](https://github.com/isaacus-dev/isaacus-typescript/commit/ade18ffd5cf57d9c38e54665cf418dc54a56fd3c))
* **internal:** codegen related update ([77a4e10](https://github.com/isaacus-dev/isaacus-typescript/commit/77a4e109763c99585dacdc0e5786f8bf214f173e))
* **internal:** codegen related update ([61d1a70](https://github.com/isaacus-dev/isaacus-typescript/commit/61d1a70e6af2ff3c1c0f16517bca200f162cf9c1))
* **internal:** update dependencies to address dependabot vulnerabilities ([625f523](https://github.com/isaacus-dev/isaacus-typescript/commit/625f523f36e1935b253dc3b7258b2f8e5cd866fd))
* **internal:** use x-stainless-mcp-client-envs header for MCP remote code tool calls ([e372066](https://github.com/isaacus-dev/isaacus-typescript/commit/e372066ae02d0ffcf5fae210ba027c9b13950141))
* **mcp-server:** improve instructions ([381ce99](https://github.com/isaacus-dev/isaacus-typescript/commit/381ce99950e4220f5c7ca5f20faabcdc5252ec8a))
* **mcp-server:** return access instructions for 404 without API key ([8d188e6](https://github.com/isaacus-dev/isaacus-typescript/commit/8d188e6a165648c20580f15c5f4ce8febc7acab1))


### Documentation

* **api:** reworded descriptions ([d3924ec](https://github.com/isaacus-dev/isaacus-typescript/commit/d3924ec55f712b7df79847049c7f6e4ea07352a2))

## 0.21.0 (2026-03-03)

Full Changelog: [v0.20.2...v0.21.0](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.20.2...v0.21.0)
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": "isaacus",
"version": "0.21.0",
"version": "0.22.0",
"description": "The official TypeScript library for the Isaacus API",
"author": "Isaacus <support@isaacus.com>",
"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": "isaacus-mcp",
"version": "0.21.0",
"version": "0.22.0",
"description": "The official MCP Server for the Isaacus API",
"author": {
"name": "Isaacus",
Expand Down
23 changes: 13 additions & 10 deletions packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isaacus-mcp",
"version": "0.21.0",
"version": "0.22.0",
"description": "The official MCP Server for the Isaacus API",
"author": "Isaacus <support@isaacus.com>",
"types": "dist/index.d.ts",
Expand All @@ -26,21 +26,25 @@
"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": {
"isaacus": "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",
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
"morgan": "^1.10.0",
"morgan-body": "^2.6.9",
"pino": "^10.3.1",
"pino-http": "^11.0.0",
"pino-pretty": "^13.1.3",
"qs": "^6.14.1",
"typescript": "5.8.3",
"yargs": "^17.7.2",
Expand All @@ -57,14 +61,13 @@
"@types/cors": "^2.8.19",
"@types/express": "^5.0.3",
"@types/jest": "^29.4.0",
"@types/morgan": "^1.9.10",
"@types/qs": "^6.14.0",
"@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
30 changes: 27 additions & 3 deletions packages/mcp-server/src/code-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { readEnv, requireValue } from './util';
import { WorkerInput, WorkerOutput } from './code-tool-types';
import { getLogger } from './logger';
import { SdkMethod } from './methods';
import { McpCodeExecutionMode } from './options';
import { ClientOptions } from 'isaacus';
Expand Down Expand Up @@ -87,6 +88,8 @@ export function codeTool({
},
};

const logger = getLogger();

const handler = async ({
reqContext,
args,
Expand All @@ -111,11 +114,27 @@ export function codeTool({
}
}

let result: ToolCallResult;
const startTime = Date.now();

if (codeExecutionMode === 'local') {
return await localDenoHandler({ reqContext, args });
logger.debug('Executing code in local Deno environment');
result = await localDenoHandler({ reqContext, args });
} else {
return await remoteStainlessHandler({ reqContext, args });
logger.debug('Executing code in remote Stainless environment');
result = await remoteStainlessHandler({ reqContext, args });
}

logger.info(
{
codeExecutionMode,
durationMs: Date.now() - startTime,
isError: result.isError,
contentRows: result.content?.length ?? 0,
},
'Got code tool execution result',
);
return result;
};

return { metadata, tool, handler };
Expand All @@ -140,7 +159,7 @@ const remoteStainlessHandler = async ({
headers: {
...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }),
'Content-Type': 'application/json',
client_envs: JSON.stringify({
'x-stainless-mcp-client-envs': JSON.stringify({
ISAACUS_API_KEY: requireValue(
readEnv('ISAACUS_API_KEY') ?? client.apiKey,
'set ISAACUS_API_KEY environment variable or provide apiKey client option',
Expand All @@ -157,6 +176,11 @@ const remoteStainlessHandler = async ({
});

if (!res.ok) {
if (res.status === 404 && !reqContext.stainlessApiKey) {
throw new Error(
'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.',
);
}
throw new Error(
`${res.status}: ${
res.statusText
Expand Down
40 changes: 36 additions & 4 deletions packages/mcp-server/src/docs-search-tool.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { Metadata, McpRequestContext, asTextContentResult } from './types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { Metadata, McpRequestContext, asTextContentResult } from './types';
import { getLogger } from './logger';

export const metadata: Metadata = {
resource: 'all',
Expand All @@ -12,7 +13,8 @@ export const metadata: Metadata = {

export const tool: Tool = {
name: 'search_docs',
description: 'Search for documentation for how to use the client to interact with the API.',
description:
'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.',
inputSchema: {
type: 'object',
properties: {
Expand Down Expand Up @@ -50,19 +52,49 @@ export const handler = async ({
}) => {
const body = args as any;
const query = new URLSearchParams(body).toString();

const startTime = Date.now();
const result = await fetch(`${docsSearchURL}?${query}`, {
headers: {
...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }),
},
});

const logger = getLogger();

if (!result.ok) {
const errorText = await result.text();
logger.warn(
{
durationMs: Date.now() - startTime,
query: body.query,
status: result.status,
statusText: result.statusText,
errorText,
},
'Got error response from docs search tool',
);

if (result.status === 404 && !reqContext.stainlessApiKey) {
throw new Error(
'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.',
);
}

throw new Error(
`${result.status}: ${result.statusText} when using doc search tool. Details: ${await result.text()}`,
`${result.status}: ${result.statusText} when using doc search tool. Details: ${errorText}`,
);
}

return asTextContentResult(await result.json());
const resultBody = await result.json();
logger.info(
{
durationMs: Date.now() - startTime,
query: body.query,
},
'Got docs search result',
);
return asTextContentResult(resultBody);
};

export default { metadata, tool, handler };
Loading
Loading