danbooru-tag-mcp

io.github.BaixuanZhu由 GitHub 账号 BaixuanZhu 发布v0.5.0更新于 Nov 3, 2026

Danbooru MCP server for AI image generation: search, batch lookup, aliases, profiles, wiki, posts

概览

AI 生成的概览

查询真实的 Danbooru 标签——名称、别名、分类、帖子数、共现统计与 wiki 文本,帮助助手写出准确的图像生成提示词。

可以做什么
  • 按关键词搜索标签,并查询单个标签或一次最多 20 个标签的精确信息
  • 把别名和拼写错误解析为规范标签,并读取标签的 wiki 页面与其中的关联标签
  • 查找与某标签共现的标签,并从随机帖子样本生成标签分布画像
  • 按标签组合搜索帖子,返回每篇帖子按分类拆分的完整标签列表
适用场景
适合助手在撰写或调整本地 AI 图像生成提示词时,需要核实 Danbooru 标签名称、别名和真实搭配,而不是凭猜测拼写。也适合检查 LoRA 说明中的标签是否仍存在或已被改名。
运行要求
以本地命令形式运行,需 Windows 10/11(x64 或 ARM64),按用户安装,无需 Node.js 或 Python 包。需要能访问 Danbooru API 的网络。可选环境变量 DANBOORU_LOGIN 与 DANBOORU_API_KEY 可提高速率上限;匿名使用也可,但限额较低。
安装前请注意
帖子搜索默认不加分级过滤,结果可能包含成人内容,需自行加 rating 元标签收窄。若设置了 DANBOORU_LOGIN 与 DANBOORU_API_KEY,所有请求都会以该账号身份发送。一行式 PowerShell 安装脚本和首次运行时的 PATH 注册会修改用户环境,可用 DANBOORU_MCP_NO_BOOTSTRAP 跳过后者。发布的可执行文件没有 Authenticode 签名。

安装

在 SourceWeft 中

  1. 打开 控制台中的 danbooru-tag-mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

danbooru-tag-mcp

[CI] [Release] [Go] [License: MIT]

A Danbooru tag lookup MCP (Model Context Protocol) server for local AI image generation: your AI client resolves real Danbooru tags — exact names, aliases, categories, post counts, co-occurrence statistics, wiki descriptions, and the tag lists of real posts — before composing prompts, which noticeably improves tag accuracy in generated images.

[danbooru-tag-mcp demo: verifying Danbooru tags with search_tags, get_tag_wiki and search_posts before composing a prompt]

Quick start

Install per-user (Windows 10/11, no admin rights):

powershell
iwr -useb "https://raw.githubusercontent.com/BaixuanZhu/danbooru-tag-mcp/main/install.ps1" | iex

Point your MCP client at the command:

json
{  "mcpServers": {    "danbooru-tags": {      "command": "danbooru-tag-mcp",      "args": []    }  }}

That's it — the client picks up the eight tools below on its next session.

Features

  • 8 MCP tools: tag search, exact tag info, batch tag lookup, related tags, alias resolution, wiki lookup, post search, and tag distribution profiles
  • Batch tag lookup: get_tags_info resolves up to 20 exact tag names in a single request — one tool call instead of 20, with found/missing split and a wd14 verdict on every name
  • Tag distribution profiles, single or pair: get_tag_profile samples a page of a big tag's posts and answers what it actually renders as — co-occurring tags by in-sample frequency (corpus constants like 1girl/solo split into ubiquitous), combinations ranked by lift, and the sample's rating mix. with profiles a tag pair over the 200 most recent joint posts (what does arm_up + holding_weapon render as?); order: score/favcount switches to a top-post view (biased), rating: narrows either mode
  • Structured wiki pages: get_tag_wiki distills the DText body into summary, intro_tags (definition/appearance tag targets), rules (the "if X, use Y instead" disambiguation sentences), see_also and example_posts — no raw body to re-parse; include_description opts into the intro prose as plain text for character appearance descriptions
  • Tag lists back from post search: search_posts returns each post's full tag list split by category (copyright/artist/character/general/meta) plus score/fav_count/large_file_url, so mining a few posts reveals which tags naturally go together
  • Tagger-era tag detection: get_tag_info classifies every name against the pinned WD14 tagger vocabularies (wd14 field: live / tagger_era — a tagger-era name Danbooru has since renamed, with the canonical name in renamed_to / unknown), so LoRA card captions stop dead-ending at "tag not found"; search_tags adds wd14_hits fallback hits when no result carries posts, and filters by category (general/artist/copyright/character/meta) so character or artist lookups stop drowning in general tags
  • Uncensored by default: search_posts applies no rating filter — results reflect a tag's whole population (arm_up is ~95% g/s/q); add a rating:g/s/q/e metatag when you want only R-18 or only all-ages
  • Self-updating: danbooru-tag-mcp upgrade checks GitHub Releases, verifies SHA256 and replaces the binary atomically
  • Zero-config install: per-user installer (setup wizard or one-line PowerShell) that registers the install directory into the user PATH automatically
  • Polite API usage: requests are throttled to one per 1.5 seconds; anonymous access works, credentials raise the limits (free/anonymous post searches are still capped at 2 content tags per query)

Install

Requires Windows 10/11 on x64 or ARM64.

Option 1: setup wizard (recommended)

Download danbooru-tag-mcp-windows-<arch>-setup.exe from the latest release and double-click it. This installs per-user to %LOCALAPPDATA%\Programs\danbooru-tag-mcp (no admin rights needed) and registers the user PATH.

Option 2: one-line PowerShell

powershell
iwr -useb "https://raw.githubusercontent.com/BaixuanZhu/danbooru-tag-mcp/main/install.ps1" | iex

Custom install directory:

powershell
.\install.ps1 -InstallDir "D:\tools\danbooru-tag-mcp"

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).

Option 4: ZCode / Claude Code plugin (auto MCP config)

For ZCode and Claude Code users the MCP configuration can come from a plugin instead of hand-edited JSON: add this repository as a plugin marketplace and install danbooru-tag-mcp — the plugin ships the danbooru-tags server definition, so no client-side config is needed.

  • ZCode: Plugin Marketplace → Add → BaixuanZhu/danbooru-tag-mcp → install the danbooru-tag-mcp plugin.
  • Claude Code: /plugin install danbooru-tag-mcp --marketplace BaixuanZhu/danbooru-tag-mcp (one step, Claude Code 2.1.275+), or add the marketplace first with claude plugin marketplace add BaixuanZhu/danbooru-tag-mcp and install from there.

The plugin wires the configuration only — the CLI still has to be on PATH (install it first via Option 1-3 above), and danbooru-tag-mcp upgrade keeps it updated independently of the plugin. See plugins/danbooru-tag-mcp/README.md.

Configure your MCP client

Point your MCP client (Claude Desktop, ZCode, etc.) at the command:

json
{  "mcpServers": {    "danbooru-tags": {      "command": "danbooru-tag-mcp",      "args": []    }  }}

The bare command name works because the install directory is on the user PATH; alternatively use the full exe path. ZCode and Claude Code users can skip the manual JSON entirely via Option 4.

Tools

ToolDescriptionParameters
search_tagsSearch tags by keyword, ordered by post count; when no result has posts, adds wd14_hits (WD14 tagger vocab names containing the query); optional category filterquery (required, e.g. blue hair), limit (default 10), category (one of general/artist/copyright/character/meta)
get_tag_infoExact info for one tag (category, post count), plus a wd14 verdict: live (current Danbooru), tagger_era (WD14 tagger vocab only, likely renamed — see renamed_to / get_tag_alias), unknown (neither). A 0-post name with an active alias also returns renamed_to (the canonical tag)name (required, e.g. blue_hair)
get_tags_infoBatch version of get_tag_info: up to 20 exact names in one request; returns found (each with the same fields as get_tag_info) and missing (names absent from Danbooru, each still carrying its wd14 verdict)names (required, e.g. ["blue_hair","1girl"], max 20)
get_related_tagsTags that co-occur with the given tag (meta-category tags like highres are filtered out as noise)tag (required), limit (default 10)
get_tag_aliasResolve an alias or misspelling to its canonical tag (null = input is already canonical)name (required, e.g. sailor_suit)
get_tag_wikiWiki page of a tag as structured fields: summary (first paragraph), intro_tags (definition-section link targets), rules (disambiguation/usage sentences), see_also, example_posts, plus the raw linked_tags union and multilingual other_names. The raw DText body is not returned; opt into include_description for the intro prose as plain text (character appearance descriptions)title or other_names (one required), limit (default 5), include_description (default false)
search_postsSearch posts by a tag combination, 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 / metatags (required, space-separated), limit (default 5, max 20)
get_tag_profileDistribution profile of one tag from a post sample (default 200, random = whole population): co_tags ordered by in-sample frequency, ubiquitous corpus constants (freq >= 0.5), top_pairs combinations ranked by lift, ratings mix. order picks random (default) / score / favcount (top-post biased); rating filters the sample; with profiles the 200 most recent joint posts of a tag pair insteadtag (required, e.g. arm_up), sample (default 200, range 20-200), with, rating (g/s/q/e), order

CLI

danbooru-tag-mcp            run the MCP server (what MCP clients launch)danbooru-tag-mcp upgrade    self-update via GitHub Release (SHA256 verified)danbooru-tag-mcp version    print the versiondanbooru-tag-mcp help       show help

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 both DANBOORU_LOGIN and DANBOORU_API_KEY are 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_MCP_NO_BOOTSTRAP — skip the startup PATH registration when non-empty.

Building from source

Requires Go 1.26+ and GNU Make (bundled with Git Bash):

bash
make test        # unit testsmake integration # online smoke test against the live Danbooru API (~1 min)make build       # dev build -> dist/<arch>/ (bootstrap disabled)make release     # portable zip + checksums.txtmake installer   # NSIS setup exe (requires makensis: scoop install nsis)

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.

Reproducible builds & verifying downloads

Release binaries are not Authenticode-signed; integrity rests on reproducible builds plus SHA-256, all free and verifiable by anyone:

  • The exe and portable zips are byte-reproducible: the exact Go toolchain is pinned in go.mod, builds use CGO_ENABLED=0 -trimpath -buildvcs=false, and zips are written by scripts/zipfile with entry timestamps pinned to the commit time (SOURCE_DATE_EPOCH). Same source + toolchain ⇒ identical bytes on any machine, any timezone.
  • Every release job runs a verify-repro check: it rebuilds the exe from the tagged source on a Linux runner and compares it byte-for-byte against the published Windows-built asset — a green check on the release proves the artifacts were built from the tag without tampering.
  • All artifacts carry SHA-256 checksums (checksums.txt) and free keyless build-provenance attestations signed by the GitHub workflow.

Verify a download:

bash
sha256sum -c --ignore-missing checksums.txt   # integrity vs the manifestgh attestation verify --repo BaixuanZhu/danbooru-tag-mcp danbooru-tag-mcp.exe   # provenance

Reproduce the portable exe yourself and compare:

bash
git checkout v0.4.0make build-dist VERSION=0.4.0 GOARCH=amd64sha256sum dist/amd64/danbooru-tag-mcp.exe     # must equal the hash inside the published zip

The NSIS setup exe is the one non-reproducible artifact (makensis embeds build metadata); it is still covered by checksums.txt and the attestations.

来源:README.md,提交 71ea48f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

5
  1. v0.5.0最新Nov 3, 2026
  2. v0.4.0Oct 31, 2026
  3. v0.3.0Oct 1, 2026
  4. v0.2.2Sep 30, 2026
  5. v0.2.1Sep 30, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分