Skip to content

Commit aadccbf

Browse files
authored
Merge pull request #134 from imagekit-developer/release-please--branches--master--changes--next--components--nodejs
release: 7.4.0
2 parents 5c28aaa + 9797a87 commit aadccbf

63 files changed

Lines changed: 6026 additions & 667 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Dependencies
2+
node_modules/
3+
**/node_modules/
4+
5+
# Build outputs
6+
dist/
7+
**/dist/
8+
9+
# Git
10+
.git/
11+
.gitignore
12+
13+
# CI/CD
14+
.github/
15+
.gitlab-ci.yml
16+
.travis.yml
17+
18+
# IDE
19+
.vscode/
20+
.idea/
21+
*.swp
22+
*.swo
23+
*~
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db
28+
29+
# Testing
30+
test/
31+
tests/
32+
__tests__/
33+
*.test.js
34+
*.spec.js
35+
coverage/
36+
.nyc_output/
37+
38+
# Logs
39+
*.log
40+
npm-debug.log*
41+
yarn-debug.log*
42+
yarn-error.log*
43+
44+
# Environment
45+
.env
46+
.env.*
47+
48+
# Temporary files
49+
*.tmp
50+
*.temp
51+
.cache/
52+
53+
# Examples and scripts
54+
examples/
55+
bin/
56+
57+
# Other packages (we only need mcp-server)
58+
packages/*/
59+
!packages/mcp-server/

.github/workflows/ci.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: CI
22
on:
33
push:
4-
branches-ignore:
5-
- 'generated'
6-
- 'codegen/**'
7-
- 'integrated/**'
8-
- 'stl-preview-head/**'
9-
- 'stl-preview-base/**'
4+
branches:
5+
- '**'
6+
- '!integrated/**'
7+
- '!stl-preview-head/**'
8+
- '!stl-preview-base/**'
9+
- '!generated'
10+
- '!codegen/**'
11+
- 'codegen/stl/**'
1012
pull_request:
1113
branches-ignore:
1214
- 'stl-preview-head/**'
@@ -17,7 +19,7 @@ jobs:
1719
timeout-minutes: 10
1820
name: lint
1921
runs-on: ${{ github.repository == 'stainless-sdks/imagekit-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
22+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
2123
steps:
2224
- uses: actions/checkout@v6
2325

@@ -36,7 +38,7 @@ jobs:
3638
timeout-minutes: 5
3739
name: build
3840
runs-on: ${{ github.repository == 'stainless-sdks/imagekit-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
39-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
41+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
4042
permissions:
4143
contents: read
4244
id-token: write
@@ -55,22 +57,28 @@ jobs:
5557
run: ./scripts/build
5658

5759
- name: Get GitHub OIDC Token
58-
if: github.repository == 'stainless-sdks/imagekit-typescript'
60+
if: |-
61+
github.repository == 'stainless-sdks/imagekit-typescript' &&
62+
!startsWith(github.ref, 'refs/heads/stl/')
5963
id: github-oidc
6064
uses: actions/github-script@v8
6165
with:
6266
script: core.setOutput('github_token', await core.getIDToken());
6367

6468
- name: Upload tarball
65-
if: github.repository == 'stainless-sdks/imagekit-typescript'
69+
if: |-
70+
github.repository == 'stainless-sdks/imagekit-typescript' &&
71+
!startsWith(github.ref, 'refs/heads/stl/')
6672
env:
6773
URL: https://pkg.stainless.com/s
6874
AUTH: ${{ steps.github-oidc.outputs.github_token }}
6975
SHA: ${{ github.sha }}
7076
run: ./scripts/utils/upload-artifact.sh
7177

7278
- name: Upload MCP Server tarball
73-
if: github.repository == 'stainless-sdks/imagekit-typescript'
79+
if: |-
80+
github.repository == 'stainless-sdks/imagekit-typescript' &&
81+
!startsWith(github.ref, 'refs/heads/stl/')
7482
env:
7583
URL: https://pkg.stainless.com/s?subpackage=mcp-server
7684
AUTH: ${{ steps.github-oidc.outputs.github_token }}

.github/workflows/publish-npm.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ jobs:
3333
3434
- name: Publish to NPM
3535
run: |
36-
if [ -n "${{ github.event.inputs.path }}" ]; then
37-
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
36+
if [ -n "$INPUT_PATH" ]; then
37+
PATHS_RELEASED="[\"$INPUT_PATH\"]"
3838
else
3939
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
4040
fi
4141
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
4242
env:
43+
INPUT_PATH: ${{ github.event.inputs.path }}
4344
NPM_TOKEN: ${{ secrets.IMAGE_KIT_NPM_TOKEN || secrets.NPM_TOKEN }}
4445

4546
- name: Upload MCP Server DXT GitHub release asset

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.prism.log
2+
.stdy.log
23
node_modules
34
yarn-error.log
45
codegen.log

.release-please-manifest.json

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

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 47
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-13fc3d7cafdea492f62eef7c1d63424d6d9d8adbff74b9f6ca6fd3fc12a36840.yml
3-
openapi_spec_hash: a1fe6fa48207791657a1ea2d60a6dfcc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-63aff1629530786015da3c86131afa8a9b60545d488884b77641f1d4b89c6e9d.yml
3+
openapi_spec_hash: 586d357bd7e5217d240a99e0d83c6d1f
44
config_hash: 47cb702ee2cb52c58d803ae39ade9b44

CHANGELOG.md

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

3+
## 7.4.0 (2026-04-06)
4+
5+
Full Changelog: [v7.3.0...v7.4.0](https://github.com/imagekit-developer/imagekit-nodejs/compare/v7.3.0...v7.4.0)
6+
7+
### Features
8+
9+
* **api:** add xCenter, yCenter, and anchorPoint parameters for overlay positioning ([0fcec28](https://github.com/imagekit-developer/imagekit-nodejs/commit/0fcec286966e93396924f6153a873e6d0b2f389e))
10+
* **api:** dpr type update ([81ec737](https://github.com/imagekit-developer/imagekit-nodejs/commit/81ec737f908203323d163470fd3a86abbb79db27))
11+
* **api:** Introduce lxc, lyc, lap parameters in overlays. ([6853a32](https://github.com/imagekit-developer/imagekit-nodejs/commit/6853a328de263cb0eb016ce03176028e9f88d95b))
12+
* **api:** revert dpr breaking change ([2543278](https://github.com/imagekit-developer/imagekit-nodejs/commit/2543278ccc78081ffa4cbd82dd1061310c480529))
13+
* **mcp:** add an option to disable code tool ([af87a8b](https://github.com/imagekit-developer/imagekit-nodejs/commit/af87a8ba4f06ca786ec611177663e21f85e2f8d4))
14+
* **mcp:** add initial server instructions ([cdce131](https://github.com/imagekit-developer/imagekit-nodejs/commit/cdce131dc17fba5469393a285ac536acd74742b2))
15+
16+
17+
### Bug Fixes
18+
19+
* **client:** avoid memory leak with abort signals ([c08f7c0](https://github.com/imagekit-developer/imagekit-nodejs/commit/c08f7c04267e000d51cfad22ec8337e456d20171))
20+
* **client:** avoid removing abort listener too early ([0738e88](https://github.com/imagekit-developer/imagekit-nodejs/commit/0738e8884a59ddac579fab6a65e0221fdff4247c))
21+
* **client:** preserve URL params already embedded in path ([9fed3c5](https://github.com/imagekit-developer/imagekit-nodejs/commit/9fed3c543ed9c115c50f56d22a52bff307cc6d08))
22+
* **docs/contributing:** correct pnpm link command ([743a112](https://github.com/imagekit-developer/imagekit-nodejs/commit/743a1126b13d90832ccac545474eda7a1094043f))
23+
* fix request delays for retrying to be more respectful of high requested delays ([8cc484f](https://github.com/imagekit-developer/imagekit-nodejs/commit/8cc484fda37d8a3188f10f3dfa1cd9ab291f10f6))
24+
* **mcp:** bump agents version in cloudflare worker MCP servers ([207aff5](https://github.com/imagekit-developer/imagekit-nodejs/commit/207aff5eb71b0a5d0aed71de3cb6fe6c3c965340))
25+
* **mcp:** initialize SDK lazily to avoid failing the connection on init errors ([66c5305](https://github.com/imagekit-developer/imagekit-nodejs/commit/66c53054ce63794350a9939b8f38ecea3ddec428))
26+
* **mcp:** update prompt ([db925be](https://github.com/imagekit-developer/imagekit-nodejs/commit/db925be3e3cae3ab8cb5e4f4b8f34909a21791e7))
27+
28+
29+
### Chores
30+
31+
* **ci:** escape input path in publish-npm workflow ([cbb4d36](https://github.com/imagekit-developer/imagekit-nodejs/commit/cbb4d3670cf06302124293e1221f8fc09fc48b0c))
32+
* **ci:** skip lint on metadata-only changes ([a4ff868](https://github.com/imagekit-developer/imagekit-nodejs/commit/a4ff868b281bc52a19bccd7a129a47222a8aae79))
33+
* **ci:** skip uploading artifacts on stainless-internal branches ([7d86a36](https://github.com/imagekit-developer/imagekit-nodejs/commit/7d86a36233f5ea27342329f6545d2b46eddbd219))
34+
* **client:** do not parse responses with empty content-length ([4b5fcbf](https://github.com/imagekit-developer/imagekit-nodejs/commit/4b5fcbfd1188573ccd1cea40b8e4924a5e2051dc))
35+
* **client:** restructure abort controller binding ([46c04e1](https://github.com/imagekit-developer/imagekit-nodejs/commit/46c04e16c46bca7bc1b0383d151f027d7d918611))
36+
* **internal/client:** fix form-urlencoded requests ([d96f483](https://github.com/imagekit-developer/imagekit-nodejs/commit/d96f4832db9e8c16cbeae32f9a7eb46234bb64ed))
37+
* **internal:** add health check to MCP server when running in HTTP mode ([83d1174](https://github.com/imagekit-developer/imagekit-nodejs/commit/83d1174751241a66748b9d0f4b2b92f37715d4ad))
38+
* **internal:** allow basic filtering of methods allowed for MCP code mode ([4a86182](https://github.com/imagekit-developer/imagekit-nodejs/commit/4a861827d463d2b6e9812a4aa58d2df14cb356bf))
39+
* **internal:** allow setting x-stainless-api-key header on mcp server requests ([a72133c](https://github.com/imagekit-developer/imagekit-nodejs/commit/a72133c81d0f9ad9587793bb92c06963fce21e8e))
40+
* **internal:** always generate MCP server dockerfiles and upgrade associated dependencies ([90eae18](https://github.com/imagekit-developer/imagekit-nodejs/commit/90eae18e29708d7596a6e783cad196c9a4f75f39))
41+
* **internal:** avoid type checking errors with ts-reset ([7cd3980](https://github.com/imagekit-developer/imagekit-nodejs/commit/7cd398067ad0736b67bfb3d8ace58d15a94c1fd2))
42+
* **internal:** bump @modelcontextprotocol/sdk, @hono/node-server, and minimatch ([a0031e0](https://github.com/imagekit-developer/imagekit-nodejs/commit/a0031e0a7be090912d18950ae5acffcef7b416e5))
43+
* **internal:** cache fetch instruction calls in MCP server ([7738ab8](https://github.com/imagekit-developer/imagekit-nodejs/commit/7738ab86d47fbca9a3c05c2cd48910d43d557c43))
44+
* **internal:** codegen related update ([60e54a6](https://github.com/imagekit-developer/imagekit-nodejs/commit/60e54a6b9efef0dd8c9f2ffc900ea9a518188ec3))
45+
* **internal:** codegen related update ([5c368b8](https://github.com/imagekit-developer/imagekit-nodejs/commit/5c368b89c0531200671ba1899121c2bf8c1bb40f))
46+
* **internal:** codegen related update ([4178900](https://github.com/imagekit-developer/imagekit-nodejs/commit/41789006a0bdd72bf302bea9c493efcca5927f5d))
47+
* **internal:** fix MCP docker image builds in yarn projects ([5f10f73](https://github.com/imagekit-developer/imagekit-nodejs/commit/5f10f733842b162e6ae8837b7c22def0cd6eaa79))
48+
* **internal:** fix MCP Dockerfiles so they can be built without buildkit ([9dde351](https://github.com/imagekit-developer/imagekit-nodejs/commit/9dde351b748d8a2e2fe56321b477ae214e679431))
49+
* **internal:** fix MCP Dockerfiles so they can be built without buildkit ([62b9ad0](https://github.com/imagekit-developer/imagekit-nodejs/commit/62b9ad0590c40c17cfcd1e7a68f2d5b2b6171cd1))
50+
* **internal:** fix MCP server TS errors that occur with required client options ([14154e2](https://github.com/imagekit-developer/imagekit-nodejs/commit/14154e2c6d8bdd5f11705deb3709acca73bc0f26))
51+
* **internal:** improve layout of generated MCP server files ([b2e0a75](https://github.com/imagekit-developer/imagekit-nodejs/commit/b2e0a75d79757596569d0277467ccad531d49bdd))
52+
* **internal:** improve local docs search for MCP servers ([ad984eb](https://github.com/imagekit-developer/imagekit-nodejs/commit/ad984eb6639ce557bea1b552e4ce6d9f66f0c56c))
53+
* **internal:** improve local docs search for MCP servers ([d4db198](https://github.com/imagekit-developer/imagekit-nodejs/commit/d4db19830e537311a352ea8a68a4662745e35332))
54+
* **internal:** make generated MCP servers compatible with Cloudflare worker environments ([419e72f](https://github.com/imagekit-developer/imagekit-nodejs/commit/419e72f03c8854a3c6b6d4654ea474c3c926287c))
55+
* **internal:** make MCP code execution location configurable via a flag ([497c926](https://github.com/imagekit-developer/imagekit-nodejs/commit/497c9269a3438a872c1ddb7a213d34abe90d6f6b))
56+
* **internal:** move stringifyQuery implementation to internal function ([60f7ea6](https://github.com/imagekit-developer/imagekit-nodejs/commit/60f7ea6ff1946645f7e65ab93b0c77c4db250f83))
57+
* **internal:** refactor flag parsing for MCP servers and add debug flag ([ff4b97e](https://github.com/imagekit-developer/imagekit-nodejs/commit/ff4b97e40fb46ca0b4f3229074c3f614b045641c))
58+
* **internal:** remove mock server code ([f1deef8](https://github.com/imagekit-developer/imagekit-nodejs/commit/f1deef8b69950e5917919a9fc619b558a65fe5b7))
59+
* **internal:** support custom-instructions-path flag in MCP servers ([14dec19](https://github.com/imagekit-developer/imagekit-nodejs/commit/14dec19d001aa203525ce5e713d79243a431342e))
60+
* **internal:** support local docs search in MCP servers ([03eef26](https://github.com/imagekit-developer/imagekit-nodejs/commit/03eef26ad1910d0d5da0fbe12f9a6bb6979f9b3e))
61+
* **internal:** support oauth authorization code flow for MCP servers ([5f6c688](https://github.com/imagekit-developer/imagekit-nodejs/commit/5f6c688f4f41df60d88fce94bc10cfdce4e29d78))
62+
* **internal:** support type annotations when running MCP in local execution mode ([bd8528f](https://github.com/imagekit-developer/imagekit-nodejs/commit/bd8528f9e38452de11e5a3976a0c7134102edbec))
63+
* **internal:** support x-stainless-mcp-client-envs header in MCP servers ([6b2f378](https://github.com/imagekit-developer/imagekit-nodejs/commit/6b2f37811676e4d1fdc24a175c477959b7aacde1))
64+
* **internal:** support x-stainless-mcp-client-permissions headers in MCP servers ([6e75dad](https://github.com/imagekit-developer/imagekit-nodejs/commit/6e75dad258809bb73b8d4e05195eea89afa7edf8))
65+
* **internal:** switch MCP servers to use pino for logging ([f08d300](https://github.com/imagekit-developer/imagekit-nodejs/commit/f08d3006d05cc29718533591605500ff6edd12f7))
66+
* **internal:** tweak CI branches ([aae2960](https://github.com/imagekit-developer/imagekit-nodejs/commit/aae29609043cb7d6fc385cfa886e877437397357))
67+
* **internal:** update agents version ([e39e377](https://github.com/imagekit-developer/imagekit-nodejs/commit/e39e3777d9d0ccd225774c2a889aa6b6c81a6402))
68+
* **internal:** update dependencies to address dependabot vulnerabilities ([c6f8d11](https://github.com/imagekit-developer/imagekit-nodejs/commit/c6f8d113f12ef419981dfb5df68208c079f1970b))
69+
* **internal:** update gitignore ([d36a938](https://github.com/imagekit-developer/imagekit-nodejs/commit/d36a938ec305af370a93674ff846e9ea695f8d6c))
70+
* **internal:** upgrade @modelcontextprotocol/sdk and hono ([446fc85](https://github.com/imagekit-developer/imagekit-nodejs/commit/446fc85863574d74d94918ee09aff23f4ed373b4))
71+
* **internal:** upgrade hono ([61a5d88](https://github.com/imagekit-developer/imagekit-nodejs/commit/61a5d8863e4fcb692d187bb0a7b44e1788faf8ee))
72+
* **internal:** use link instead of file in MCP server package.json files ([4939cda](https://github.com/imagekit-developer/imagekit-nodejs/commit/4939cdab635c72a63f2570de3e41f77b81976478))
73+
* **internal:** use x-stainless-mcp-client-envs header for MCP remote code tool calls ([d128af7](https://github.com/imagekit-developer/imagekit-nodejs/commit/d128af71272254b0f6fbc52029e941e674b594cf))
74+
* **mcp-server:** add support for session id, forward client info ([36ec509](https://github.com/imagekit-developer/imagekit-nodejs/commit/36ec509701f79fb629d69346ab9075d935b05d4e))
75+
* **mcp-server:** improve instructions ([9afa574](https://github.com/imagekit-developer/imagekit-nodejs/commit/9afa574d4589f6229784ba766e604a0498f506a3))
76+
* **mcp-server:** log client info ([20299c3](https://github.com/imagekit-developer/imagekit-nodejs/commit/20299c30d17b963360b904b6b9c1c5ebe19f79d5))
77+
* **mcp-server:** return access instructions for 404 without API key ([568dd2a](https://github.com/imagekit-developer/imagekit-nodejs/commit/568dd2ae4a631c3b64812d1b13af5e6aaba6ebd1))
78+
* **mcp:** correctly update version in sync with sdk ([57fa966](https://github.com/imagekit-developer/imagekit-nodejs/commit/57fa966d57b1069c554658921a3d649a563e4e12))
79+
* **mcp:** forward STAINLESS_API_KEY to docs search endpoint ([bf91d73](https://github.com/imagekit-developer/imagekit-nodejs/commit/bf91d7300f134a716038b00bbdcf0cd5932176ea))
80+
* **tests:** remove unnecessary blank lines in overlay encoding test cases ([9a4f18d](https://github.com/imagekit-developer/imagekit-nodejs/commit/9a4f18d4d4374ac92ab20eae30b81a9222fcb522))
81+
* **tests:** update webhook tests ([f179fa9](https://github.com/imagekit-developer/imagekit-nodejs/commit/f179fa9536d097bcaed31310deeadbfc74457814))
82+
* update mock server docs ([8d9ad04](https://github.com/imagekit-developer/imagekit-nodejs/commit/8d9ad04f864ca543a065a99cc041a436dd53069a))
83+
* update placeholder string ([f8f62ae](https://github.com/imagekit-developer/imagekit-nodejs/commit/f8f62ae1890416cb5322c7d7b7ee2235b252983b))
84+
* use proper capitalization for WebSockets ([e6e8ed6](https://github.com/imagekit-developer/imagekit-nodejs/commit/e6e8ed66ee0b76db104b7112c1540fa021b005ea))
85+
386
## 7.3.0 (2026-02-02)
487

588
Full Changelog: [v7.2.2...v7.3.0](https://github.com/imagekit-developer/imagekit-nodejs/compare/v7.2.2...v7.3.0)

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,11 @@ $ yarn link @imagekit/nodejs
6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -global @imagekit/nodejs
63+
$ pnpm link --global @imagekit/nodejs
6464
```
6565

6666
## Running tests
6767

68-
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
69-
70-
```sh
71-
$ npx prism mock path/to/your/openapi.yml
72-
```
73-
7468
```sh
7569
$ yarn run test
7670
```

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@imagekit/nodejs",
3-
"version": "7.3.0",
3+
"version": "7.4.0",
44
"description": "Offical NodeJS SDK for ImageKit.io integration",
55
"author": "Image Kit <developer@imagekit.io>",
66
"types": "dist/index.d.ts",
@@ -52,6 +52,17 @@
5252
"typescript": "5.8.3",
5353
"typescript-eslint": "8.31.1"
5454
},
55+
"overrides": {
56+
"minimatch": "^9.0.5"
57+
},
58+
"pnpm": {
59+
"overrides": {
60+
"minimatch": "^9.0.5"
61+
}
62+
},
63+
"resolutions": {
64+
"minimatch": "^9.0.5"
65+
},
5566
"exports": {
5667
".": {
5768
"import": "./dist/index.mjs",

packages/mcp-server/Dockerfile

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Dockerfile for Image Kit MCP Server
2+
#
3+
# This Dockerfile builds a Docker image for the MCP Server.
4+
#
5+
# To build the image locally:
6+
# docker build -f packages/mcp-server/Dockerfile -t @imagekit/api-mcp:local .
7+
#
8+
# To run the image:
9+
# docker run -i @imagekit/api-mcp:local [OPTIONS]
10+
#
11+
# Common options:
12+
# --tool=<name> Include specific tools
13+
# --resource=<name> Include tools for specific resources
14+
# --operation=read|write Filter by operation type
15+
# --client=<type> Set client compatibility (e.g., claude, cursor)
16+
# --transport=<type> Set transport type (stdio or http)
17+
#
18+
# For a full list of options:
19+
# docker run -i @imagekit/api-mcp:local --help
20+
#
21+
# Note: The MCP server uses stdio transport by default. Docker's -i flag
22+
# enables interactive mode, allowing the container to communicate over stdin/stdout.
23+
24+
# Build stage
25+
FROM node:24-alpine AS builder
26+
27+
# Install bash for build script
28+
RUN apk add --no-cache bash openssl
29+
30+
# Set working directory
31+
WORKDIR /build
32+
33+
# Copy entire repository
34+
COPY . .
35+
36+
# Install all dependencies and build everything
37+
RUN yarn install --frozen-lockfile && \
38+
yarn build && \
39+
# Remove the symlink to the SDK so it doesn't interfere with the explicit COPY below
40+
rm -Rf packages/mcp-server/node_modules/@imagekit/nodejs
41+
42+
FROM denoland/deno:alpine-2.7.1
43+
44+
# Install node and npm
45+
RUN apk add --no-cache nodejs npm
46+
47+
ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
48+
49+
# Add non-root user
50+
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
51+
52+
# Set working directory
53+
WORKDIR /app
54+
55+
# Copy the built mcp-server dist directory
56+
COPY --from=builder /build/packages/mcp-server/dist ./
57+
58+
# Copy node_modules from mcp-server (includes all production deps)
59+
COPY --from=builder /build/packages/mcp-server/node_modules ./node_modules
60+
61+
# Copy the built @imagekit/nodejs into node_modules
62+
COPY --from=builder /build/dist ./node_modules/@imagekit/nodejs
63+
64+
# Change ownership to nodejs user
65+
RUN chown -R nodejs:nodejs /app
66+
RUN chown -R nodejs:nodejs /deno-dir
67+
68+
# Switch to non-root user
69+
USER nodejs
70+
71+
# The MCP server uses stdio transport by default
72+
# No exposed ports needed for stdio communication
73+
74+
# Set the entrypoint to the MCP server
75+
ENTRYPOINT ["node", "index.js"]
76+
77+
# Allow passing arguments to the MCP server
78+
CMD []

0 commit comments

Comments
 (0)