An MCP (Model Context Protocol) server implementation for generating images using Replicate's black-forest-labs/flux-schnell model.
Ideally to be used with Cursor's MCP feature, but can be used with any MCP client.
- Generate images from text prompts
- Configurable image parameters (resolution, aspect ratio, quality)
- Save generated images to specified directory
- Full MCP protocol compliance
- Error handling and validation
- Node.js 16+
- Replicate API token
- TypeScript SDK for MCP
-
Clone the repository
-
Install dependencies:
npm install
-
Add your Replicate API token directly in the code at
src/imageService.tsby updating theapiTokenconstant:// No environment variables are used since they can't be easily set in cursor const apiToken = "your-replicate-api-token-here";
Note: If using with Claude, you can create a
.envfile in the root directory and set your API token there:REPLICATE_API_TOKEN=your-replicate-api-token-here
Then build the project:
npm run build
To use with cursor:
- Go to Settings
- Select Features
- Scroll down to "MCP Servers"
- Click "Add new MCP Server"
- Set Type to "Command"
- Set Command to:
node ./path/to/dist/server.js