visual-hunt-mcp
A local TypeScript MCP server for macOS that connects to Chrome via CDP to search and download high-quality image candidates from curated sources like Unsplash, Pexels, and others for use in posters, wallpapers, and inspiration boards.
README
visual-hunt-mcp
visual-hunt-mcp is a local TypeScript MCP server for macOS that connects to your existing Chrome session over CDP and helps Codex / Claude find visually strong image candidates for posters, wallpapers, and inspiration boards.
v0.4.0 · 11 tools · audited end-to-end · 15/15 behavioural tests pass · 108 images downloaded in a real-world 10-topic stress test · ships with eval suite and full-test harness.
It is designed to:
- use the official
@modelcontextprotocol/sdkwithMcpServerandregisterTool - connect to a local Chrome instance via
chromium.connectOverCDP(...) - reuse your local logged-in browser profile when you choose to do manual-assisted review
- avoid bypassing paywalls, login walls, CAPTCHA, or platform controls
- return candidate metadata and optionally download image files into a project folder created under the MCP server's current working directory
Why CDP
This project uses Chrome DevTools Protocol instead of launching a fresh automation browser so the MCP server can reuse a local Chrome profile you control. That makes Instagram and Xiaohongshu workflows more practical because the browser session can already be logged in, while the MCP server still stays local on your Mac.
Why Instagram / Xiaohongshu Are Manual-Assisted
Instagram and Xiaohongshu often require login, can change layout frequently, and may gate content behind platform controls. This MCP deliberately opens those pages in your connected local Chrome and only extracts visible public image candidates when available. It does not try to bypass login, rate limits, or access restrictions.
Download Scope
This project can now download image files for sources such as Unsplash, Pexels, Pixabay, wallpaper sites, and visible image URLs surfaced from manual-assisted social browsing when your connected Chrome session has access. A few guardrails still apply:
- Google-hosted previews and Google Maps imagery stay blocked
- Instagram and Xiaohongshu still depend on your connected Chrome login state and whatever visible image URLs the page actually exposes
- you are still responsible for checking licensing before reuse
save_candidates_jsonremains metadata-only, whiledownload_candidate_imageswrites image files plus a download manifest
Features
MCP tools (11)
| Tool | Reliability | Notes |
|---|---|---|
search_wallpaper_sites |
★★★★★ | Flagship. Curated 6-source set (Unsplash, Pexels, Pixabay, Wikimedia, Wallhaven, Alpha Coders). 100% topic coverage in stress tests. |
open_xiaohongshu_visual_search |
★★★★★ | Flagship for travel/design topics. 100% topic coverage. |
open_google_maps_visual_search |
★★★ | Manual-assisted. Most images correctly blocked from download by design — use for visual inspiration. |
open_pinterest_visual_search |
★★ | Manual-assisted. Pinterest serves a login modal on most searches; log in via Chrome, then call extract_manual_page_candidates. |
open_instagram_visual_search |
★★ | Manual-assisted. Same login-wall pattern as Pinterest. |
search_google_images |
★★ | Inconsistent due to Google's lazy-loaded udm=2 layout. Prefer search_wallpaper_sites for primary search. |
open_url_and_extract_images |
★★★★ | Generic extractor. Works on Wikipedia, blogs, brand pages. |
extract_manual_page_candidates |
★★★★★ | Re-extract after manual scroll/login on a held page. |
close_manual_page |
★★★★★ | Cleanup. Idempotent. |
save_candidates_json |
★★★★★ | Metadata-only persistence. |
download_candidate_images |
★★★★★ | Download with referer + user-agent from connected Chrome. Google-hosted previews are blocked by design. |
Default source set (v0.4.0 curated)
The default search_wallpaper_sites source list was trimmed in v0.4.0 from 13 sources to the 6 that returned downloadable candidates on >80% of topics in real-world stress testing:
- Unsplash — modern editorial photography
- Pexels — modern editorial photography
- Pixabay — modern editorial photography
- Wikimedia Commons — landmarks, architecture, public-domain
- Wallhaven — top free 4K/8K wallpapers
- Alpha Coders / Wallpaper Abyss — top free 4K/8K wallpapers
Adapters for the dropped sources still ship — pass them explicitly when you need them: sites: ["openverse.org", "loc.gov", "images.nasa.gov", "rawpixel.com", "publicdomainpictures.net", "wallpaperscraft.com", "hdqwalls.com"].
Candidate scoring
Each candidate gets a lightweight scoreHint based on:
- image size
- aspect ratio closeness to common poster / wallpaper ratios
- title or alt text keywords such as
poster,cinematic,wallpaper,4k,8k,travel,film, andlandscape
Install
cd /Users/lanston/Desktop/Codex/visual-hunt-mcp
npm install
Start Chrome For MCP
npm run chrome:debug
This helper binds Chrome remote debugging to 127.0.0.1 only. It does not expose the CDP port publicly.
If you prefer the raw script:
chmod +x scripts/start-chrome-mcp.sh
./scripts/start-chrome-mcp.sh
Validation Workflow
Run the deterministic MCP smoke test after Chrome is up:
npm run smoke
For a comprehensive behavioural sweep covering all 11 tools (schema coercion, query optimization, manual-page lifecycle, login-wall suppression, false-positive filters, security guards):
node scripts/full-test.mjs # 15 cases including live Chrome paths
node scripts/full-test.mjs --skip-live # 10 cases, fast, no browser deps
What npm run smoke validates:
- the local MCP server starts over stdio from the current
dist/output tools/listexposes the expected tool setopen_url_and_extract_imagescan extract visible candidates from a local fixture pageextract_manual_page_candidatesandclose_manual_pageare exposed for manual-assisted follow-up flowssave_candidates_jsonwrites candidate metadata to a temporary output rootdownload_candidate_imagesdownloads an allowed local image and skips a blocked Google-hosted candidate with a clear reason
The smoke test uses a temporary VISUAL_HUNT_OUTPUT_ROOT and cleans it up on success. To keep the artifacts for inspection:
npm run smoke -- --keep-output
For a higher-confidence pass that also hits live Google Images and wallpaper search flows through your connected Chrome session:
npm run smoke:live
Use npm run validate as the stable default validation command. It now runs npm run build first and then the deterministic smoke test.
Run MCP Locally
npm run dev
For production-style use:
npm run build
node dist/index.js
Claude Desktop Config
{
"mcpServers": {
"visual-hunt": {
"command": "node",
"args": [
"/Users/lanston/Desktop/Codex/visual-hunt-mcp/dist/index.js"
],
"env": {
"CHROME_CDP_ENDPOINT": "http://127.0.0.1:9222"
}
}
}
}
Example Prompts
Use visual-hunt to search_google_images for "cinematic Oahu Hawaii sunset travel poster 8k", limit 10.
Use visual-hunt to search_wallpaper_sites for "dark luxury black gold abstract 8k wallpaper", limit 15.
Use visual-hunt to open_xiaohongshu_visual_search for "夏威夷 绝美 海报 壁纸 旅行 摄影", limit 10.
Use visual-hunt to download_candidate_images for project "oahu-poster-board" using the candidates from the last search, limit 5.
Use visual-hunt to extract_manual_page_candidates for the manualPageId from the Xiaohongshu search after I log in or scroll more.
Notes
- Logs are written to
stderronly so MCP JSON-RPC onstdoutstays clean. - Chrome must already be running with remote debugging enabled.
- Output folders are created under the MCP server's current working directory by default. Example:
/path/to/visual-hunt-mcp/<project>/images. - Override the output root with
VISUAL_HUNT_OUTPUT_ROOTif you want downloads somewhere else. save_candidates_jsonwrites metadata to<output-root>/<project>/candidates.json.download_candidate_imageswrites image files to<output-root>/<project>/imagesand a manifest to<output-root>/<project>/downloads.json.scripts/smoke-test.mjsis the quickest way to validate the MCP contract end-to-end against a local server process.scripts/smoke-test.mjsvalidates the local server through the currentdist/output and uses a temporary output root for artifacts.- The server does not store credentials.
- The server does not execute arbitrary shell commands.
Environment variables
| Var | Default | Effect |
|---|---|---|
CHROME_CDP_ENDPOINT |
http://127.0.0.1:9222 |
Chrome remote-debugging endpoint |
VISUAL_HUNT_OUTPUT_ROOT |
process.cwd() |
Root directory for downloaded images and manifests |
VISUAL_HUNT_TIMEOUT_MS |
20000 |
Per-page navigation/extraction timeout |
VISUAL_HUNT_MANUAL_PAGE_TTL_MS |
1800000 (30 min) |
TTL for entries in the manual-page registry; getManualPage refreshes |
VISUAL_HUNT_MANUAL_PAGE_MAX |
50 |
Hard cap on manual-page registry size; oldest evicted first |
VISUAL_HUNT_AUTO_REGISTER |
unset | Set to 1 to rewrite ~/.claude.json with this server entry on every startup. Off by default since v0.3.0. |
Manual Checks Beyond Smoke
When you want to sanity-check the live/manual-assisted parts of the product, these are the highest-value follow-ups after npm run smoke:
npm run smoke:liveopen_instagram_visual_searchwith the same Chrome profile you plan to use day-to-dayopen_xiaohongshu_visual_searchwith that same profile if login is requiredopen_google_maps_visual_searchto confirm the manual-review note and non-bypass behavior still look right
Exact Mac Commands
cd /Users/lanston/Desktop/Codex/visual-hunt-mcp
npm install
npm run chrome:debug
npm run smoke
npm run smoke:live
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。