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.
# 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
Before using the server, you'll need to obtain a Freepik API key and configure the server in 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": []
}
}
}
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;
};
};
}
To retrieve detailed information about a specific resource:
{
id: number; // Resource ID to get details for
}
To get a download URL for a specific resource:
{
id: number; // Resource ID to download
}
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
}
To check the status of a Mystic image generation task:
{
task_id: string; // ID of the generation task to check
}
The server implements comprehensive error handling with:
If you encounter errors when using the server, check the MCP server logs for detailed information about what went wrong.
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.
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"
]
}
}
}
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.
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.