memecp
v0.0.6
Published
A simple Model Context Protocol (MCP) server
Maintainers
Readme
MemeCP - Meme Generation MCP Server
A fun test project! This is a Model Context Protocol (MCP) server built with TypeScript that provides meme generation tools using the Memegen.link API. Created purely for experimentation and entertainment - no serious intent other than having some fun with MCP and memes! 🎉
Features
The server provides three powerful meme tools:
- Show All Meme Templates - Browse all available meme templates from Memegen.link
- Show Meme Template - View details and preview of a specific meme template
- Compose Meme - Generate custom memes with intelligent template selection and text placement
Prerequisites
- Node.js 18 or higher
- pnpm package manager
Setup
- Install dependencies:
pnpm install- Build the project:
pnpm run build- (Optional) Set up API key for watermark-free memes:
export MEMEGEN_API_KEY=your_api_key_hereUsage
Development Mode
Run the server in development mode with hot reload:
pnpm run devProduction Mode
Build and run the server:
pnpm run build
pnpm startWatch Mode
Run with file watching for development:
pnpm run watchMCP Client Configuration
To use this server with an MCP client, configure it to run:
node /path/to/memecp/dist/index.jsOr in development:
pnpm --dir /path/to/memecp run devAvailable Tools
Show All Meme Templates
Lists all available meme templates from Memegen.link with their names, IDs, and keywords.
Usage:
{
"name": "show_all_meme_templates",
"arguments": {}
}Show Meme Template
Shows details and preview image for a specific meme template. Supports search by name, ID, or keywords.
Input:
name(string): Name, ID, or keyword of the meme template
Example:
{
"name": "show_meme_template",
"arguments": {
"name": "fine"
}
}Compose Meme
Generates a custom meme with automatic template selection and intelligent text placement.
Input:
text(string): Text content for the meme. Use|to split into top/bottom text, or let the AI split it intelligentlytemplate(string, optional): Specific template name/ID to use. If not provided, the best template is selected automaticallyreturnImage(boolean, optional): Whether to return the image data. Defaults to true
Examples:
Auto-selected template:
{
"name": "compose_meme",
"arguments": {
"text": "Updating documentation | Actually reading the code first"
}
}Specific template:
{
"name": "compose_meme",
"arguments": {
"text": "One does not simply | Write documentation without bugs",
"template": "mordor"
}
}Smart text parsing:
{
"name": "compose_meme",
"arguments": {
"text": "When you find out the README describes a completely different project than what the code actually does"
}
}Template Selection Intelligence
The compose tool includes smart template selection based on text content:
- Choice/comparison text (vs, or, choose) → Two Buttons template
- Intelligence/brain text → Expanding Brain template
- "Fine" or disaster text → This is Fine template
- "Change my mind" text → Change My Mind template
- Distraction/comparison → Distracted Boyfriend template
- And many more patterns...
Text Encoding
The server automatically handles special character encoding for URLs:
- Spaces become underscores
- Special characters are properly escaped
- Line breaks and formatting are preserved
API Integration
This server uses the Memegen.link API which provides:
- 200+ popular meme templates
- High-quality image generation
- Customizable text styling
- Optional API key for watermark removal
Development
pnpm run clean- Remove build artifactspnpm run build- Build TypeScript to JavaScriptpnpm run dev- Run in development modepnpm run watch- Run with file watching
Publishing
This package is automatically published to npm via GitHub Actions when a new version tag is pushed.
For Maintainers
- Update the version in
package.json(follow semantic versioning) - Update the repository URLs in
package.jsonto match your actual GitHub repository - Set up NPM_TOKEN secret in your GitHub repository:
- Go to npm.com → Access Tokens → Generate New Token (Automation)
- Add the token as
NPM_TOKENin your GitHub repository settings → Secrets and variables → Actions
- Create and push a version tag:
git tag v1.0.1 git push origin v1.0.1 - The GitHub Action will automatically:
- Build the TypeScript code
- Run tests (if any)
- Publish to npm
Manual Publishing
For manual publishing (not recommended for production):
pnpm run build
pnpm publishLicense
MIT
