Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f171cea
codegen metadata
stainless-app[bot] Sep 22, 2025
2acb106
chore(internal): codegen related update
stainless-app[bot] Sep 24, 2025
e1a3b52
feat(mcp): add option for including docs tools
stainless-app[bot] Sep 24, 2025
7e8cfad
perf: faster formatting
stainless-app[bot] Sep 26, 2025
9e0e5b0
chore(internal): remove deprecated `compilerOptions.baseUrl` from tsc…
stainless-app[bot] Sep 26, 2025
863e6b7
chore(internal): fix incremental formatting in some cases
stainless-app[bot] Sep 27, 2025
bbe84b3
chore(mcp): allow pointing `docs_search` tool at other URLs
stainless-app[bot] Sep 27, 2025
ca24cab
chore(internal): codegen related update
stainless-app[bot] Sep 27, 2025
f991673
chore(internal): ignore .eslintcache
stainless-app[bot] Sep 27, 2025
a8da550
fix(mcp): fix cli argument parsing logic
stainless-app[bot] Sep 30, 2025
e805d24
fix(mcp): resolve a linting issue in server code
stainless-app[bot] Sep 30, 2025
dcdc0b7
chore: update lockfile
stainless-app[bot] Sep 30, 2025
d50cbcf
feat(api): add path policy related non-breaking changes
stainless-app[bot] Sep 30, 2025
962390f
feat(api): updated docs
stainless-app[bot] Sep 30, 2025
ec8c8b8
feat(api): add selectedFieldsSchema in upload and list API response
stainless-app[bot] Sep 30, 2025
a957209
docs: correct typo in default value description for custom metadata f…
stainless-app[bot] Sep 30, 2025
ba86045
docs: fix link to deploy template in README
manu4543 Sep 30, 2025
467d77b
feat(api): fix upload API request params
stainless-app[bot] Sep 30, 2025
3dd5d37
release: 7.1.0
stainless-app[bot] Sep 30, 2025
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
1 change: 1 addition & 0 deletions .eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/packages/mcp-server/src/tools/beta/v2/files/upload-v2-beta-files.ts":"1","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/packages/mcp-server/src/tools/files/upload-files.ts":"2","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/src/resources/beta/v2/files.ts":"3","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/src/resources/files/files.ts":"4","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/src/resources/webhooks.ts":"5","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/tests/api-resources/beta/v2/files.test.ts":"6","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/tests/api-resources/files/files.test.ts":"7"},{"size":15178,"mtime":1759218546101},{"size":16142,"mtime":1759218546101},{"size":19090,"mtime":1759218546101},{"size":43513,"mtime":1759218546101},{"size":28582,"mtime":1759218546101},{"size":2119,"mtime":1759218546101},{"size":6193,"mtime":1759218546101}]
1 change: 1 addition & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.IMAGE_KIT_NPM_TOKEN || secrets.NPM_TOKEN }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ dist
dist-deno
/*.tgz
.idea/
.eslintcache
dist-bundle
*.mcpb
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "7.0.1"
".": "7.1.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 42
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml
openapi_spec_hash: 1d382866fce3284f26d341f112988d9d
config_hash: d57f3c7c581048428b41398f30da8b9b
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml
openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa
config_hash: e42d7fc3a8c92c35099cc283f9a4467a
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Changelog

## 7.1.0 (2025-09-30)

Full Changelog: [v7.0.1...v7.1.0](https://github.com/imagekit-developer/imagekit-nodejs/compare/v7.0.1...v7.1.0)

### Features

* **api:** add path policy related non-breaking changes ([d50cbcf](https://github.com/imagekit-developer/imagekit-nodejs/commit/d50cbcf4cd2535e25310c635539a2ecf2f2e8201))
* **api:** add selectedFieldsSchema in upload and list API response ([ec8c8b8](https://github.com/imagekit-developer/imagekit-nodejs/commit/ec8c8b846e6288e6c13d4bbe4e65ca13d4059fa2))
* **api:** fix upload API request params ([467d77b](https://github.com/imagekit-developer/imagekit-nodejs/commit/467d77b12af3f7f0a0816bffb921b229f6c54a9b))
* **api:** updated docs ([962390f](https://github.com/imagekit-developer/imagekit-nodejs/commit/962390f02b179b6a34f9697c27bc67ed99ba9b99))
* **mcp:** add option for including docs tools ([e1a3b52](https://github.com/imagekit-developer/imagekit-nodejs/commit/e1a3b52f5691f398669cd682c57d5a6dc4e5895a))


### Bug Fixes

* **mcp:** fix cli argument parsing logic ([a8da550](https://github.com/imagekit-developer/imagekit-nodejs/commit/a8da5506c7a39462b7b02bbfec1e4e7a6fbdfdaf))
* **mcp:** resolve a linting issue in server code ([e805d24](https://github.com/imagekit-developer/imagekit-nodejs/commit/e805d24f1d721e1694b927c3c41c5b21a4433fb0))


### Performance Improvements

* faster formatting ([7e8cfad](https://github.com/imagekit-developer/imagekit-nodejs/commit/7e8cfadd5473e55e83c6659c4033f9b852d3f91c))


### Chores

* **internal:** codegen related update ([ca24cab](https://github.com/imagekit-developer/imagekit-nodejs/commit/ca24cab20bc7d4450623d67b0ebcb4e2a0ef7633))
* **internal:** codegen related update ([2acb106](https://github.com/imagekit-developer/imagekit-nodejs/commit/2acb106595f0642dcdb81bcd9a041a1bf059d307))
* **internal:** fix incremental formatting in some cases ([863e6b7](https://github.com/imagekit-developer/imagekit-nodejs/commit/863e6b7b6cff10c81fc07524b038972db2ce76b6))
* **internal:** ignore .eslintcache ([f991673](https://github.com/imagekit-developer/imagekit-nodejs/commit/f99167394b66562e972b54730a4cf65aed8e33fd))
* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([9e0e5b0](https://github.com/imagekit-developer/imagekit-nodejs/commit/9e0e5b0c46930798e8d06f553fd91a57d9692d2b))
* **mcp:** allow pointing `docs_search` tool at other URLs ([bbe84b3](https://github.com/imagekit-developer/imagekit-nodejs/commit/bbe84b3a9a5b30fc11c7b074cea447632740f512))
* update lockfile ([dcdc0b7](https://github.com/imagekit-developer/imagekit-nodejs/commit/dcdc0b74f7d809165bc0e3bce1656626d5dd1240))


### Documentation

* correct typo in default value description for custom metadata field ([a957209](https://github.com/imagekit-developer/imagekit-nodejs/commit/a9572097a933ab5d9c62fda02d4edf8c9fc47eeb))
* fix link to deploy template in README ([ba86045](https://github.com/imagekit-developer/imagekit-nodejs/commit/ba86045ee37ea9c03cce09f8a8028e645f263bbf))

## 7.0.1 (2025-09-21)

Full Changelog: [v7.0.0...v7.0.1](https://github.com/imagekit-developer/imagekit-nodejs/compare/v7.0.0...v7.0.1)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@imagekit/nodejs",
"version": "7.0.1",
"version": "7.1.0",
"description": "Offical NodeJS SDK for ImageKit.io integration",
"author": "Image Kit <developer@imagekit.io>",
"types": "dist/index.d.ts",
Expand Down
3 changes: 3 additions & 0 deletions packages/mcp-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ The following tools are available in this MCP server.
- `create_custom_metadata_fields` (`write`): This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API.
- `update_custom_metadata_fields` (`write`): This API updates the label or schema of an existing custom metadata field.
- `list_custom_metadata_fields` (`read`): This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response.

You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path.

- `delete_custom_metadata_fields` (`write`): This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name.

### Resource `files`:
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/cloudflare-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ API token and any other client configuration options that you'd need to instanti

The recommended way to use this project is to use the below "deploy to cloudflare" button to use this repo as a template for generating a server.

[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/imagekit-developer/imagekit-nodejs/tree/main/packages/mcp-server/cloudflare-worker)
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/imagekit-developer/imagekit-nodejs/tree/master/packages/mcp-server/cloudflare-worker)

## Develop locally

Expand Down
58 changes: 29 additions & 29 deletions packages/mcp-server/cloudflare-worker/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@
* https://developers.cloudflare.com/workers/wrangler/configuration/
*/
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "imagekit-nodejs-api-mcp-server",
"main": "src/index.ts",
"compatibility_date": "2025-03-10",
"compatibility_flags": ["nodejs_compat"],
"migrations": [
{
"new_sqlite_classes": ["MyMCP"],
"tag": "v1"
}
],
"durable_objects": {
"bindings": [
{
"class_name": "MyMCP",
"name": "MCP_OBJECT"
}
]
},
"kv_namespaces": [
{
"binding": "OAUTH_KV",
"id": "ae6fe7d7993146a9b8d54d87f73b0bdf"
}
],
"observability": {
"enabled": true
},
"assets": { "directory": "./static/", "binding": "ASSETS" }
"$schema": "node_modules/wrangler/config-schema.json",
"name": "imagekit-nodejs-api-mcp-server",
"main": "src/index.ts",
"compatibility_date": "2025-03-10",
"compatibility_flags": ["nodejs_compat"],
"migrations": [
{
"new_sqlite_classes": ["MyMCP"],
"tag": "v1"
}
],
"durable_objects": {
"bindings": [
{
"class_name": "MyMCP",
"name": "MCP_OBJECT"
}
]
},
"kv_namespaces": [
{
"binding": "OAUTH_KV",
"id": "ae6fe7d7993146a9b8d54d87f73b0bdf"
}
],
"observability": {
"enabled": true
},
"assets": { "directory": "./static/", "binding": "ASSETS" }
}
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imagekit-api-mcp",
"version": "7.0.1",
"version": "7.1.0",
"description": "The official MCP Server for the Image Kit API",
"author": "Image Kit <developer@imagekit.io>",
"types": "dist/index.d.ts",
Expand Down
48 changes: 48 additions & 0 deletions packages/mcp-server/src/docs-search-tool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { Metadata, asTextContentResult } from './tools/types';

import { Tool } from '@modelcontextprotocol/sdk/types.js';

export const metadata: Metadata = {
resource: 'all',
operation: 'read',
tags: [],
httpMethod: 'get',
};

export const tool: Tool = {
name: 'search_docs',
description:
'Search for documentation for how to use the client to interact with the API.\nThe tool will return an array of Markdown-formatted documentation pages.',
inputSchema: {
type: 'object',
properties: {
query: {
type: 'string',
description: 'The query to search for.',
},
language: {
type: 'string',
description: 'The language for the SDK to search for.',
enum: ['http', 'python', 'go', 'typescript', 'terraform', 'ruby', 'java', 'kotlin'],
},
},
required: ['query', 'language'],
},
annotations: {
readOnlyHint: true,
},
};

const docsSearchURL =
process.env['DOCS_SEARCH_URL'] || 'https://api.stainless.com/api/projects/imagekit/docs/search';

export const handler = async (_: unknown, args: Record<string, unknown> | undefined) => {
const body = args as any;
const query = new URLSearchParams(body).toString();
const result = await fetch(`${docsSearchURL}?${query}`);
return asTextContentResult(await result.json());
};

export default { metadata, tool, handler };
24 changes: 17 additions & 7 deletions packages/mcp-server/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type McpOptions = {
includeDynamicTools?: boolean | undefined;
includeAllTools?: boolean | undefined;
includeCodeTools?: boolean | undefined;
includeDocsTools?: boolean | undefined;
filters?: Filter[] | undefined;
capabilities?: Partial<ClientCapabilities> | undefined;
};
Expand Down Expand Up @@ -55,13 +56,13 @@ export function parseCLIOptions(): CLIOptions {
.option('tools', {
type: 'string',
array: true,
choices: ['dynamic', 'all', 'code'],
choices: ['dynamic', 'all', 'code', 'docs'],
description: 'Use dynamic tools or all tools',
})
.option('no-tools', {
type: 'string',
array: true,
choices: ['dynamic', 'all', 'code'],
choices: ['dynamic', 'all', 'code', 'docs'],
description: 'Do not use any dynamic or all tools',
})
.option('tool', {
Expand Down Expand Up @@ -245,13 +246,15 @@ export function parseCLIOptions(): CLIOptions {
}
}

const shouldIncludeToolType = (toolType: 'dynamic' | 'all' | 'code') =>
explicitTools ? argv.tools?.includes(toolType) && !argv.noTools?.includes(toolType) : undefined;
const shouldIncludeToolType = (toolType: 'dynamic' | 'all' | 'code' | 'docs') =>
argv.noTools?.includes(toolType) ? false
: argv.tools?.includes(toolType) ? true
: undefined;

const explicitTools = Boolean(argv.tools || argv.noTools);
const includeDynamicTools = shouldIncludeToolType('dynamic');
const includeAllTools = shouldIncludeToolType('all');
const includeCodeTools = shouldIncludeToolType('code');
const includeDocsTools = shouldIncludeToolType('docs');

const transport = argv.transport as 'stdio' | 'http';

Expand All @@ -261,6 +264,7 @@ export function parseCLIOptions(): CLIOptions {
includeDynamicTools,
includeAllTools,
includeCodeTools,
includeDocsTools,
filters,
capabilities: clientCapabilities,
list: argv.list || false,
Expand All @@ -280,8 +284,8 @@ const coerceArray = <T extends z.ZodTypeAny>(zodType: T) =>
);

const QueryOptions = z.object({
tools: coerceArray(z.enum(['dynamic', 'all'])).describe('Use dynamic tools or all tools'),
no_tools: coerceArray(z.enum(['dynamic', 'all'])).describe('Do not use dynamic tools or all tools'),
tools: coerceArray(z.enum(['dynamic', 'all', 'docs'])).describe('Use dynamic tools or all tools'),
no_tools: coerceArray(z.enum(['dynamic', 'all', 'docs'])).describe('Do not use dynamic tools or all tools'),
tool: coerceArray(z.string()).describe('Include tools matching the specified names'),
resource: coerceArray(z.string()).describe('Include tools matching the specified resources'),
operation: coerceArray(z.enum(['read', 'write'])).describe(
Expand Down Expand Up @@ -376,11 +380,17 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M
: queryOptions.tools?.includes('all') ? true
: defaultOptions.includeAllTools;

let docsTools: boolean | undefined =
queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
: queryOptions.tools?.includes('docs') ? true
: defaultOptions.includeDocsTools;

return {
client: queryOptions.client ?? defaultOptions.client,
includeDynamicTools: dynamicTools,
includeAllTools: allTools,
includeCodeTools: undefined,
includeDocsTools: docsTools,
filters,
capabilities: clientCapabilities,
};
Expand Down
13 changes: 8 additions & 5 deletions packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from './compat';
import { dynamicTools } from './dynamic-tools';
import { codeTool } from './code-tool';
import docsSearchTool from './docs-search-tool';
import { McpOptions } from './options';

export { McpOptions } from './options';
Expand All @@ -33,7 +34,7 @@ export const newMcpServer = () =>
new McpServer(
{
name: 'imagekit_nodejs_api',
version: '7.0.1',
version: '7.1.0',
},
{ capabilities: { tools: {}, logging: {} } },
);
Expand Down Expand Up @@ -147,24 +148,26 @@ export function initMcpServer(params: {
export async function selectTools(endpoints: Endpoint[], options?: McpOptions): Promise<Endpoint[]> {
const filteredEndpoints = query(options?.filters ?? [], endpoints);

let includedTools = filteredEndpoints;
let includedTools = filteredEndpoints.slice();

if (includedTools.length > 0) {
if (options?.includeDynamicTools) {
includedTools = dynamicTools(includedTools);
}
} else {
if (options?.includeAllTools) {
includedTools = endpoints;
includedTools = endpoints.slice();
} else if (options?.includeDynamicTools) {
includedTools = dynamicTools(endpoints);
} else if (options?.includeCodeTools) {
includedTools = [await codeTool()];
} else {
includedTools = endpoints;
includedTools = endpoints.slice();
}
}

if (options?.includeDocsTools ?? true) {
includedTools.push(docsSearchTool);
}
const capabilities = { ...defaultClientCapabilities, ...options?.capabilities };
return applyCompatibilityTransformations(includedTools, capabilities);
}
Expand Down
Loading