peninglab-mcp
v0.1.0
Published
MCP server for peninglab.com — generate images and videos from any AI agent that supports the Model Context Protocol.
Maintainers
Readme
peninglab-mcp
MCP server for peninglab.com — generate images and videos from any AI agent that supports the Model Context Protocol.
Each user mints their own API key on peninglab.com and bills their own credits. Keys are not shared.
What it does
Exposes 5 tools to your AI agent:
generate_image({ model, prompt, image_urls?, aspect_ratio? })— fires an image generation and returns the final URL.generate_video({ model, prompt, image_urls?, image_mode?, duration?, aspect_ratio? })— fires a video generation and returns the final URL.list_models()— list available models with current rates and per-model constraints (duration rules, image_urls limits, supported modes).get_balance()— current credit balance (RM).get_status({ task_id })— look up a task by ID (for long-running jobs).
The generate_* tools wait for completion internally — they poll every 60 seconds for up to 10 minutes by default, then return the final URL synchronously to the AI agent. No webhook infrastructure required.
Setup
1. Get an API key
- Sign up / sign in at peninglab.com
- Open https://peninglab.com/dashboard/mcp
- Name your key (e.g. "My laptop", "ProjectX") and click Generate Key
- Copy the plaintext
pl_live_...value — it's shown only once
You can mint multiple keys (one per project / machine) and revoke any of them individually without affecting the others. Every key bills your RM credit balance.
2. Install + configure
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"peninglab": {
"command": "npx",
"args": ["-y", "peninglab-mcp"],
"env": {
"PENINGLAB_API_KEY": "pl_live_..."
}
}
}
}Cursor (~/.cursor/mcp.json): same shape.
Claude Code (.mcp.json in your project root or ~/.claude.json for global): same shape.
Restart your MCP client → the 5 tools become available.
Configuration
Environment variables (all optional except PENINGLAB_API_KEY):
| Variable | Default | Purpose |
|---|---|---|
| PENINGLAB_API_KEY | (required) | Your pl_live_... key from /dashboard/mcp |
| PENINGLAB_BASE_URL | https://peninglab.com | Override for staging / self-hosted instances |
| PENINGLAB_POLL_INTERVAL_SEC | 60 | How often to poll task status |
| PENINGLAB_MAX_WAIT_SEC | 600 | Max wait per generate call before timing out |
Costs
MCP-triggered generations charge the same RM rate as UI-triggered ones from your peninglab.com account. The tool result includes cost (this call) and balance (remaining credits) so your AI agent can decide what to do next.
For AI agents
See AGENT.md (shipped with this package) for a complete operating manual you can paste into your AI client's system prompt — covers tool signatures, model picking, constraint discovery, cost discipline, and error handling.
License
MIT.
