Connect from Claude Code
https://api.stockphotomcp.com/mcp- 1
Add the server
Add the server over streamable HTTP with the Claude Code CLI:
claude mcp add --transport http stock-photos https://api.stockphotomcp.com/mcpTo remove it later: claude mcp remove stock-photos
- 2
Sign in
Adding the server doesn't sign you in, and Claude Code won't prompt you on its own — until you authorize once, its tools stay hidden from the agent. Run the sign-in:
claude mcp login stock-photosPrefer to stay in the session? Run /mcp and pick stock-photos instead. Either way a browser opens to approve with Google, and the token is saved, so you only do this once. One caveat: in a devcontainer, over SSH, or anywhere the browser can't reach the local callback, this step hangs instead of finishing. That's expected in those setups, so use the API key path below.
- 3
Try it
In your next session, brief it the way you'd brief a designer ("a cardiology patient-support hero, senior couple, warm light"), and the agent searches, reads the contact sheet, and places a watermarked preview with its attribution and license link.
Headless, agents, and CI
Some clients have no browser to open, so the interactive sign-in can't run: a coding agent in a devcontainer, a CI job, a cron worker, a server-side script. An API key covers all of them. The server checks it as a bearer token on every request, with no sign-in step, so an agent connects on its own.
Mint a key in your dashboard (you'll see it once), then keep it in an environment variable named STOCK_PHOTO_MCP_KEY so the secret never lands in committed config.
For a repo an agent works in, commit a .mcp.json that reads the key from that variable. Every session in the project gets the tools with nothing to run:
{
"mcpServers": {
"stock-photos": {
"type": "http",
"url": "https://api.stockphotomcp.com/mcp",
"headers": {
"Authorization": "Bearer ${STOCK_PHOTO_MCP_KEY}"
}
}
}
}On a single machine, one command does it instead. The shell fills in the key from the same variable, and Claude Code stores the server in your config:
claude mcp add --transport http stock-photos https://api.stockphotomcp.com/mcp --header "Authorization: Bearer $STOCK_PHOTO_MCP_KEY"The .mcp.json form keeps the token in the environment and out of the file, so it's safe to commit. Claude Code asks you to approve the workspace the first time it connects to a project .mcp.json. A raw Authorization: Bearer spm_your_api_key header works for any other client that lets you set one.