Skip to main content

How to give your coding agent real images

Coding agents write a whole landing page in a minute and then fill every image slot with a gray box, a stock placeholder service, or a URL they made up that returns 404. The fix is to give the agent an image search tool. With the Lightdrift MCP server connected, the agent searches 1.85 million openly licensed photos, downloads the one that fits, and adds the credit line the license asks for.

Updated

1. Connect the image search MCP server

Claude Code
claude mcp add --transport http lightdrift https://lightdrift.ai/mcp
Codex
codex mcp add lightdrift --url https://lightdrift.ai/mcp
codex mcp login lightdrift
Cursor
{
  "mcpServers": {
    "lightdrift": { "url": "https://lightdrift.ai/mcp" }
  }
}

2. Tell the agent how to use images

AGENTS.md
## Images

- Never use placeholder images or invent image URLs.
- When a page needs a photo, call the lightdrift search_images tool with a
  specific description of the subject, framing, and mood.
- Download the chosen file into public/images/ and reference it locally.
- If attribution_required is true, render the attribution string in a
  <figcaption> or in a credits section linked from the footer.
- Only use results where commercial is true for commercial projects.

3. Ask for specific images

4. Handle licenses and attribution