Apr 21, 2025
Enhance Cursor AI: Create Images with MCP
Your coding environment isn't just for text anymore. With MCP (Model Context Protocol), you can generate images right from Cursor AI. It's a small change that adds a useful tool to your editor.
- MCP (Model Context Protocol): This protocol lets AI agents use features beyond what they were built for. In this case, it adds image generation to Cursor AI.
Here's how to set it up:
-
Create a Python File: Write a function that uses the Flux model to generate images. This function does the actual image creation work.
-
Turn It into an MCP Server: Add the code to make your function an MCP server. After that, any AI agent can call your image creation feature.
-
Configure Cursor: Create an
mcp.jsonfile to connect Cursor with your MCP server. This file tells Cursor AI how to find and use the new image service.
Once you finish these steps, you can just ask Cursor AI for an image, like "show me a mountain", and it will generate the image and save it to your project folder.
Want to try it yourself? Get the code here. Bookmark the video above if you want to come back to it later.
Give it a try and see what you can create when code and images work together.