DEV Community

PopNow
PopNow

Posted on AI-assisted

Generate AI images, videos and music from Claude Code, Cursor or VS Code with one remote MCP server

Coding agents are good at writing the landing page. They're bad at the parts that aren't code: the hero image, the 5-second product loop, the background track for the demo video. Usually you leave the editor, open three different generator sites, download files, and drag them back into public/.

This tutorial connects one remote MCP server to your agent so it can make those assets itself, inside the same session. I'll use PopNow's hosted server because it covers image, video, music and speech behind one sign-in, but most of what follows (OAuth discovery, quote-then-confirm, async jobs) applies to any paid, hosted MCP server.

Disclosure: I work on PopNow. Everything below works with a normal PopNow account; prices are in the table near the end with sources.

What you'll have at the end

  • A remote MCP server connected to Claude Code, Cursor or VS Code (no local process, no API key in a config file)
  • An agent that can call create_image, create_video, create_music and create_speech
  • A small workflow: "build a landing page and make its hero video" in one prompt

1. Connect the server

The server URL is https://api.popnow.ai/mcp. It speaks Streamable HTTP and signs you in with OAuth 2.1, so there is nothing to install.

Claude Code

claude mcp add --transport http popnow https://api.popnow.ai/mcp
Enter fullscreen mode Exit fullscreen mode

Then run /mcp inside Claude Code, pick popnow and authenticate. A browser tab opens, you sign in and press Allow.

Cursor (.cursor/mcp.json in the project, or ~/.cursor/mcp.json globally)

{
  "mcpServers": {
    "popnow": { "url": "https://api.popnow.ai/mcp" }
  }
}
Enter fullscreen mode Exit fullscreen mode

VS Code (.vscode/mcp.json; note the top-level key is servers)

{
  "servers": {
    "popnow": { "type": "http", "url": "https://api.popnow.ai/mcp" }
  }
}
Enter fullscreen mode Exit fullscreen mode

Claude on the web or desktop: Customize → Connectors → Add custom connector, name it PopNow, paste the URL, leave the advanced OAuth fields empty.

Configs for Windsurf, Cline, Codex CLI and others are in the popnow-mcp repo.

2. What actually happens during sign-in

If you've only used local stdio servers, remote OAuth can feel like magic. It isn't, and knowing the steps makes debugging much easier. You can replay them with curl.

Step 1: the client calls the server without a token and gets a 401.

curl -i -X POST https://api.popnow.ai/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
# HTTP/2 401
# www-authenticate: Bearer resource_metadata="https://api.popnow.ai/.well-known/oauth-protected-resource/mcp", scope="generate read"
Enter fullscreen mode Exit fullscreen mode

Step 2: it follows resource_metadata from that header to find out who issues tokens:

curl -s https://api.popnow.ai/.well-known/oauth-protected-resource/mcp
Enter fullscreen mode Exit fullscreen mode
{
  "resource": "https://api.popnow.ai/mcp",
  "authorization_servers": ["https://api.popnow.ai"],
  "scopes_supported": ["generate", "read"],
  "bearer_methods_supported": ["header"]
}
Enter fullscreen mode Exit fullscreen mode

Step 3: it reads the authorization server metadata:

curl -s https://api.popnow.ai/.well-known/oauth-authorization-server
Enter fullscreen mode Exit fullscreen mode

The parts that matter: registration_endpoint (so the client can register itself, RFC 7591 dynamic client registration), code_challenge_methods_supported: ["S256"] (PKCE is required) and client_id_metadata_document_supported: true.

Step 4: the client registers, opens the authorize page with a PKCE challenge, and swaps the code for a token. From then on every MCP request carries Authorization: Bearer ....

That's why you never paste a key: the client does all four steps on its own. If a client claims it "can't connect", check which step fails. A missing www-authenticate header or a metadata URL that 404s is the usual culprit when you build your own server.

The two scopes are worth copying in your own servers: read (balance, history, model list) and generate (spend money). A connection approved without generate can look around but can't charge you.

3. First generation

Ask in plain words:

Make a 16:9 picture of a paper boat on a rainy window sill, soft morning light.
Enter fullscreen mode Exit fullscreen mode

The agent calls create_image. Images return inline as a preview plus a download link, and every result also gets a permanent popnow:// link you can feed to the next tool:

Now turn that picture into a 5-second video with a slow push-in.
Enter fullscreen mode Exit fullscreen mode

That's create_video with image_url set to the popnow:// link from the previous step. No downloading and re-uploading.

Useful read-only tools while you explore:

Tool Use
list_models Every image, video and audio model with its price (category: image, video, audio, effects)
check_balance Credits left, and how many are held for running jobs
list_my_creations Recent results with links
get_job Collect a result that's still rendering

4. The two patterns that make paid tools safe for agents

Giving an autonomous agent a tool that spends money is the part people worry about. Two patterns handle it, and they're worth stealing for any MCP server that costs money.

Quote first, confirm above a threshold

Every generation tool takes an optional max_credits. Small jobs (up to 300 credits, i.e. $0.30) start right away. Anything bigger doesn't start: the tool answers with the price and your balance instead.

You:        Make a 9:16 video of a vintage car on a coast road at golden hour, 10 seconds.
Assistant:  (create_video → "Needs confirmation: costs 370 credits, balance 8450")
            That's 370 credits. Go ahead?
You:        Yes.
Assistant:  (create_video again with max_credits: 370 → job_id)
Enter fullscreen mode Exit fullscreen mode

The confirmation is enforced by the server, not by the model being polite. If the price moved between the quote and the retry, nothing is charged and you get the new price. Failed jobs are refunded automatically.

Async jobs instead of long-held requests

Most videos take one to three minutes, much longer than you want an HTTP request to hang. The tool waits up to about 40 seconds; if the result isn't ready it returns a job_id, and the agent calls get_job (which can wait up to 50 seconds per call) until it's done.

One more detail that saves money: identical calls from the same account within ten seconds become one job, so an agent that retries after a timeout doesn't pay twice.

5. A real workflow: landing page plus hero video

Here's the prompt I use in Claude Code when scaffolding a marketing page:

Build a single-page landing page for "Driftwood", a note-taking app, in Next.js.
For the hero:
1. Use PopNow create_image to make a 16:9 still of a calm desk by a window, notebook open, morning light.
2. Turn it into a 5-second looping video with create_video (slow push-in, no text).
3. Download both into public/hero/ and use the image as the <video> poster.
4. Make a 30-second calm instrumental with create_music for the demo page and save it to public/audio/.
Show me the price before anything over 300 credits.
Enter fullscreen mode Exit fullscreen mode

What to expect on the default models:

  1. create_image: about 48 credits, returned inline
  2. create_video with the popnow:// link from step 1: about 185 credits for 5 seconds, returns a job_id that the agent polls with get_job
  3. create_music with instrumental: true: about 72 credits
  4. The agent writes the files into public/ and wires up a <video autoplay muted loop playsinline poster=...> hero

Total: about 305 credits, roughly $0.31, without leaving the editor. Each step is under the 300-credit threshold, so nothing pauses for confirmation unless you ask for a longer or higher-resolution clip.

Tip: tell the agent which model to use when it matters ("use Seedance 2.5 for the video", "use Nano Banana for the still"). Every generation tool takes a model id from list_models.

6. What it costs, compared with going direct

The same model costs different amounts on different platforms. Here's one model at one setting, from the AI Video & Image Price Index (November 2026, public self-serve list prices, every row links to its source):

Seedance 2.5, text-to-video, 720p with audio, one 5-second clip

Platform Price
PopNow (pay-as-you-go) $1.39
Runway API $1.50
Higgsfield API $2.31
fal $2.37

Prices change monthly; the index page has the full table, plus a CSV and JSON under CC BY 4.0 if you want to build your own comparison. PopNow credits are $0.001 each with no subscription; bigger packs add bonus credits.

Troubleshooting

Symptom Fix
"Please connect your PopNow account first." The tool ran before sign-in finished. Reconnect from /mcp (Claude Code) or the client's MCP settings
"This connection wasn't given permission to do that." You approved without the generate scope. Disconnect, reconnect, press Allow
405 Method Not Allowed The server is stateless: POST only. Any MCP client does this for you; only hand-rolled clients hit it
Cline connects but no tools work Add "type": "streamableHttp", otherwise Cline falls back to legacy SSE
"Too many creations at once" More than 20 new jobs in a minute. Nothing was charged; wait the seconds in the message

Wrap-up

  • Remote MCP + OAuth means no keys in dotfiles and no local process to keep alive.
  • For any tool that spends money, put the confirmation in the server (quote, threshold, max_credits), not in the prompt.
  • Return job ids for anything slow, and de-duplicate retries.

Setup docs for every client: popnow.ai/mcp. Source for the configs: github.com/popnow-ai/popnow-mcp. If you build something with it, I'd like to see it in the comments.

Top comments (0)