Booru-Pictag-Get-MCP
An MCP server that searches booru image boards and cleans their tags into ready-to-use AI-art prompts for Stable Diffusion and similar models.
README
Booru-Pictag-Get-MCP
⚠️ 纯 AI 生成声明 | Pure AI-Generated Notice — 详见
AIGC_NOTICE.md
An MCP server that searches booru image boards (Danbooru / AIBooru / e621 / Gelbooru / Rule34) and cleans their tags into ready-to-use AI-art prompts for Stable Diffusion / Illustrious / Pony / SDXL and any booru-tag-driven model.
This is a Python port + MCP integration of booru-prompt-gallery by Mexes-GM (MIT). The prompt-cleaning pipeline — tag extraction, multi-subject guard, smart tag combination, redundancy folding, category splitting, background modes — is a 1:1 port of the original TypeScript modules. Wrapped as 4 callable MCP tools, no Web UI, no Supabase/Redis/Cloudflare deps. See AIGC_NOTICE.md for the full derivation & attribution.
| Upstream | Mexes-GM/booru-prompt-gallery — TypeScript + Next.js 15 web app (MIT) |
| This repo | echo-xianyu/Booru-Pictag-Get-MCP — Python 3 + FastMCP server |
| License | MIT — original credit preserved, dual attribution. See LICENSE |
Install
Option A — local path
Clone, then point uvx at the local checkout:
git clone https://github.com/echo-xianyu/Booru-Pictag-Get-MCP.git
cd Booru-Pictag-Get-MCP
uvx --from . booru-pictag-get-mcp
Option B — cloud / direct from GitHub
uvx --from "git+https://github.com/echo-xianyu/Booru-Pictag-Get-MCP" booru-pictag-get-mcp
HTTP/2 extra (recommended — required for e621)
uvx --from . --with h2 booru-pictag-get-mcp
e621's TLS stack frequently errors out on HTTP/1.1 keep-alive. The HTTP client auto-detects h2 and falls back to HTTP/1.1 if absent.
Configure (opencode / any MCP client)
{
"mcp": {
"booru-pictag-get": {
"command": "uvx",
// Option A — local:
"args": ["--from", "E:\\MCP\\booru-pictag-get-mcp", "booru-pictag-get-mcp"],
// Option B — cloud (no checkout on disk):
// "args": ["--from", "git+https://github.com/echo-xianyu/Booru-Pictag-Get-MCP", "booru-pictag-get-mcp"],
// HTTP/2 for e621 — prepend "--with", "h2" to args above.
"environment": {
"BOORU_DEFAULT_PROVIDER": "danbooru",
"DANBOORU_USERNAME_APIKEY": "youruser:yourkey", // optional, raises rate limit
"GELBOORU_USER_ID": "<your_user_id>", // required by Gelbooru since 2025-08
"GELBOORU_API_KEY": "<your_api_key>",
"RULE34_USER_ID": "<your_user_id>", // required by Rule34 since 2025-08
"RULE34_API_KEY": "<your_api_key>"
}
}
}
}
API key policy (Aug 2025): Danbooru, AIBooru, and e621 work with no key. Gelbooru and Rule34 tightened auth and now require keys. Without them, those two providers return 401; the others keep working.
Tools
| Tool | Use it for |
|---|---|
search_prompts |
Recommended. Search a booru tag → ready-to-use cleaned prompt + category split. One step. |
build_prompt |
Clean an already-known tag set (no network). Accepts raw booru format or comma-list. |
search_posts |
Raw post list (no cleaning). Inspect original tags before deciding how to process them. |
autocomplete_tags |
Turn a natural word into the canonical booru tag form. Call this BEFORE search if unsure of a tag's spelling. |
Each tool's description in tools/list carries full search-semantics guidance:
- Booru search is tag-based AND, not keyword search. Prefer a single tag (
hatsune_miku) over stacking (hatsune_miku blue_hair smile), which usually returns 0 posts. - Multi-word tags use underscore:
blue_hair, neverblue hair. - Don't write natural-language queries ("a girl with blue hair sitting in a classroom"); translate to booru tags first via
autocomplete_tags.
Scope & design choices
- Pure Python — no Supabase / Redis / Cloudflare / Vercel. Endpoints are public booru APIs; no proprietary backend.
- Tag-conflict rules are off by default in the prompt pipeline (mirrors the original
cleanPrompt.ts, which never calledtag-conflicts.ts). The 180+ rules were authored assuming a single subject — enabling them by default would mangle legitimate multi-character prompts (e.g.1girl+1boysex scenes,smile+cryingbittersweet scenes,long_hair+short_hairtwo-character shots). The resolver remains callable viabooru_mcp.core.tag_conflicts.resolve_conflicts()for explicit opt-in. optimize_tagshas a multi-subject guard: when the prompt contains multi-character markers (2girls/2boys/multiple_*/couple/group/duo…), it skips the hair-length / breast-size / eye-color "keep best per hierarchy" pick and the shared-noun tag combination — so two characters with different features survive intact.- Tag categories for Gelbooru/Rule34 come from a static
data/tag_categories.jsondictionary (one-shot dump from Danbooru's publictags.json, generated byscripts/dump_tag_categories.py) with a keyword-classifier fallback. No external database at runtime. - Tag-conflict rules are overridable via
data/tag_conflicts_overrides.json(additive — overrides can only widen a built-in rule, never narrow it). Seedata/tag_conflicts_overrides.example.json. Audit current rules withpython scripts/inspect_tag_conflicts.py --builtin.
Credits
Prompt-cleaning pipeline ported (1:1 line-for-line where possible) from booru-prompt-gallery by Mexes-GM (MIT). Original copyright preserved in LICENSE.
Python port + MCP server by echo-xianyu. The vast majority of the code was generated by AI (opencode + GLM-5.2); see AIGC_NOTICE.md for the full statement.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。