百度图片搜索 MCP Server
Provides image search capabilities using Baidu Image Search API, with options to download and convert images to JPEG, PNG, or WebP formats.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@百度图片搜索 MCP Serversearch 黄山 and convert to png"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
百度图片搜索 MCP Server
基于百度图片搜索 API 的 MCP (Model Context Protocol) 服务器。支持图片搜索、下载和格式转换一体化。
功能特性
🔍 图片搜索:搜索百度图片,返回图片标题、URL、尺寸、格式等信息
📥 一键下载:搜索同时可直接下载图片到本地
🔄 格式转换:支持 JPEG、PNG、WebP 三种格式互转(基于 sharp)
🖼️ 双源选择:可选择缩略图(thumburl,百度 CDN 稳定快速)或原图(objurl,可能有防盗链)
📄 分页支持:支持自定义每页数量和页码
Related MCP server: mcp_search_images
安装
# 克隆仓库
git clone <repo-url>
cd mcp_image_bd_tools
# 安装依赖
npm install
# 构建
npm run build配置 MCP
在 MCP 客户端配置中添加:
{
"mcpServers": {
"image-baidu": {
"command": "node",
"args": ["path/to/mcp_image_bd_tools/dist/index.js"]
}
}
}使用
工具:search_images
参数说明
参数 | 类型 | 必填 | 默认值 | 说明 |
| string | ✅ | - | 搜索关键字 |
| number | ❌ | 1 | 页码,从 1 开始 |
| number | ❌ | 30 | 每页数量,最大 60 |
| string | ❌ | - | 下载目录路径。设置后自动下载图片 |
| string | ❌ | - | 输出格式: |
| string | ❌ |
| 图片源: |
使用示例
仅搜索:
{
"keyword": "维多利亚港",
"page": 1,
"perPage": 10
}搜索并下载缩略图:
{
"keyword": "故宫",
"downloadPath": "./downloads",
"perPage": 5
}搜索并下载原图 + 转换为 JPEG:
{
"keyword": "黄山",
"downloadPath": "./downloads",
"format": "jpeg",
"urlType": "original",
"perPage": 3
}返回结果结构
{
"keyword": "维多利亚港",
"totalNum": 44880,
"hasMore": true,
"page": 1,
"images": [
{
"index": 1,
"thumbUrl": "https://img0.baidu.com/it/u=...",
"originalUrl": "https://...",
"sourceUrl": "http://...",
"title": "图片标题",
"width": 1920,
"height": 1080,
"format": "jpg",
"isGif": false,
"isCopyright": false,
"detailUrl": "https://image.baidu.com/search/detail?...",
"downloaded": true,
"localPath": "downloads/1_图片标题_a1b2c3d4.jpg",
"convertedFrom": "webp→jpeg"
}
],
"error": "有 1 张图片下载失败(如:...)"
}技术架构
src/
├── index.ts # MCP Server 入口,注册 search_images 工具
├── baidu-image.ts # 百度图片搜索 API 封装(acjson 接口)
├── downloader.ts # 图片下载 + sharp 格式转换模块
├── types.ts # TypeScript 类型定义
└── utils.ts # 工具函数(URL 构建、格式检测、随机 UA 等)依赖
@modelcontextprotocol/sdk: MCP 协议 SDK
axios: HTTP 客户端
sharp: 高性能图片格式转换(JPEG/PNG/WebP)
技术实现细节
搜索 API
使用百度图片搜索的 acjson 接口:
GET https://image.baidu.com/search/acjson
?tn=resultjson_com
&word={关键字}
&pn={偏移量}
&rn={每页数量}
&gsm={pn的十六进制}
&newReq=1已验证:无需 Cookie 即可调用,直接请求即可返回完整结果
分页通过
pn(偏移量,步长为rn)和gsm(pn的十六进制值)控制响应中包含
totalNum(总结果数)和hasMore(是否有更多)
图片格式检测
下载图片时自动检测格式,优先级:
响应头
Content-Type文件魔数(Magic Bytes)
如果设置了 format 参数且与实际格式不一致,自动使用 sharp 转换。
反爬策略
随机 User-Agent(从多个真实浏览器 UA 中随机选择)
正确的 Referer 头
请求间添加 300-700ms 随机延迟
并发下载数限制为 3
License
MIT
Available Tools
1 toolsearch_imagesA
搜索百度图片,支持搜索、下载和格式转换一体化。
功能说明:
仅搜索模式:不指定 downloadPath,只返回图片信息(URL、尺寸、标题等)
搜索+下载模式:指定 downloadPath,自动下载图片到本地目录
格式转换:指定 format 参数,自动将图片转换为目标格式(仅下载模式有效)
使用示例:
搜索图片:{ "keyword": "维多利亚港" }
搜索第2页:{ "keyword": "长城", "page": 2 }
下载缩略图:{ "keyword": "故宫", "downloadPath": "./downloads" }
下载原图并转JPEG:{ "keyword": "黄山", "downloadPath": "./downloads", "format": "jpeg", "urlType": "original" }
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 页码,从 1 开始,默认 1 | |
| format | No | 可选,指定输出图片格式。当下载的图片格式与指定格式不一致时自动转换。仅在设置 downloadPath 时有效 | |
| keyword | Yes | 搜索关键字(必填) | |
| perPage | No | 每页数量,默认 30,最大 60 | |
| urlType | No | 选择下载使用的图片源。thumb=缩略图(默认,百度 CDN,稳定快速),original=原图(来源站点,可能有防盗链)。默认 thumb | thumb |
| downloadPath | No | 可选,指定下载目录。设置后会将图片下载到该目录,否则只返回图片 URL 列表。例如:./downloads 或 /absolute/path | |
| downloadFilename | No | 可选,自定义下载文件名(不含扩展名,扩展名由 format 或图片原始格式决定)。多张图时自动追加索引后缀,例如指定 mypic 则保存为 mypic_1.jpg、mypic_2.jpg。仅在设置 downloadPath 时有效 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description discloses important behaviors: search-only returns metadata (URLs, sizes, titles), download mode saves files, format conversion applies only to downloads, and urlType notes anti-leech risks on original images. It could add error handling or return format details, but core behavioral traits are well covered.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise yet structured with numbered modes and short examples. It front-loads the summary and avoids redundancy with the schema, making every sentence functional.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema, but the description indicates what search-only mode returns. It doesn't specify download mode's return value or error cases, but overall it is quite complete for the tool's complexity, especially given the detailed input schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, the schema already explains parameters, but the description enriches understanding by showing mode-dependent parameter interactions (e.g., format and downloadFilename only effective with downloadPath) and provides concrete examples that clarify parameter usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the tool searches Baidu images and supports search, download, and format conversion. It clearly differentiates the three operational modes (search-only, download, format conversion) with specific verbs and resources.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit instructions for when to use each mode: omit downloadPath for search-only, specify it for download, and only use format with download. Concrete examples illustrate typical usage scenarios, making it easy to select the correct configuration.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
search_images
TDQS
Only one tool exists, so there is zero risk of confusion between tools. The tool's internal modes (search, download, convert) are clearly described and mutually exclusive.
With a single tool named 'search_images', the naming is clean and follows a conventional verb_noun pattern. There are no inconsistent conventions to penalize.
Having only one tool is borderline for a typical MCP server, but the tool bundles search, download, and format conversion into one interface, which fits the server's stated purpose of Baidu image search. Still, it feels slightly thin compared to servers with dedicated tools for each operation.
The single tool covers the core lifecycle of image searching: querying with pagination, downloading thumbnails or originals, and converting formats. There are no obvious missing operations for a search-focused server.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for ByteDance Seedream AI image generation
MCP server for NanoBanana AI image generation and editing
MCP server for Hailuo (MiniMax) AI video generation
Related MCP Servers
- AlicenseBqualityDmaintenance一个用于联网搜索的MCP服务器,基于博查搜索API A MCP server for internet search, based on the Bocha Search API1MIT
- AlicenseNot gradedqualityDmaintenanceA search service based on multiple image APIs and icon generation capabilities, specifically designed for integration with Cursor MCP service. Supports image search, download, and AI-generated icons.16MIT
- AlicenseBqualityFmaintenanceMCP server for searching images with Google23012MIT
- AlicenseAqualityDmaintenanceMCP server that enables web search, image search, and image download using DuckDuckGo.43MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/limithacker/mcp_image_bd_tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server