This project is an advanced Sema4ai Action Server that automatically generates and posts custom "Yo Dawg" meme comments (with images) on LinkedIn posts using the Model Context Protocol (MCP).
- π€ Autonomous meme generation and posting
- πΌοΈ AI-generated meme images with custom captions
- π‘ Powered by Model Context Protocol (MCP)
- π― Official signature for every comment
- Robust browser automation using Playwright via Robocorp
- The action visits a LinkedIn post URL.
- It extracts the post content and generates a "Yo Dawg" meme caption using AI.
- It creates a meme image with the caption and uploads it as a comment.
- The comment includes an official signature:
π― This content was generated by The Yo Dawg Sema4ai Action Server π‘ Powered by Model Context Protocol (MCP) π€ Autonomous meme generation system active
This action server exposes several callable actions via MCP:
Generate only the Yo Dawg meme caption from provided content. Parameters:
yo_dawg_content(str): The content to transform into a Yo Dawg meme caption.model(str, required): Model name to use for generation (e.g.,gpt-4o-mini,ollama:phi4). Returns: Caption string.
Generate and post a Yo Dawg meme comment on LinkedIn by creating a new image. Parameters:
post_url(str, optional): The LinkedIn post URL to comment on.custom_context(str, optional): Custom context string for meme generation.append_custom_context(bool): If true, appends custom context to LinkedIn post content.model(str, required): Model id to use for caption/image generation. No default. Returns: Result message and generated image.
Generate and post a Yo Dawg meme comment on LinkedIn by overlaying text on a static image. Parameters:
post_url(str, optional): The LinkedIn post URL to comment on.custom_context(str, optional): Custom context string for meme generation.append_custom_context(bool): If true, appends custom context to LinkedIn post content.model(str, required): Model id to use for caption generation (OpenAI orollama:<name>). No default. Returns: Result message and generated image.
- Meme image and caption generation (
yo_dawg_generator,YoDawgImageGenerator) - LinkedIn post content extraction
- Browser automation for posting comments
- See
src/yodawg/yo-dawg-actions.pyfor main action logic and all callable actions. - Actions can be triggered via MCP endpoints or Sema4ai agent tool access.
- Images are saved in the
yo-dawg-images/directory.
action-server startsrc/yodawg/yo-dawg-actions.py: Main action logic and all MCP actionssrc/yodawg/image_generation.py: Meme caption and image generationsrc/yodawg/models.py: Data modelsyo-dawg-images/: Generated meme images
See LICENSE for details.
Sema4ai Action Server exposes your Python actions as MCP tools, resources, and prompts, making them accessible to AI agents via standardized endpoints. The server automatically generates an OpenAPI spec and provides both synchronous and streaming access.
- /mcp: Standard MCP protocol over HTTP. Synchronous requests for tool, resource, and prompt calls.
- /sse: MCP protocol over Server-Sent Events. Streaming, real-time responses for agents needing live updates or long-running calls.
-
Start the Action Server:
action-server start
By default, endpoints are available at
http://localhost:8000/mcpandhttp://localhost:8000/sse. -
Authentication:
- If started with
--api-key, includeAuthorization: Bearer <api-key>in your requests.
- If started with
-
Calling Tools, Resources, and Prompts:
- List available tools:
- HTTP:
POST http://localhost:8000/mcpwith{ "method": "tools/list" } - SSE: Connect to
http://localhost:8000/sseand send{ "method": "tools/list" }
- HTTP:
- Call a tool:
- HTTP:
POST http://localhost:8000/mcpwith{ "method": "tools/call", "params": { "name": "your_tool_name", "arguments": { ... } } }
- HTTP:
- Read a resource:
- HTTP:
POST http://localhost:8000/mcpwith{ "method": "resources/read", "params": { "uri": "resource_uri" } }
- HTTP:
- Get a prompt:
- HTTP:
POST http://localhost:8000/mcpwith{ "method": "prompts/get", "params": { "name": "prompt_name", "arguments": { ... } } }
- HTTP:
- List available tools:
-
SSE Streaming Example (Python):
import requests import sseclient url = "http://localhost:8000/sse" headers = {"Authorization": "Bearer <api-key>"} response = requests.post(url, headers=headers, data='{"method": "tools/list"}', stream=True) client = sseclient.SSEClient(response) for event in client.events(): print(event.data)
- Tool names are now just the action name (not
<package>/<action>). - Both endpoints support all MCP features: tools, resources, prompts.
- See Sema4ai Action Server MCP docs and MCP Python SDK for more details.
-
Start the Action Server:
action-server start
This will expose the MCP endpoint URL and a bearer token in your terminal output.
-
Connect your agent or client:
- Use the exposed MCP endpoint URL and bearer token to authenticate requests.
- Most Sema4ai agents and tools support direct connection via the "Connect Action Server" workflow.
-
Call Actions Remotely:
- Use the MCP endpoint to invoke any of the documented actions (see above) from your agent, automation, or external tool.
- Supported transports include HTTP and Server-Sent Events (SSE) for real-time tool access.
curl -X POST \
-H "Authorization: Bearer <your_token>" \
-H "Content-Type: application/json" \
-d '{"action": "generate_yo_dawg_quote_only", "yo_dawg_content": "Your text here"}' \
<your_mcp_endpoint_url>/mcp/- MCP integration enables your AI agents to access a growing ecosystem of tools and data sources, including community and enterprise actions.
- You can deploy the server locally or remotely, and connect agents (like Claude, GPT, etc.) to automate meme generation and posting.
- For more details, see Sema4ai Actions documentation.
For more information, see the Sema4ai Actions documentation.