imgflip-meme-mcp
v1.3.0
Published
MCP server for generating memes using the Imgflip API
Downloads
52
Maintainers
Readme
Meme Generator MCP Server
An Express.js-based Model Context Protocol (MCP) server that generates memes using the Imgflip API. This server provides a standardized MCP interface for AI agents and applications to create custom memes programmatically.
Features
- 🎨 Meme Generation: Create memes from any Imgflip template with custom text
- 🔌 MCP Protocol: Full Model Context Protocol implementation for seamless AI integration
- 🚀 Express Server: Lightweight HTTP server with CORS support
- ✅ Type Safety: Built with TypeScript and Zod schema validation
Installation
npm install imgflip-meme-mcpQuick Start
1. Start the Server
npx imgflip-meme-mcpOr if installed locally:
npm startThe server will start on http://localhost:3000 by default. You can customize the port using the PORT environment variable:
PORT=8080 npm start2. Endpoints
- MCP Endpoint:
http://localhost:3000/mcp- Main MCP protocol endpoint - Health Check:
http://localhost:3000/- Server status and information
Usage
As an MCP Server
Connect to this server using any MCP-compatible client. The server exposes a single tool:
generate_meme
Generates a meme from an Imgflip template with custom text.
Parameters:
username(string, required): Your Imgflip usernamepassword(string, required): Your Imgflip passwordtemplate_id(string, required): The Imgflip template ID (e.g.,'181913649'for Drake template)text0(string, required): Text for the first text box (usually top text)text1(string, optional): Text for the second text box (usually bottom text)
Returns:
meme_url(string): Direct URL to the generated meme image
Example Request:
{
"username": "your_username",
"password": "your_password",
"template_id": "181913649",
"text0": "Using AI to generate memes",
"text1": "Actually understanding how memes work"
}Example Response:
{
"meme_url": "https://i.imgflip.com/xxxxx.jpg"
}Finding Template IDs
To find available meme templates and their IDs, visit the Imgflip API documentation or use the Imgflip website to browse templates. Popular template IDs include:
181913649- Drake Pointing87743020- Two Buttons112126428- Distracted Boyfriend131087935- Running Away Balloon
Development
Prerequisites
- Node.js 18+
- npm or yarn
Setup
- Clone the repository:
git clone <repository-url>
cd imgflip-meme-mcp- Install dependencies:
npm install- Build the project:
npm run build- Start the server:
npm startDevelopment Scripts
npm run build- Compile TypeScript to JavaScriptnpm start- Start the production servernpm run dev- Build and start the servernpm run watch- Watch for changes and rebuild
Project Structure
imgflip-meme-mcp/
├── src/
│ └── server.ts # Main server implementation
├── dist/ # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.mdConfiguration
Environment Variables
PORT- Server port (default:3000)
Error Handling
The server provides detailed error messages for common issues:
- Missing credentials: Returns an error if username or password is not provided
- Invalid template ID: Returns Imgflip API error messages
- API failures: Returns descriptive error messages from the Imgflip API
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues, questions, or feature requests, please open an issue on the GitHub repository.
