Getting started

Integration & migration

Image & video API

DAM user guide

API overview

Account

ImageKit MCP server

Learn how to use the ImageKit Model Context Protocol (MCP) server to integrate ImageKit with AI assistants like Claude, ChatGPT, and other MCP-compatible clients.


Beta Release
The ImageKit MCP server is currently in beta. While the underlying ImageKit APIs are stable and production-ready, the MCP server itself is actively evolving with new features, improvements, and potential changes to the interface. We recommend testing thoroughly and follow the security recommendations.

The ImageKit Model Context Protocol (MCP) server provides AI assistants with direct access to ImageKit's powerful media management APIs. MCP enables AI assistants to understand and interact with ImageKit services, allowing for intelligent media operations, automated workflows, and seamless integration with AI-powered applications.

This MCP server exposes ImageKit API endpoints as tools that can be used by MCP-compatible clients like Claude Desktop, Claude Web, Cursor, Windsurf, and other AI assistants.

What is MCP?

The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect with external data sources and tools. It provides a standardized way for AI models to access and interact with various services, databases, and APIs.

Learn more about MCP at modelcontextprotocol.io.

Installation

ImageKit provides a hosted remote MCP server that is managed and maintained by ImageKit. This eliminates the need to run and maintain your own local server, making it easier to get started with ImageKit's API through your favorite AI assistant.

The remote MCP server is available at: https://api-mcp.imagekit.in/sse

You'll need a private API key from your ImageKit account and an MCP client like Claude Desktop, Claude Web, Cursor, or Windsurf.

To connect Claude Web to the ImageKit MCP server:

  1. Open Claude Web.
  2. Go to Settings → Connectors.
  3. Click "+ Add Custom Connector".
  4. Add the MCP server URL: https://api-mcp.imagekit.in/sse.

Security recommendations

When using the ImageKit remote MCP server, security is our top priority. The server is hosted and maintained by ImageKit on secure infrastructure and uses OAuth authentication to handle your credentials without exposing them to the AI assistant or any third parties.

Important
Your private API key is never exposed to the AI assistant or any third-party services. The OAuth flow ensures that only the official ImageKit MCP server can access your credentials, and only to make API calls you explicitly authorize.

Best practices

Follow these best practices to maintain the highest level of security when using the MCP server:

  1. Use restricted API keys: Create dedicated API keys with limited permissions.
  2. Rotate API keys regularly: Change keys periodically, and immediately if compromised.

How authentication works

The ImageKit remote MCP server implements OAuth with a secure consent flow managed by ImageKit's security infrastructure:

  1. Initial connection: When you first connect to the MCP server, you're redirected to ImageKit's secure OAuth consent screen. The URL should start with https://api-mcp.imagekit.in.

  2. Credential collection: You provide your ImageKit private API key through a secure, encrypted web form hosted on ImageKit's infrastructure.

  3. Token exchange: ImageKit's server exchanges your API key for an OAuth access token specific to your MCP client.

  4. Encrypted storage: Your private key is encrypted and stored securely on ImageKit's servers using enterprise-grade encryption and security practices.

  5. Scoped access: The OAuth token is used for all subsequent API requests, and your private key is only used by ImageKit's servers to authenticate those requests on your behalf.

  6. Isolation: Your credentials are isolated per client - each AI assistant gets its own OAuth token with no cross-client access.

Available tools

The MCP server provides access to all ImageKit API endpoints, including:

  • File management: Upload, list, search, update, and delete files.
  • Folder operations: Create, list, update, and delete folders.
  • Metadata handling: Add, update, and retrieve custom metadata.
  • Cache management: Purge CDN cache for files and folders.
  • Asset transformations: Generate URLs with transformations.
  • Bulk operations: Perform operations on multiple files at once.

View the complete list of available tools.

Troubleshooting

If you encounter issues connecting:

  • Ensure you have Node.js 18 or higher installed.
  • Try clearing the MCP authentication cache: rm -rf ~/.mcp-auth.
  • Restart your MCP client application.
  • Check client logs for error messages.

For additional help, check the ImageKit MCP server repository or contact ImageKit support.

Running locally

If you prefer to run the MCP server locally instead of using the hosted version, you can install and run it on your own machine. This gives you more control over configuration, filtering, and security.

Local installation is useful when you want to:

  • Have complete control over your API credentials (keys never leave your machine).
  • Customize tool exposure with advanced filtering options.
  • Run the server in offline or restricted network environments.
  • Develop and test custom integrations.

For detailed instructions on running the MCP server locally, including configuration options, filtering, and client-specific optimizations, visit the ImageKit MCP Server GitHub repository.