Skip to content

Commit 0a6ec00

Browse files
chore: update SDK settings
1 parent 9bceb0b commit 0a6ec00

File tree

7 files changed

+76
-25
lines changed

7 files changed

+76
-25
lines changed

.github/workflows/publish-npm.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/imagekit-developer/imagekit-nodejs/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
path:
9+
description: The path to run the release in, e.g. '.' or 'packages/mcp-server'
10+
required: true
11+
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
publish:
17+
name: publish
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Node
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '20'
29+
30+
- name: Install dependencies
31+
run: |
32+
yarn install
33+
34+
- name: Publish to NPM
35+
run: |
36+
if [ -n "${{ github.event.inputs.path }}" ]; then
37+
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
38+
else
39+
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
40+
fi
41+
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
42+
env:
43+
NPM_TOKEN: ${{ secrets.IMAGE_KIT_NPM_TOKEN || secrets.NPM_TOKEN }}
44+
45+
- name: Upload MCP Server DXT GitHub release asset
46+
run: |
47+
gh release upload ${{ github.event.release.tag_name }} \
48+
packages/mcp-server/imagekit_nodejs_api.mcpb
49+
env:
50+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21+
NPM_TOKEN: ${{ secrets.IMAGE_KIT_NPM_TOKEN || secrets.NPM_TOKEN }}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml
33
openapi_spec_hash: 1d382866fce3284f26d341f112988d9d
4-
config_hash: ff23f46fe08ef3f43c57c8cf13eff3a1
4+
config_hash: d57f3c7c581048428b41398f30da8b9b

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,17 @@ To format and fix all lint issues automatically:
9191
```sh
9292
$ yarn fix
9393
```
94+
95+
## Publishing and releases
96+
97+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
98+
the changes aren't made through the automated pipeline, you may want to make releases manually.
99+
100+
### Publish with a GitHub workflow
101+
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/imagekit-developer/imagekit-nodejs/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103+
104+
### Publish manually
105+
106+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
107+
the environment.

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ If you are looking to integrate file uploads in browsers, use one of our [fronte
1313
## Installation
1414

1515
```sh
16-
npm install git+ssh://[email protected]:imagekit-developer/imagekit-nodejs.git
16+
npm install @imagekit/nodejs
1717
```
1818

19-
> [!NOTE]
20-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npm install @imagekit/nodejs`
21-
2219
## Usage
2320

2421
The full API of this library can be found in [api.md](api.md).

bin/check-release-environment

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
errors=()
44

5+
if [ -z "${NPM_TOKEN}" ]; then
6+
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
7+
fi
8+
59
lenErrors=${#errors[@]}
610

711
if [[ lenErrors -gt 0 ]]; then

packages/mcp-server/README.md

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,19 @@
22

33
## Installation
44

5-
### Building
5+
### Direct invocation
66

7-
Because it's not published yet, clone the repo and build it:
7+
You can run the MCP Server directly via `npx`:
88

99
```sh
10-
git clone [email protected]:imagekit-developer/imagekit-nodejs.git
11-
cd imagekit-nodejs
12-
./scripts/bootstrap
13-
./scripts/build
14-
```
15-
16-
### Running
17-
18-
```sh
19-
# set env vars as needed
2010
export IMAGEKIT_PRIVATE_KEY="My Private Key"
2111
export OPTIONAL_IMAGEKIT_IGNORES_THIS="My Password"
2212
export IMAGEKIT_WEBHOOK_SECRET="My Webhook Secret"
23-
node ./packages/mcp-server/dist/index.js
13+
npx -y imagekit-api-mcp@latest
2414
```
2515

26-
> [!NOTE]
27-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npx -y imagekit-api-mcp`
28-
2916
### Via MCP Client
3017

31-
[Build the project](#building) as mentioned above.
32-
3318
There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already
3419
have a client, consult their documentation to install the MCP server.
3520

@@ -39,8 +24,8 @@ For clients with a configuration JSON, it might look something like this:
3924
{
4025
"mcpServers": {
4126
"imagekit_nodejs_api": {
42-
"command": "node",
43-
"args": ["/path/to/local/imagekit-nodejs/packages/mcp-server", "--client=claude", "--tools=dynamic"],
27+
"command": "npx",
28+
"args": ["-y", "imagekit-api-mcp", "--client=claude", "--tools=dynamic"],
4429
"env": {
4530
"IMAGEKIT_PRIVATE_KEY": "My Private Key",
4631
"OPTIONAL_IMAGEKIT_IGNORES_THIS": "My Password",

0 commit comments

Comments
 (0)