Claude Agent SDK agents use Pexafy through its MCP server, https://mcp.pexafy.com/mcp, with your API key in the Authorization header. The agent searches free-to-use photos (Unsplash, Pexels, Pixabay and more) and gets each one back with its licence and credit line.

Install

pip install claude-agent-sdk
npm install @anthropic-ai/claude-agent-sdk
export PEXAFY_API_KEY="pexafy_..."   # free key: pexafy.com/dashboard/api-keys/create
export ANTHROPIC_API_KEY="sk-ant-..."

Use

import asyncio
import os

from claude_agent_sdk import ClaudeAgentOptions, ResultMessage, query

options = ClaudeAgentOptions(
    mcp_servers={
        "pexafy": {
            "type": "http",
            "url": "https://mcp.pexafy.com/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['PEXAFY_API_KEY']}"},
        }
    },
    allowed_tools=["mcp__pexafy__search_photos", "mcp__pexafy__search_photos_by_image"],
)


async def main():
    async for message in query(
        prompt="Find a header photo for a post about remote work, with its credit line.",
        options=options,
    ):
        if isinstance(message, ResultMessage):
            print(message.result)


asyncio.run(main())
import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "Find a header photo for a post about remote work, with its credit line.",
  options: {
    mcpServers: {
      pexafy: {
        type: "http",
        url: "https://mcp.pexafy.com/mcp",
        headers: { Authorization: `Bearer ${process.env.PEXAFY_API_KEY}` },
      },
    },
    allowedTools: ["mcp__pexafy__search_photos", "mcp__pexafy__search_photos_by_image"],
  },
})) {
  if (message.type === "result" && message.subtype === "success") console.log(message.result);
}
The allowed_tools (Python) and allowedTools (TypeScript) options let the agent call the two search tools without asking for permission. MCP tools are named mcp__<server>__<tool>. On the free plan, show the credit line next to each photo you publish. See MCP server for the full tool list.