Skip to main content

MCP server for searching and downloading stock images (Unsplash, Pexels, Pixabay, Freepik, StockVault, Burst) via LLM tool calls

Project description

stock-image-mcp

An MCP server that lets Claude Code (or any MCP-compatible agent) search and download stock images by tool call — useful for sourcing images while writing SEO blog posts or other content.

Providers

Provider API type Requires key Default rate limit
Unsplash Official Yes 50/hr demo, 5000/hr production
Pexels Official Yes 200/hr
Pixabay Official Yes 100 req/60s
Freepik Official Yes configurable (plan-dependent)
StockVault Official Yes configurable (undocumented, conservative default)
Burst (Shopify) Unofficial scrape No self-imposed, polite default

Burst has no public API. It's included as a best-effort HTML scraper, clearly marked unsupported in code — any failure there is caught and reported as an empty result rather than breaking search_all_images.

Install

Each user runs the server locally and supplies their own provider API keys — there's no shared hosting or centrally-held keys.

Add it to your Claude config with uvx (no clone or install step required — uvx fetches the package from PyPI on first run):

{
  "mcpServers": {
    "stock-image-mcp": {
      "command": "uvx",
      "args": ["stock-image-mcp"],
      "env": {
        "PEXELS_API_KEY": "...",
        "UNSPLASH_ACCESS_KEY": "..."
      }
    }
  }
}

Any provider env var you omit is simply skipped by search_all_images and rejected if queried directly via search_stock_images — see .env.example for the full list of supported keys.

Tools

  • search_stock_images(query, provider="default", orientation=None, per_page=10, page=1)
  • search_all_images(query, orientation=None, per_page=5) — fans out to every configured provider concurrently
  • get_best_image(query, provider="default")
  • download_image(url, dest_path, provider=None) — saves locally, returns attribution text if the image came from a prior search
  • get_attribution(provider, image_id)
  • get_rate_limit_status(provider=None)

Developing locally

Working from a clone instead of the published package:

uv sync
cp .env.example .env   # fill in the API keys for providers you want enabled
uv run stock-image-mcp

Point your Claude config at the local checkout instead of uvx:

{
  "mcpServers": {
    "stock-image-mcp": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/stock-image-mcp", "run", "stock-image-mcp"],
      "env": {
        "PEXELS_API_KEY": "...",
        "UNSPLASH_ACCESS_KEY": "..."
      }
    }
  }
}

Development

uv run pytest              # test suite (mocked HTTP, no live keys needed)
uv run ruff check .         # lint
uv run ruff format .        # format
uv run mypy src             # type check

To try it against real providers, use the MCP Inspector:

npx @modelcontextprotocol/inspector uv run stock-image-mcp

Releasing

Publishing to PyPI is handled by .github/workflows/publish.yml, triggered by pushing a v* tag (e.g. v0.1.0). It runs lint/type-check/tests, builds the package, then publishes via PyPI's trusted-publisher (OIDC) flow — no token stored in CI.

One-time setup on PyPI (before the first tagged release): add a "pending publisher" at https://pypi.org/manage/account/publishing/ with PyPI project name stock-image-mcp, repo owner Hasilt, repo name images-mcp, workflow filename publish.yml, and environment pypi. PyPI creates the project automatically on the first successful run of that workflow.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stock_image_mcp-0.1.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stock_image_mcp-0.1.1-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file stock_image_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: stock_image_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for stock_image_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cba20c0a94a91d13e0a768c9f1358fe9af2095ec4c12293e98e7e30aa90f7f73
MD5 aa2993dcecd04d7eec05371459822b7b
BLAKE2b-256 d1b331291ffaa8387df26beeec05a8125ed166e9e31dbdeb4e38371ea8deb151

See more details on using hashes here.

Provenance

The following attestation bundles were made for stock_image_mcp-0.1.1.tar.gz:

Publisher: publish.yml on Hasilt/images-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stock_image_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: stock_image_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for stock_image_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9e7e08fd18d69b0a3ac46866a46032731a54d4364d74c44ac9b6a832759205e
MD5 79ea9a087fc97000831ab31aaddaca0d
BLAKE2b-256 94922ee9430c1711b2e79836e5cc765842eecf2d7ac2491afe9f6bb4eead01bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for stock_image_mcp-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Hasilt/images-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page