
danbooru-tag-mcp
io.github.BaixuanZhu由 GitHub 帳號 BaixuanZhu 發布v0.6.0更新於 Nov 12, 2026
Danbooru MCP server for AI image generation: cached search, batch lookup, profiles, wiki, posts
概覽
僅限 Windows 的在地 MCP 伺服器,讓助理在撰寫 AI 繪圖提示詞前查詢 Danbooru 標籤、別名、wiki 規則與共現統計。
- 可以做什麼
- 依關鍵字搜尋標籤,依貼文數排序,可依分類與最低貼文數篩選
- 查詢單一標籤的精確資訊,或一次批次查詢最多 20 個名稱,含 WD14 標註器判定與改名提示
- 將別名或拼字錯誤解析為正式標籤,並列出與某標籤共現的標籤
- 以結構化欄位讀取標籤 wiki 頁面:摘要、定義標籤、使用規則、參見與範例貼文
- 依標籤組合搜尋貼文,並回傳每篇貼文依分類拆分的標籤清單
- 依貼文樣本分析標籤實際呈現的內容:共現標籤、普遍常數、依提升度排序的組合與分級組成
- 適用情境
- 適合助理為 Stable Diffusion、ComfyUI、Illustrious 撰寫或調整提示詞、撰寫 LoRA 說明時,使用真實的 Danbooru 標籤名稱而非憑記憶猜測。也適合確認某標籤是否仍存在、常與什麼一起出現,或 wiki 規則怎麼說。
- 執行需求
- 以在地行程執行於 Windows 10/11(x64 或 ARM64),可透過安裝程式、PowerShell 指令碼或可攜壓縮檔以使用者身分安裝,不需系統管理員權限。匿名存取即可使用,不需 API 金鑰。選用環境變數 DANBOORU_LOGIN 與 DANBOORU_API_KEY 可提高速率限制與內容存取;DANBOORU_REQ_GAP_MS、DANBOORU_MCP_NO_CACHE、DANBOORU_MCP_NO_BOOTSTRAP 用於調整行為。需要能連線至 Danbooru 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 danbooru-tag-mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
danbooru-tag-mcp
English | 简体中文
[CI] [Release] [Platform] [Go] [License: MIT]
A Danbooru tag lookup MCP server for local AI image generation. Your AI client looks tags up instead of recalling them — exact names, aliases, categories, post counts, co-occurrence stats and wiki rules, resolved before it writes the prompt.
Windows 10/11 on x64 or ARM64. Anonymous access works, so there is no API key to obtain before the first query.
Quick start
Install per-user (Windows 10/11, no admin rights):
Point your MCP client at the command:
That's it — the client picks up the eight tools below on its next session.
What the client gets back
Live responses, abridged for length. Post counts move daily; these were captured on 2026-11-12.
search_tags for blue hair — the names that actually exist, so the model
stops guessing bluehair:
get_tag_info for blue_hair — the count, plus whether the WD14 taggers know
the name at all:
get_tag_profile for arm_up, all-ages sample of 200 — what the tag actually
renders alongside, ranked by in-sample frequency, and which combinations are
specific to it rather than merely common:
The full profile returns 30 co-occurring tags and 10 ranked pairs. Every field is documented under Tools.
Features
- 8 MCP tools — search tags, exact and batch lookup, aliases, related tags, wiki pages, post search, and distribution profiles.
- Batch lookup — 20 exact names in one call instead of 20, with a found/missing split and a WD14 verdict on every name.
- Distribution profiles — what a tag actually renders as: co-occurring
tags by in-sample frequency, corpus constants like
1girl/solosplit intoubiquitous, combinations ranked by lift, and the sample's rating mix.withprofiles a tag pair instead, answering whatarm_upplusholding_weaponrenders as. - Structured wiki pages — the DText body distilled into
summary,intro_tags,rules,see_alsoandexample_posts, so rules like "if X, use Y instead" arrive as data rather than prose to re-parse. - Tagger-era detection — every name is checked against the pinned WD14
vocabularies and classified as
live,tagger_era(renamed upstream, the canonical name included) orunknown, so LoRA card captions stop dead-ending at "tag not found". - Post tag lists — each post comes back with its full tag list split by
category, so mining a few posts shows which tags naturally go together. No
rating filter by default; add
rating:gfor all-ages only. - Built to stay installed — an on-disk cache that serves stale answers
during outages,
upgradeverifying SHA256 and swapping the binary atomically, a per-user installer that registers PATH, and 1.5 s request spacing (500 ms with credentials) that keeps anonymous access viable.
Tags come back as plain strings with no model coupling, so they paste straight into ComfyUI, Stable Diffusion or Illustrious prompt fields.
Install
Requires Windows 10/11 on x64 or ARM64. Every option installs per-user, needs
no admin rights, and puts the install directory on the user PATH, so the bare
danbooru-tag-mcp command works afterwards.
Option 1: setup wizard (recommended)
Download danbooru-tag-mcp-windows-<arch>-setup.exe from the
latest release
and double-click it. It installs to %LOCALAPPDATA%\Programs\danbooru-tag-mcp.
Option 2: one-line PowerShell
Custom install directory:
Option 3: portable zip
Download danbooru-tag-mcp-windows-<arch>.zip from the
release page,
extract danbooru-tag-mcp.exe anywhere, and run it once — the first run
silently adds its own directory to the user PATH (idempotent).
Configure your MCP client
Point your MCP client (Claude Desktop, ZCode, etc.) at the command:
The bare command name works because the install directory is on the user PATH; alternatively use the full exe path.
Plugin instead of JSON (ZCode / Claude Code)
Add this repository as a plugin marketplace and install danbooru-tag-mcp —
the plugin ships the danbooru-tags server definition, so there is no JSON to
hand-edit. It wires configuration only: finish one of the install options
above first, so the CLI is actually on PATH.
- ZCode: Plugin Marketplace → Add →
BaixuanZhu/danbooru-tag-mcp→ install thedanbooru-tag-mcpplugin. - Claude Code:
/plugin install danbooru-tag-mcp --marketplace BaixuanZhu/danbooru-tag-mcp(one step, Claude Code 2.1.275+), or add the marketplace first withclaude plugin marketplace add BaixuanZhu/danbooru-tag-mcpand install from there.
danbooru-tag-mcp upgrade keeps the CLI updated independently of the plugin.
See plugins/danbooru-tag-mcp/README.md.
Tools
Parameters and return fields for all eight tools
search_tags
query (required, e.g. blue hair) · limit (10) · category
(general/artist/copyright/character/meta) · min_posts (0, drops
tags below the threshold) · refresh (false)
When no result carries posts, the response adds wd14_hits — WD14 tagger
vocabulary names containing the query.
get_tag_info
name (required, e.g. blue_hair) · refresh (false)
Returns category and post count plus a wd14 verdict: live (current
Danbooru), tagger_era (WD14 vocabulary only, likely renamed — the canonical
name is in renamed_to) or unknown (neither). A 0-post name with an active
alias also returns renamed_to.
get_tags_info
names (required, e.g. ["blue_hair","1girl"], max 20) · refresh (false)
Returns found (each with the fields of get_tag_info, renamed_to
included on 0-post rows) and missing (absent from Danbooru, each still
carrying its wd14 verdict).
get_related_tags
tag (required) · limit (10) · refresh (false)
Meta-category tags like highres are filtered out as noise.
get_tag_alias
name (required, e.g. sailor_suit) · refresh (false)
null means the input is already canonical.
get_tag_wiki
title or other_names (one required) · limit (5) · include_description
(false) · refresh (false)
Returns summary (first paragraph), intro_tags (definition-section link
targets), rules (disambiguation and usage sentences), see_also,
example_posts, the raw linked_tags union and multilingual other_names.
The raw DText body is not returned; include_description adds the intro prose
as plain text, for character appearance descriptions.
search_posts
tags (required, space-separated) · limit (5, max 20) · tags_mode
(full default, none drops the per-post tag lists, diff keeps only tags
not already in the query)
No rating filter by default; add a rating:g/s/q/e metatag to narrow. Each
post carries score, fav_count, large_file_url and tags split by
category: copyright / artist / character / general / meta.
get_tag_profile
tag (required, e.g. arm_up) · sample (200, range 20-200) · with ·
rating (g/s/q/e) · order (random by default, or score /
favcount for a top-post view, which is biased)
Samples a page of the tag's posts and returns co_tags ordered by in-sample
frequency, ubiquitous corpus constants (freq >= 0.5), top_pairs
combinations ranked by lift, and the ratings mix. Random sampling covers the
whole population; rating filters the sample; with profiles the 200 most
recent joint posts of a tag pair instead.
The six tag tools (search_tags, get_tag_info, get_tags_info,
get_related_tags, get_tag_alias, get_tag_wiki) read from the
response cache: repeat calls inside the TTL skip the
network round trip, and during a Danbooru outage the last cached answer is
served instead of an error, marked with stale: true and cached_at (when
it was stored). Their refresh parameter (default false) bypasses the cache
for a single call and re-fetches live. Post search and profiles are never
cached, so they carry no refresh.
Response cache
Repeat queries are answered from an on-disk cache instead of hitting Danbooru again:
- Location:
%LOCALAPPDATA%\danbooru-tag-mcp\cache(per user, persists across restarts, capped at 2000 entries / 64 MB with oldest-first eviction). It holds only API response bodies and is safe to delete at any time; the uninstaller removes it. - Fresh hits are served byte-identically to a network response — no markers.
- When Danbooru is unreachable (after retries), the expired cached answer is
served instead of an error, marked
stale: truepluscached_at(when it was stored) on the affected tool response. - Empty results (
[]) are never cached, so new tags appear as soon as Danbooru knows them. - Exact tag lookups keep a tag's identity row for 7 days (like wiki pages,
name and category barely change), so
post_countcan trail live Danbooru by up to 7 days — userefresh: truewhen a decision needs current counts. refresh: truere-fetches live and restarts the entry's TTL clock.- Set
DANBOORU_MCP_NO_CACHE=1to disable the cache entirely (useful for debugging).
CLI
Environment variables
DANBOORU_LOGIN— your Danbooru account name (the login you use on the site). Optional.DANBOORU_API_KEY— your Danbooru API key, generated from the API key section of your Danbooru profile. Optional. When bothDANBOORU_LOGINandDANBOORU_API_KEYare set, every request is sent authenticated with your account (higher rate limits and content access); otherwise the client is anonymous and Danbooru applies lower limits.DANBOORU_REQ_GAP_MS— minimum spacing between Danbooru requests, in milliseconds.0disables the gap; invalid values fall back to the default with a warning. Defaults: 1500 (anonymous) or 500 whenDANBOORU_LOGINandDANBOORU_API_KEYare both set.DANBOORU_MCP_NO_BOOTSTRAP— skip the startup PATH registration when non-empty.DANBOORU_MCP_NO_CACHE— disable the response cache when non-empty.
Building from source
Requires Go 1.26+ and GNU Make (bundled with Git Bash):
Releases are automated: pushing a v* tag makes GitHub Actions run the test
suite and publish the setup exes, portable zips, and checksums.txt for both
architectures.
Verifying a download
Binaries are not Authenticode-signed; integrity rests on reproducible builds, SHA-256 checksums and build provenance.
How the builds stay byte-reproducible, and how to rebuild one yourself →
來源:README.md,提交 c0c175e
工具
0版本歷史
6- v0.6.0最新Nov 12, 2026
- v0.5.0Nov 3, 2026
- v0.4.0Oct 31, 2026
- v0.3.0Oct 1, 2026
- v0.2.2Sep 30, 2026
- v0.2.1Sep 30, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分