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
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"postCreateCommand": "yarn install",
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode"
]
"extensions": ["esbenp.prettier-vscode"]
}
}
}
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -40,13 +40,13 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Check build
run: ./scripts/build-all
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/isaacus-typescript'
Expand All @@ -72,7 +72,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'

- name: Install dependencies
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ jobs:
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.ISAACUS_NPM_TOKEN || secrets.NPM_TOKEN }}

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ CHANGELOG.md
/deno

# don't format tsc output, will break source maps
/dist
dist
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.8.0"
".": "0.9.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: 3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-bc0272bf0a53ec37ca25f4a8b76bca4b90cf33c5f41816edf460daa642a5a84a.yml
openapi_spec_hash: 79f28fedf89e1b719f464c064847a630
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-a0aa3bcfef3af964f7172cecc6e969193a4ca96b26f8c47e7f50d852b13ef356.yml
openapi_spec_hash: e243aed52e8a3c6dad6254c57408fdc4
config_hash: bfe30148ec88e8bbbf4a348a9fdfc00a
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 0.9.0 (2025-05-10)

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

### Features

* **client:** add withOptions helper ([919b90f](https://github.com/isaacus-dev/isaacus-typescript/commit/919b90f26306e822205199eaa61be8e17d4a29d6))
* **mcp:** support dynamically discovering and invoking tools for APIs with many endpoints ([db63f9c](https://github.com/isaacus-dev/isaacus-typescript/commit/db63f9cfe164f071f4e4e2acb505195759e7d843))


### Bug Fixes

* **client:** always overwrite when merging headers ([ff81f8a](https://github.com/isaacus-dev/isaacus-typescript/commit/ff81f8af0867acacb1076017e6144da123c4d53c))
* **mcp:** remove ajv dependency so MCP servers are more compatible with Cloudflare Workers ([e0eebca](https://github.com/isaacus-dev/isaacus-typescript/commit/e0eebcafa6eebe5ac19f69ed1e00e8b021fd7526))


### Chores

* **build:** automatically build subpackages if present ([5068236](https://github.com/isaacus-dev/isaacus-typescript/commit/506823620cadfebe43735612bd75419dd112eaab))
* **client:** drop support for EOL node versions ([127940d](https://github.com/isaacus-dev/isaacus-typescript/commit/127940d53826bc75c61718d18b5b97499dc5a3d0))
* **internal:** codegen related update ([11b21d1](https://github.com/isaacus-dev/isaacus-typescript/commit/11b21d1d07582840d98683985bb7cbc13aef4cce))
* **internal:** share typescript helpers ([20f0218](https://github.com/isaacus-dev/isaacus-typescript/commit/20f0218a0b9b6612a2e8e67a91e8ee3eacf8a985))


### Documentation

* add examples to tsdocs ([f2f1be3](https://github.com/isaacus-dev/isaacus-typescript/commit/f2f1be3f21ef192e4a6701d6842a9174b60dc267))
* **api:** fixed incorrect description of how extraction results are ordered ([06a702a](https://github.com/isaacus-dev/isaacus-typescript/commit/06a702afa25153578c20161112918930738a3713))
* **readme:** fix typo ([d70d071](https://github.com/isaacus-dev/isaacus-typescript/commit/d70d0711bcccf134c3513ebf0a4c5d2e20c178ba))

## 0.8.0 (2025-04-30)

Full Changelog: [v0.7.0...v0.8.0](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.7.0...v0.8.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function main() {
main();
```

Error codes are as followed:
Error codes are as follows:

| Status Code | Error Type |
| ----------- | -------------------------- |
Expand Down Expand Up @@ -382,7 +382,7 @@ TypeScript >= 4.9 is supported.
The following runtimes are supported:

- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
- Deno v1.28.0 or higher.
- Bun 1.0 or later.
- Cloudflare Workers.
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isaacus",
"version": "0.8.0",
"version": "0.9.0",
"description": "The official TypeScript library for the Isaacus API",
"author": "Isaacus <support@isaacus.com>",
"types": "dist/index.d.ts",
Expand All @@ -17,7 +17,7 @@
"test": "./scripts/test",
"build": "./scripts/build",
"prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1",
"format": "prettier --write --cache --cache-strategy metadata . !dist",
"format": "./scripts/format",
"prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi",
"tsn": "ts-node -r tsconfig-paths/register",
"lint": "./scripts/lint",
Expand All @@ -30,9 +30,9 @@
"@swc/jest": "^0.2.29",
"@types/jest": "^29.4.0",
"@types/node": "^20.17.6",
"typescript-eslint": "^8.24.0",
"@typescript-eslint/eslint-plugin": "^8.24.0",
"@typescript-eslint/parser": "^8.24.0",
"typescript-eslint": "8.31.1",
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^9.20.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-unused-imports": "^4.1.4",
Expand All @@ -42,17 +42,13 @@
"publint": "^0.2.12",
"ts-jest": "^29.1.0",
"ts-node": "^10.5.0",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.3/tsc-multi.tgz",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.4/tsc-multi-1.1.4.tgz",
"tsconfig-paths": "^4.0.0",
"typescript": "^4.8.2"
"typescript": "5.8.3"
},
"resolutions": {
"synckit": "0.8.8"
},
"browser": {
"./internal/shims/getBuiltinModule.mjs": "./internal/shims/nullGetBuiltinModule.mjs",
"./internal/shims/getBuiltinModule.js": "./internal/shims/nullGetBuiltinModule.js"
},
"imports": {
"isaacus": ".",
"isaacus/*": "./src/*"
Expand All @@ -72,5 +68,8 @@
"import": "./dist/*.mjs",
"require": "./dist/*.js"
}
},
"engines": {
"node": ">= 20"
}
}
28 changes: 25 additions & 3 deletions packages/mcp-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can run the MCP Server directly via `npx`:

```sh
export ISAACUS_API_KEY="My API Key"
npx -y isaacus-mcp
npx -y isaacus-mcp@latest
```

### Via MCP Client
Expand All @@ -25,7 +25,7 @@ For clients with a configuration JSON, it might look something like this:
"mcpServers": {
"isaacus_api": {
"command": "npx",
"args": ["-y", "isaacus-mcp", "--client=claude"],
"args": ["-y", "isaacus-mcp", "--client=claude", "--tools=all"],
"env": {
"ISAACUS_API_KEY": "My API Key"
}
Expand All @@ -34,7 +34,14 @@ For clients with a configuration JSON, it might look something like this:
}
```

## Filtering tools
## Exposing endpoints to your MCP Client

There are two ways to expose endpoints as tools in the MCP server:

1. Exposing one tool per endpoint, and filtering as necessary
2. Exposing a set of tools to dynamically discover and invoke endpoints from the API

### Filtering endpoints and tools

You can run the package on the command line to discover and filter the set of tools that are exposed by the
MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's
Expand All @@ -46,6 +53,21 @@ You can filter by multiple aspects:
- `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*`
- `--operation` includes just read (get/list) or just write operations

### Dynamic tools

If you specify `--tools=dynamic` to the MCP server, instead of exposing one tool per endpoint in the API, it will
expose the following tools:

1. `list_api_endpoints` - Discovers available endpoints, with optional filtering by search query
2. `get_api_endpoint_schema` - Gets detailed schema information for a specific endpoint
3. `invoke_api_endpoint` - Executes any endpoint with the appropriate parameters

This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
you can opt-in to explicit tools, the dynamic tools, or both.

See more information with `--help`.

All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`).
Expand Down
12 changes: 6 additions & 6 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.8.0",
"version": "0.9.0",
"description": "The official MCP Server for the Isaacus API",
"author": "Isaacus <support@isaacus.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -30,15 +30,15 @@
"isaacus": "file:../../dist/",
"@modelcontextprotocol/sdk": "^1.6.1",
"yargs": "^17.7.2",
"ajv": "^8.17.1"
"@cloudflare/cabidela": "^0.2.4"
},
"bin": {
"mcp-server": "dist/index.js"
},
"devDependencies": {
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@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",
Expand All @@ -47,9 +47,9 @@
"ts-jest": "^29.1.0",
"ts-morph": "^19.0.0",
"ts-node": "^10.5.0",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.3/tsc-multi.tgz",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.4/tsc-multi-1.1.4.tgz",
"tsconfig-paths": "^4.0.0",
"typescript": "^4.8.2"
"typescript": "5.8.3"
},
"imports": {
"isaacus-mcp": ".",
Expand Down
10 changes: 1 addition & 9 deletions packages/mcp-server/src/compat.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { Endpoint } from './tools';
import Ajv from 'ajv';

const ajv = new Ajv();

export interface ClientCapabilities {
topLevelUnions: boolean;
Expand All @@ -23,14 +20,9 @@ export const defaultClientCapabilities: ClientCapabilities = {
};

/**
* Attempts to parse strings into JSON objects if initial schema
* validation fails.
* Attempts to parse strings into JSON objects
*/
export function parseEmbeddedJSON(args: Record<string, unknown>, schema: Record<string, unknown>) {
if (ajv.validate(schema, args)) {
return args;
}

let updated = false;
const newArgs: Record<string, unknown> = Object.assign({}, args);

Expand Down
Loading
Loading