webfetch
webfetch
AIエージェントと人間のための、ライセンス優先型画像レイヤー。
1つのMCPサーバー、1つのCLI、1つのHTTPサーバーが25の画像プロバイダーを統合し、ライセンスを優先して結果をランク付けし、デフォルトで UNKNOWN(不明)な結果を拒否します。MCPに対応したエージェント(Claude Code、Cursor、Cline、Continue、Roo Code、Codexなど)は、1行の設定で接続可能です。ランディングページ、価格設定、ホスト型サービスの利用については getwebfetch.com をご覧ください。
インストール
インターフェース | ワンライナー | ||
npm |
| ||
Homebrew |
| ||
Docker |
| ||
curl | bash | `curl -fsSL https://raw.githubusercontent.com/ashlrai/webfetch/main/install/install.sh | bash` |
curl | bash インストーラーは、Claude Codeの ~/.claude/settings.json にもwebfetchを自動的に設定します。いつでも再実行して更新可能です。
Related MCP server: visual-image-search-mcp
30秒でわかる使い方
CLI:
webfetch search "drake portrait" --limit 5
webfetch artist "Taylor Swift" --kind portrait --min-width 1200
webfetch download <url> --out ./portrait.jpg
printf "drake portrait\nradiohead album\n" | webfetch batch --jsonl --continue-on-errorMCP (MCP対応エージェント内から):
search_images({ query: "drake portrait", limit: 5 })
search_artist_images({ artist: "Taylor Swift", kind: "portrait" })
download_image({ url: "..." })TypeScriptライブラリ:
import { searchArtistImages, pickBest, downloadImage } from "webfetch-core";
const { candidates } = await searchArtistImages("Drake", "portrait");
const best = pickBest(candidates, { minWidth: 1200 });
if (best) {
const { cachedPath, sha256 } = await downloadImage(best.url);
console.log(best.attributionLine, "->", cachedPath);
}解決する課題
手動で画像を調達する場合、4つの失敗モードがあります:
ライセンスが不明なため、安全に結果を出荷できない。
スクリプト化できない — 新しいサイトごとに午後の時間を費やすことになる。
Google画像検索APIが廃止された — スクレイピングは壊れやすく、利用規約(ToS)のグレーゾーンである。
共有キャッシュがない — 同じファイルを何度もダウンロードし直すことになる。
webfetchは、安定した利用規約と構造化されたライセンスメタデータを持つ直接ソースAPIを統合し、ライセンスを優先して候補をランク付けし、結果を単一のMCPツールとして公開することで、これら4つの問題を解決します。
プロバイダー
プロバイダー | 対象 | デフォルトライセンス | 認証 | オプトイン |
wikimedia | ポートレート、イベント、ロゴ、歴史 | CC_BY_SA (メタデータ) | — | いいえ |
openverse | CCライセンスコンテンツ全般 | CC_BY (メタデータ) | — | いいえ |
unsplash | 高品質写真 |
|
| いいえ |
pexels | ストックフォト |
|
| いいえ |
pixabay | ストックフォト + イラスト |
|
| いいえ |
itunes | アルバムカバー、アーティストポートレート | EDITORIAL_LICENSED | — | いいえ |
musicbrainz-caa | 標準アルバムアート | EDITORIAL_LICENSED | — | いいえ |
spotify | アーティスト + アルバム画像 | EDITORIAL_LICENSED |
| いいえ |
youtube-thumb | 動画サムネイル | EDITORIAL_LICENSED | — | はい |
brave | 一般的なWeb画像検索 | UNKNOWN (+ヒューリスティック) |
| いいえ |
bing | 一般的なWeb画像検索 | UNKNOWN (+ヒューリスティック) |
| はい |
serpapi | Google画像検索 + 逆画像検索 | UNKNOWN (+ヒューリスティック) |
| はい |
browser | ヘッドレスフォールバック vs images.google.com | UNKNOWN | — | はい |
managed-browser | Bright Data管理ブラウザフォールバック | UNKNOWN |
| はい |
flickr | CC / パブリックドメイン写真 | CC_BY (メタデータ) |
| いいえ |
internet-archive | パブリックドメイン / CCアーカイブメディア | PUBLIC_DOMAIN | — | いいえ |
smithsonian | オープンアクセス博物館メディア | CC0 |
| いいえ |
nasa | NASA画像 | PUBLIC_DOMAIN | — | いいえ |
met-museum | メトロポリタン美術館オープンアクセス | CC0 | — | いいえ |
europeana | 欧州文化遺産 | CC_BY (メタデータ) |
| いいえ |
library-of-congress | 米国歴史アーカイブ | PUBLIC_DOMAIN | — | いいえ |
wellcome-collection | 医療/歴史画像 | CC_BY (メタデータ) | — | いいえ |
rawpixel | CC0ストック素材 | CC0 |
| いいえ |
burst | Shopify Burstストックフォト | CC0 | — | いいえ |
europeana-archival | Europeanaテキスト/原稿記録 | CC_BY (メタデータ) |
| はい |
注意点やレート制限については docs/PROVIDERS.md を、ユースケースごとの選択については docs/PROVIDER_TUNING.md を参照してください。
ローカルモードとクラウドモード
CLIはローカルファーストです。デフォルトでは webfetch search、artist、album、download、probe、license、batch はプロセス内で webfetch-core を呼び出し、環境変数からプロバイダーのAPIキーを使用します。--cloud を渡すか WEBFETCH_MODE=cloud を設定すると、WEBFETCH_API_KEY または webfetch config set apiKey wf_live_... を使用して https://api.getwebfetch.com/v1/* を呼び出します。
直接プロバイダーを呼び出し、ローカルキャッシュを利用したい場合はローカルモードを使用してください。ホスト型の認証、プロバイダーキーのプール、管理ブラウザのフォールバック、使用量管理、チーム制御が必要な場合はクラウドモードを使用してください。
なぜ「ライセンス優先」なのか
私たちがデフォルトで拒否する唯一の結果は、正当性を証明できない画像です。ライセンスが不明な、わずかに見栄えが良いだけの写真は、人間のレビューなしで出荷する必要があるパイプラインにとっては無価値です。関連性の順位付けは簡単ですが、出所の証明はそうではありません。
ランキングは以下の順序で行われます:ライセンスタグ -> メタデータの信頼性 -> 解像度 -> プロバイダーの優先度。UNKNOWN はデフォルトで拒否されます(ベルヌ条約:Web上のほとんどのコンテンツは、証明されない限り「全権利留保」とみなされます)。詳細は docs/LICENSE_POLICY.md を参照してください。
移行:CC0ストックプロバイダー
以前のwebfetchビルドでは、Unsplash、Pexels、Pixabayを CC0 として扱っていました。現在のビルドでは、各プラットフォームの利用規約を明示的に公開しています:
旧タグ | 新タグ | 確認事項 |
|
| Unsplashの利用規約(Creative Commonsではありません) |
|
| Pexelsの利用規約(Creative Commonsではありません) |
|
| Pixabayの利用規約(Creative Commonsではありません) |
ほとんどの呼び出し元は、licensePolicy: "safe-only" を維持すべきです。これにより、オープン、プラットフォームライセンス、エディトリアル、プレス向けカテゴリを許可しつつ、UNKNOWN を拒否できます。Creative Commonsまたはパブリックドメインの資産のみを必要とするパイプラインは、licensePolicy: "open-only" を使用し、3つのプラットフォームタグを個別に処理するように型ガードを更新してください。
webfetchと代替手段の比較
機能 | webfetch | Google画像検索(生) | Unsplashのみ | Bing CSE |
API経由でスクリプト化可能 | はい | いいえ (廃止) | はい | はい |
結果ごとのライセンスメタデータ | はい | いいえ | はい (1種のみ) | 部分的 |
エディトリアル音楽アートをカバー | はい | 部分的 | いいえ | 部分的 |
CC / パブリックドメインをカバー | はい | いいえ | いいえ | いいえ |
デフォルトで安全 (UNKNOWNを拒否) | はい | 該当なし | 該当なし | いいえ |
コンテンツアドレス指定可能な共有キャッシュ | はい | いいえ | いいえ | いいえ |
帰属表示行が構築済み | はい | いいえ | いいえ | いいえ |
全IDEで共通のMCP設定 | はい | いいえ | いいえ | いいえ |
デフォルトでクエリごとのコストなし | はい | 該当なし | はい | いいえ |
アーキテクチャ
+------------------+
| webfetch-core |
| (ranker, cache, |
| license coerce)|
+---------+--------+
|
+----------------+-----------+-----------+----------------+
| | | |
+-------v------+ +------v-------+ +-------v------+ +------v-------+
| webfetch | | webfetch-mcp | | webfetch- | | browser |
| CLI | | (stdio) | | server (HTTP)| | extensions |
+-------+------+ +------+-------+ +-------+------+ +------+-------+
| | | |
| | | |
+----------------+-----------+-----------+----------------+
|
+---------------------v---------------------+
| provider adapters |
| wikimedia openverse unsplash pexels |
| pixabay itunes mb-caa spotify |
| youtube brave bing serpapi |
| flickr nasa met europeana |
| loc wellcome rawpixel burst |
| browser + managed-browser + archival opt-in|
+-------------------------------------------+すべてのインターフェースは ~/.webfetch/cache/ をSHA-256でキー付けして共有しているため、CLIからのダウンロードは即座にMCPサーバーでも利用可能であり、その逆も同様です。
安全性のデフォルト設定
licensePolicy: "safe-only"— オープン、プラットフォームライセンス、エディトリアル/プレス向けカテゴリは許可され、UNKNOWNは拒否されます。safeSearch: "strict"。オプトインプロバイダー (
youtube-thumb,bing,serpapi,browser,managed-browser,europeana-archival) はデフォルトでオフ。ダウンロードごとに20MBの制限、コンテンツタイプガード、ホストブロックリスト。
一般的なページ調査では
robots.txtを尊重。
ロードマップ
webfetch watch— 繰り返しクエリや増分更新のためのデーモンモード。独自のプロバイダーを追加できるプラグインAPI。
getwebfetch.com でのホスト型ティア — プロバイダーキーのプール、管理ブラウザのフォールバック、チーム使用量ダッシュボード。
貢献
IssueやPRを歓迎します。bun install && bun test を実行して開始してください。各エリアのリファレンスドキュメントは docs/ を参照してください。
ライセンス
MIT。
Available Tools
7 toolsdownload_imageA
Download an image URL (typically from a prior search_images result) to the local disk cache. Streams with a 20MB hard cap, content-type guard, SHA-256 hash, and returns the cached file path. Host blocklist enforced.
Inputs: url (required), maxBytes, cacheDir.
fetch_with_licenseA
Given an arbitrary URL (image or webpage), determine its license via host heuristics + page metadata (, dc.rights, og tags). Set probe: true to also download the bytes. Use when an agent already has a URL and needs a go/no-go decision before shipping.
Inputs: url (required), probe.
find_similarA
Reverse-image-search: given a public image URL, find visually similar images. Requires SERPAPI_KEY env var and providers: ['serpapi']. Returns candidates with heuristic licenses — treat results as leads, not shippable.
Inputs: url (required), providers.
probe_pageA
Given a webpage URL, return every on the page with inferred dimensions and a heuristic license per image. Respects robots.txt by default. Use to triage a candidate source page before picking.
Inputs: url (required), respectRobots.
search_album_coverA
Find canonical album artwork. Uses MusicBrainz Cover Art Archive + iTunes + Spotify. Results are EDITORIAL_LICENSED — safe for album identification UI per platform ToS; always show attribution.
Inputs: artist (required), album (required), providers, safeSearch, +5 more.
search_artist_imagesA
Specialized image search for a musical artist. kind selects provider set + query expansion: 'portrait' (Wikimedia + Unsplash + Spotify), 'album' (MusicBrainz CAA + iTunes + Spotify), 'logo' (Wikimedia), 'performing' (Wikimedia + Pexels). Prefer this over search_images when building artist/band content.
Inputs: artist (required), kind, providers, safeSearch, +5 more.
search_imagesA
Federated image search across license-aware providers (Wikimedia Commons, Openverse, Unsplash, Pexels, Pixabay, iTunes, MusicBrainz CAA, Spotify, Brave). Returns concise ranked candidates with license + attribution. Does NOT auto-download — call download_image after. Default safe-only policy includes open, platform-license, editorial/press tags and rejects UNKNOWN. Use open-only for CC/public-domain only. For large batches, prefer CLI: webfetch batch --jsonl --continue-on-error.
Inputs: query (required), providers, safeSearch, licensePolicy, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: downloading, license checking, reverse image search, page probing, and three specialized search tools (general, album art, artist). No ambiguity between them.
All tool names follow a consistent verb_noun pattern with underscores (e.g., download_image, search_images). No mixing of conventions.
Seven tools cover the domain of image fetching and license checking without being excessive. Each tool earns its place, and the count is appropriate for the server's purpose.
The set covers core workflows (search, download, license check, find similar, probe page). Minor gaps exist like a generic URL fetcher for non-image content, but the server's focus on images makes this acceptable.
Maintenance
Related MCP Connectors
Knowledge commons for AI agents: cited, licensed, queryable claims over MCP.
Free web search for AI agents. No API key required. Hosted MCP in active development.
The world's public data, one API. License-cleared public data sources for agents, via MCP and REST.
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server for searching and retrieving Creative-Commons-licensed images and audio from Openverse. Enables AI agents to query open media content.195 npm1MIT
- AlicenseAqualityDmaintenanceAn MCP server that searches the web for images, creates a numbered contact sheet for visual selection, and downloads the chosen images with provenance metadata. Works without an API key.320 npmMIT
- AlicenseAqualityDmaintenanceLicense-aware game development resource discovery MCP server. Helps AI coding agents find reusable game assets with commercial-use filtering, license classification, and attribution generation.91MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to search and browse photos, users, collections, and topics, and retrieve photo details, random selections, download tracking URLs, and usage statistics via MCP tools.74 npmMIT