MC

MCP Server: AI Meme to Sticker Converter

Create AI memes and convert them into Telegram and WhatsApp stickers with the MCP server, no APIs required.

Quick Install
npx -y @nkapila6/mcp-meme-sticky

Overview

The MCP Server: AI Meme to Sticker Converter is a lightweight Model Context Protocol (MCP) server that helps developers generate AI-powered memes and convert the resulting images into sticker formats suitable for Telegram and WhatsApp — without relying on third‑party APIs. It is intended for local or self‑hosted deployments where you want full control over model execution and asset conversion, and where privacy, extensibility, or offline operation are priorities.

The server accepts text prompts or template inputs, produces image outputs via a configured model backend (MCP-compatible), and provides utilities to transform those images into messaging-ready sticker files (WebP for Telegram/WhatsApp, including optional metadata and size normalization). This makes it easy to integrate meme-and-sticker workflows into chatbots, moderation tooling, or content pipelines.

Features

  • Generate memes from text prompts or existing image templates using MCP-compatible model backends
  • Convert generated images into messaging stickers (Telegram/WhatsApp) with size and format normalization
  • Local, API-driven server — no external meme/sticker APIs required
  • Simple HTTP endpoints for generation, conversion, and asset management
  • Support for batch generation and conversion workflows
  • Docker and local development modes for flexible deployment
  • Lightweight configuration for templates, output sizes, and model selection

Installation / Configuration

Prerequisites:

  • Git
  • Python 3.9+ or a compatible runtime (or Docker)
  • Model backend compatible with MCP (local or remote model runner)
  • pip

Clone the repository and install dependencies:

git clone https://github.com/nkapila6/mcp-meme-sticky.git
cd mcp-meme-sticky

# Option A: Python virtualenv
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Option B: Docker (recommended for isolated runs)
docker build -t mcp-meme-sticky .
docker run -p 8080:8080 mcp-meme-sticky

Configure environment variables (example .env):

# .env
MCP_HOST=localhost
MCP_PORT=21001
SERVER_PORT=8080
DEFAULT_TEMPLATE_DIR=./templates
OUTPUT_DIR=./output
MAX_IMAGE_DIM=512

Start the server (local run):

# If an entrypoint script is provided
python server.py

# Or using Flask/UVicorn (example)
uvicorn app.main:app --host 0.0.0.0 --port ${SERVER_PORT:-8080}

Notes:

  • Ensure your MCP model backend is reachable at MCP_HOST:MCP_PORT. The server will call the MCP endpoints to run image generation models.
  • Adjust MAX_IMAGE_DIM or output sizing options to meet Telegram/WhatsApp sticker requirements (typically square or near‑square; WebP format).

Available Resources

  • templates/ — folder with meme templates and optional image assets
  • examples/ — sample payloads and curl commands for quick testing
  • scripts/ — helper scripts for batch conversion and image normalization
  • docs/ — implementation details and API reference (if present in repo)
  • Dockerfile — containerized runtime for consistent deployment

API Endpoints (example)

The server exposes a small set of REST endpoints. Exact paths in your repo may vary; these examples show common patterns.

MethodPathDescription
POST/generateGenerate an image/meme from a prompt or template
POST/convertConvert an image to a sticker format (telegram/whatsapp)
GET/templatesList available templates
POST/batchBatch generate and convert multiple memes

Example: generate a meme (curl)

curl -X POST http://localhost:8080/generate \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "When the CI passes on the first try",
    "style": "comic",
    "template": "distracted_boyfriend"
  }' \
  --output meme.png

Example: convert to Telegram sticker

curl -X POST http://localhost:8080/convert \
  -F "[email protected]" \
  -F "platform=telegram" \
  -o sticker.webp

Python example (requests)

import requests

r = requests.post("http://localhost:8080/generate", json={"prompt":"debugging like a pro"})
open("meme.png","wb").write(r.content)

r2 = requests.post("http://localhost:8080/convert", files={"image": open("meme.png","rb")}, data={"platform":"whatsapp"})
open("sticker.webp","wb").write(r2.content)

Use Cases

  • Chatbot sticker generation: Integrate the server into a Telegram or WhatsApp bot to produce and send custom stickers on demand (e.g., a bot that turns user captions into branded memes).
  • Content pipelines: Batch‑generate memes for marketing or community channels and convert them into a ready‑to‑use sticker pack format.
  • Privacy‑focused workflows: Run all generation and conversion locally to avoid passing user content to external APIs.
  • Moderation/testing: Generate synthetic test images for moderation pipelines, then convert to messaging formats for end‑to‑end testing.
  • Rapid prototyping: Developers can swap MCP model backends to experiment with different image models without changing conversion logic.

Tips and Best Practices

  • Keep generated images within the recommended size limits before conversion; sticker formats often require square or constrained dimensions for best results.
  • Use the templates folder to curate safe, tested meme bases — this helps maintain consistent output.
  • For mass distribution on Telegram, package converted WebP stickers into a .tar or use platform tooling to create sticker packs.
  • Monitor resource usage of your MCP model backend; image generation can be CPU/GPU intensive.

If you need deeper integration examples (bot adapters, MCP client configuration snippets, or Docker compose templates), consult the repo’s examples/ directory or adapt the provided scripts to your environment.