ADK 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 "google-adk[mcp]"
npm install @google/adk @modelcontextprotocol/sdk
npm install -D @google/adk-devtools
export PEXAFY_API_KEY="pexafy_..."   # free key: pexafy.com/dashboard/api-keys/create
export GOOGLE_API_KEY="..."          # Gemini API key
The MCP tools need the mcp extra in Python and @modelcontextprotocol/sdk in TypeScript.

Use

import os

from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams

root_agent = Agent(
    model="gemini-flash-latest",
    name="pexafy_agent",
    instruction="Find free stock photos for the user and give each photo's credit line.",
    tools=[
        McpToolset(
            connection_params=StreamableHTTPConnectionParams(
                url="https://mcp.pexafy.com/mcp",
                headers={"Authorization": f"Bearer {os.environ['PEXAFY_API_KEY']}"},
            ),
            tool_filter=["search_photos", "search_photos_by_image"],
        )
    ],
)
import { LlmAgent, MCPToolset } from "@google/adk";

export const rootAgent = new LlmAgent({
  model: "gemini-flash-latest",
  name: "pexafy_agent",
  instruction: "Find free stock photos for the user and give each photo's credit line.",
  tools: [
    new MCPToolset(
      {
        type: "StreamableHTTPConnectionParams",
        url: "https://mcp.pexafy.com/mcp",
        transportOptions: {
          requestInit: { headers: { Authorization: `Bearer ${process.env.PEXAFY_API_KEY}` } },
        },
      },
      ["search_photos", "search_photos_by_image"],
    ),
  ],
});
Run it: adk run pexafy_agent in Python (the folder also needs an __init__.py containing from . import agent), npx adk run pexafy_agent.ts in TypeScript. The tool filter keeps the two search tools. The other tools are for chat clients, where a person views a photo grid or links an account. On the free plan, show the credit line next to each photo you publish. See MCP server for the full tool list.