Skip to content

Commit fe46e2f

Browse files
authored
feat(sdk): added npm MCP server
release: 0.4.0
2 parents c2d51ba + e004717 commit fe46e2f

24 files changed

+663
-7
lines changed

.github/workflows/publish-npm.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
name: Publish NPM
55
on:
66
workflow_dispatch:
7+
inputs:
8+
path:
9+
description: The path to run the release in, e.g. '.' or 'packages/mcp-server'
10+
required: true
711

812
release:
913
types: [published]
@@ -27,6 +31,11 @@ jobs:
2731
2832
- name: Publish to NPM
2933
run: |
30-
bash ./bin/publish-npm
34+
if [ -n "${{ github.event.inputs.path }}" ]; then
35+
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
36+
else
37+
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
38+
fi
39+
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
3140
env:
3241
NPM_TOKEN: ${{ secrets.ISAACUS_NPM_TOKEN || secrets.NPM_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-
".": "0.3.1"
2+
".": "0.4.0"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 2
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-861e8a85f0fb73cf4b7fc6c2b27722072ff33109459e90c17be24af15dfcbd0c.yml
33
openapi_spec_hash: 644a0383600633ee604bb1e5b9ca025d
4-
config_hash: 2bc262108dc3b065c16da5bb85c1e282
4+
config_hash: 1d603d50b7183a492ad6df5f728a1863

CHANGELOG.md

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

3+
## 0.4.0 (2025-04-01)
4+
5+
Full Changelog: [v0.3.1...v0.4.0](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.3.1...v0.4.0)
6+
7+
### Features
8+
9+
* **sdk:** added npm MCP server ([#30](https://github.com/isaacus-dev/isaacus-typescript/issues/30)) ([efe94d9](https://github.com/isaacus-dev/isaacus-typescript/commit/efe94d984a395de1c3f78db9851937e22971b6aa))
10+
311
## 0.3.1 (2025-04-01)
412

513
Full Changelog: [v0.3.0...v0.3.1](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.3.0...v0.3.1)

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default tseslint.config(
3434
},
3535
},
3636
{
37-
files: ['tests/**', 'examples/**'],
37+
files: ['tests/**', 'examples/**', 'packages/**'],
3838
rules: {
3939
'no-restricted-imports': 'off',
4040
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isaacus",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"description": "The official TypeScript library for the Isaacus API",
55
"author": "Isaacus <[email protected]>",
66
"types": "dist/index.d.ts",

packages/mcp-server/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Isaacus TypeScript MCP Server
2+
3+
It is generated with [Stainless](https://www.stainless.com/).
4+
5+
## Installation
6+
7+
### Via Claude Desktop
8+
9+
See [the user guide](https://modelcontextprotocol.io/quickstart/user) for setup.
10+
11+
Once it's set up, add your MCP server to your `claude_desktop_config.json` file to enable it.
12+
13+
The configuration file should be at:
14+
15+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
16+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
17+
18+
Add the following value to your `mcpServers` section. Make sure to provide any necessary environment variables (like API keys) as well.
19+
20+
```json
21+
{
22+
"mcpServers": {
23+
"isaacus_api": {
24+
"command": "npx",
25+
"args": ["-y", "isaacus-mcp"],
26+
"env": {
27+
"ISAACUS_API_KEY": "My API Key"
28+
}
29+
}
30+
}
31+
}
32+
```

packages/mcp-server/build

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
set -exuo pipefail
3+
4+
rm -rf dist; mkdir dist
5+
6+
# Copy src to dist/src and build from dist/src into dist, so that
7+
# the source map for index.js.map will refer to ./src/index.ts etc
8+
cp -rp src README.md dist
9+
10+
for file in LICENSE; do
11+
if [ -e "../../${file}" ]; then cp "../../${file}" dist; fi
12+
done
13+
14+
for file in CHANGELOG.md; do
15+
if [ -e "${file}" ]; then cp "${file}" dist; fi
16+
done
17+
18+
# this converts the export map paths for the dist directory
19+
# and does a few other minor things
20+
PKG_JSON_PATH=../../packages/mcp-server/package.json node ../../scripts/utils/make-dist-package-json.cjs > dist/package.json
21+
22+
# updates the `isaacus` dependency to point to NPM
23+
node scripts/postprocess-dist-package-json.cjs
24+
25+
# build to .js/.mjs/.d.ts files
26+
npm exec tsc-multi
27+
# we need to add exports = module.exports = Anthropic TypeScript to index.js;
28+
# No way to get that from index.ts because it would cause compile errors
29+
# when building .mjs
30+
DIST_PATH=./dist node ../../scripts/utils/fix-index-exports.cjs
31+
32+
# with "moduleResolution": "nodenext", if ESM resolves to index.d.ts,
33+
# it'll have TS errors on the default import. But if it resolves to
34+
# index.d.mts the default import will work (even though both files have
35+
# the same export default statement)
36+
cp dist/index.d.ts dist/index.d.mts
37+
cp tsconfig.dist-src.json dist/src/tsconfig.json
38+
39+
# Add proper Node.js shebang to the top of the file
40+
sed -i.bak '1s;^;#!/usr/bin/env node\n;' dist/index.js
41+
rm dist/index.js.bak
42+
43+
chmod +x dist/index.js
44+
45+
DIST_PATH=./dist PKG_IMPORT_PATH=isaacus-mcp/ node ../../scripts/utils/postprocess-files.cjs

packages/mcp-server/package.json

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"name": "isaacus-mcp",
3+
"version": "0.4.0",
4+
"description": "The official MCP Server for the Isaacus API",
5+
"author": "Isaacus <[email protected]>",
6+
"types": "dist/index.d.ts",
7+
"main": "dist/index.js",
8+
"type": "commonjs",
9+
"repository": "github:isaacus-dev/isaacus-typescript",
10+
"license": "Apache-2.0",
11+
"packageManager": "[email protected]",
12+
"private": false,
13+
"scripts": {
14+
"test": "echo 'no tests defined yet' && exit 1",
15+
"build": "bash ./build",
16+
"prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1",
17+
"prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1",
18+
"format": "prettier --write --cache --cache-strategy metadata . !dist",
19+
"prepare": "npm run build",
20+
"tsn": "ts-node -r tsconfig-paths/register",
21+
"lint": "eslint --ext ts,js .",
22+
"fix": "eslint --fix --ext ts,js ."
23+
},
24+
"dependencies": {
25+
"isaacus": "file:../../dist/",
26+
"@modelcontextprotocol/sdk": "^1.6.1"
27+
},
28+
"bin": {
29+
"mcp-server": "dist/index.js"
30+
},
31+
"devDependencies": {
32+
"@types/jest": "^29.4.0",
33+
"@typescript-eslint/eslint-plugin": "^6.7.0",
34+
"@typescript-eslint/parser": "^6.7.0",
35+
"eslint": "^8.49.0",
36+
"eslint-plugin-prettier": "^5.0.1",
37+
"eslint-plugin-unused-imports": "^3.0.0",
38+
"jest": "^29.4.0",
39+
"prettier": "^3.0.0",
40+
"ts-jest": "^29.1.0",
41+
"ts-morph": "^19.0.0",
42+
"ts-node": "^10.5.0",
43+
"tsc-multi": "^1.1.0",
44+
"tsconfig-paths": "^4.0.0",
45+
"typescript": "^4.8.2"
46+
},
47+
"imports": {
48+
"isaacus-mcp": ".",
49+
"isaacus-mcp/*": "./src/*"
50+
},
51+
"exports": {
52+
".": {
53+
"require": {
54+
"types": "./dist/index.d.ts",
55+
"default": "./dist/index.js"
56+
},
57+
"types": "./dist/index.d.mts",
58+
"default": "./dist/index.mjs"
59+
},
60+
"./*.mjs": {
61+
"types": "./dist/*.d.ts",
62+
"default": "./dist/*.mjs"
63+
},
64+
"./*.js": {
65+
"types": "./dist/*.d.ts",
66+
"default": "./dist/*.js"
67+
},
68+
"./*": {
69+
"types": "./dist/*.d.ts",
70+
"require": "./dist/*.js",
71+
"default": "./dist/*.mjs"
72+
}
73+
}
74+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const fs = require('fs');
2+
const pkgJson = require('../dist/package.json');
3+
const parentPkgJson = require('../../../package.json');
4+
5+
for (const dep in pkgJson.dependencies) {
6+
// ensure we point to NPM instead of a local directory
7+
if (dep === 'isaacus') {
8+
pkgJson.dependencies[dep] = '^' + parentPkgJson.version;
9+
}
10+
}
11+
12+
fs.writeFileSync('dist/package.json', JSON.stringify(pkgJson, null, 2));

0 commit comments

Comments
 (0)