Command Line and MCP#
memeplotlib ships two entry points besides the Python API: a command-line tool for scripts and shells, and a Model Context Protocol (MCP) server for AI assistants.
Command line#
The memeplotlib command (also python -m memeplotlib) has four
subcommands:
memeplotlib list # every memegen template ID and name
memeplotlib search dog # templates matching a keyword
memeplotlib info buzz # caption slots, styles, keywords
memeplotlib meme buzz "hello" "world" -o hello.png
meme accepts the template (a memegen ID, an image path, or a URL)
followed by one argument per caption slot. Useful options:
-o / --out PATHOutput file (default
meme.png).--font,--color,--style {upper,lower,none},--fontsizeCaption styling.
--backend {auto,memegen,pillow,matplotlib}Force a rendering backend.
--ext,--width,--height,--layout,--background,--template-styleOptions forwarded to the memegen service.
--dpiResolution of the saved file.
Run memeplotlib meme --help for the full list. Listings print as plain
aligned text columns, which read cleanly in screen readers and pipe well
into grep/awk.
MCP server#
Install the optional extra and start the server over stdio:
pip install "memeplotlib[mcp]"
memeplotlib-mcp
Register it with any MCP client that supports the stdio transport. For example, Claude Code:
claude mcp add memeplotlib -- memeplotlib-mcp
The server exposes three tools:
memeRender a meme and return it as MCP image content, so clients show it inline. A text block and the structured result carry
path(the saved file) andalt_text. Takes the template,top/bottom(orlines) captions, and the same styling options asmeme().search_templatesSearch the memegen catalog by ID, name, or keyword.
list_templatesReturn every template’s ID and name.