Freepik MCP server

Integrates with Freepik's API to enable stock photo searching, downloading, and custom image generation through Mystic AI with comprehensive filtering and parameter customization
Back to servers
Provider
MCERQUA
Release date
Mar 16, 2025
Language
TypeScript
Stats
1 star

This MCP server implementation provides access to Freepik's API, allowing you to search and download stock photos as well as generate images using Mystic AI capabilities. The server integrates with the Model Context Protocol to make Freepik resources available through compatible applications.

Prerequisites

  • Node.js 18 or higher
  • A Freepik API key

Installation

# Create a new directory for your MCP servers
mkdir mcp-servers
cd mcp-servers

# Clone the repository
git clone https://github.com/MCERQUA/freepik-mcp.git
cd freepik-mcp

# Install dependencies
npm install

# Build the server
npm run build

Configuration

Before using the server, you'll need to obtain a Freepik API key and configure the server in your MCP settings file:

  1. Obtain your Freepik API key by following the instructions in the API setup guide
  2. Add the server to your MCP settings file:
{
  "mcpServers": {
    "freepik": {
      "command": "node",
      "args": ["path/to/freepik-mcp/build/index.js"],
      "env": {
        "FREEPIK_API_KEY": "your-api-key-here"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Using the Available Tools

Searching Resources

You can search for Freepik resources with various filters:

{
  term?: string;          // Search term
  limit?: number;         // Results per page
  order?: 'relevance' | 'recent';
  filters?: {
    orientation?: {
      landscape?: boolean;
      portrait?: boolean;
      square?: boolean;
      panoramic?: boolean;
    };
    content_type?: {
      photo?: boolean;
      psd?: boolean;
      vector?: boolean;
    };
    license?: {
      freemium?: boolean;
      premium?: boolean;
    };
  };
}

Getting Resource Details

To retrieve detailed information about a specific resource:

{
  id: number;  // Resource ID to get details for
}

Downloading Resources

To get a download URL for a specific resource:

{
  id: number;  // Resource ID to download
}

Generating Images with Mystic AI

You can generate images using Freepik's Mystic AI:

{
  prompt: string;         // Text description of the image to generate
  resolution?: '2k' | '4k';
  aspect_ratio?: 'square_1_1' | 'classic_4_3' | 'traditional_3_4' | 
                 'widescreen_16_9' | 'social_story_9_16';
  realism?: boolean;      // Enable realistic style
  engine?: 'automatic' | 'magnific_illusio' | 'magnific_sharpy' | 'magnific_sparkle';
  creative_detailing?: number;  // 0-100
}

Checking Generation Status

To check the status of a Mystic image generation task:

{
  task_id: string;  // ID of the generation task to check
}

Error Handling

The server implements comprehensive error handling with:

  • Detailed API error logging
  • Input validation using Zod schemas
  • Contextual error responses
  • Rate limiting awareness

If you encounter errors when using the server, check the MCP server logs for detailed information about what went wrong.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later