Mcp Rule34

io.github.smeet666由 GitHub 帳號 smeet666 發布v2.1.0更新於 Nov 3, 2026

Search rule34.xxx posts by tag through the site's own API. Needs a rule34.xxx API key.

概覽

AI 產生的概覽

把助理連接到 rule34.xxx 圖站的官方 API,可查詢標籤寫法、依標籤搜尋貼文,並讀取單一貼文的紀錄。

可以做什麼
  • 查詢站點對某個標籤的寫法,以及有多少貼文帶有該標籤
  • 依必要標籤、任選標籤與排除標籤搜尋貼文,並可指定媒體類型、分級、排序、數量與頁碼
  • 依編號或頁面網址讀取單一貼文的完整紀錄,包含全部標籤
適用情境
適合在聊天用戶端查詢 rule34.xxx 的標籤索引:確認標籤的正確寫法、執行帶排除條件的標籤搜尋,或取得某則貼文的詮釋資料。它僅供讀取,且只針對這一個站點。
執行需求
透過 npx(需 Node 24 或更新版本)、Docker 映像或 MCP 安裝包在本機以 stdio 執行。需要 rule34.xxx 帳號,並以環境變數設定 RULE34_USER_ID 與 RULE34_API_KEY 兩項憑證。需要能連線 api.rule34.xxx 與 rule34.xxx 的對外 HTTPS。選用設定包括請求間隔、逾時、重試、快取與日誌等級。
安裝前請注意
需要個人 API 金鑰與帳號編號(RULE34_API_KEY、RULE34_USER_ID),僅傳送給 rule34.xxx;站點每人只核發一把金鑰。內容為成人向:站點只有 questionable 與 explicit 兩種分級。它僅供讀取且不下載檔案,但回傳的檔案網址指向第三方媒體。此專案為非官方專案,與站點無隸屬關係。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Rule34,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-rule34

[npm] [CI] [license] [LobeHub]

rule34.xxx is a large image board whose posts are indexed entirely by tags, and it publishes an API for reading them. A post carries its identifier, the address of its page and of its file, its dimensions, the score its viewers gave it, its rating, and the full list of tags it was filed under. The site holds tens of millions of posts and answers a tag search with the number it matched.

This server connects a chat client to that index. You can search the posts by tags, combining required tags, alternatives and exclusions, read one post's record by its identifier, and look up how the site spells a tag before searching on it. It needs an account and an API key, which the site issues per person.

Version française


Install

Claude Code

bash
claude mcp add rule34 --env RULE34_USER_ID=your-id --env RULE34_API_KEY=your-key -- npx -y mcp-rule34

Claude Desktop, Cursor, and any client using the standard config format

json
{  "mcpServers": {    "rule34": {      "command": "npx",      "args": ["-y", "mcp-rule34"],      "env": {        "RULE34_USER_ID": "your-id",        "RULE34_API_KEY": "your-key"      }    }  }}

Node 24 or later is required. The two credentials are required; everything else under Configuration is optional.

With Docker

json
{  "mcpServers": {    "rule34": {      "command": "docker",      "args": [        "run",        "-i",        "--rm",        "-e",        "RULE34_USER_ID",        "-e",        "RULE34_API_KEY",        "ghcr.io/smeet666/mcp-rule34:2.1.0"      ]    }  }}

-i keeps stdin open, which is where the protocol travels, and -t is left out because a TTY rewrites the stream. The container needs outbound HTTPS to api.rule34.xxx and rule34.xxx, and the two credentials from your environment: no volume, no port.

Bundle, without npm

Download mcp-rule34-2.1.0.mcpb from the latest release and open it. A client that supports MCP bundles installs it on its own, with no npm to run. The credentials are still set in the client's configuration.

What you can ask

  • "How does the site spell that tag?"
  • "Find posts tagged with those two, sorted by score."
  • "Same search, leaving out monochrome."
  • "Read me the record for post 1234567."
  • "How many posts does that search match?"

The ordinary path runs from a tag lookup to a search: find_tags gives the spelling the site uses, and search_posts takes it.

Tools

ToolWhat it does
find_tagsFinds how the site spells a tag, and how many posts carry it.
search_postsSearches the posts by tags, with alternatives and exclusions.
get_postReads one post's record by its identifier or its address.

Look a tag up before searching on it. The site indexes by tag alone, and a tag it does not hold matches nothing, which reads as an empty result rather than as a misspelling.

find_tags

Finds how the site spells a tag.

ArgumentTypeRequiredWhat it does
querystring, up to 60 charactersyesThe text to look up.

In return: query as it was sent, and tags, each with the spelling the site uses and the number of posts carrying it.

search_posts

Searches the posts by tags.

ArgumentTypeRequiredWhat it does
tagsarray of 1 to 10 tag namesyesTags a post must carry.
any_ofarray of 1 to 10 tag namesnoTags a post must carry at least one of.
excludearray of 1 to 10 tag namesnoTags a post must carry none of.
media_typeimage, animated, video or any, default anynoStills, GIFs or MP4.
ratingquestionable or explicitnoBoth are searched when this is left out.
sortscore, id, updated or random, default scorenoThe order the site sorts by.
limitinteger, 1 to 100, default 20noPosts to serve.
pageinteger, 1 to 200, default 1noWhich page of posts.

media_type is read off the site's own tags, so the classification is as good as the tagging. The two ratings above are the only ones the site holds: any other value answers zero posts and no error, which would hand back an absence the site never had.

In return: tags, any_of and exclude as the site spells them; query, the search as it was sent in the site's own language; total, the posts the whole search matches as counted by the site; and the posts themselves, each with its id, post_url, file_url, preview_url, sample_url, width, height, score, rating and tags. The score is the site's own and it is updated once a day.

get_post

Reads one post's record.

ArgumentTypeRequiredWhat it does
idinteger, 1 or moreone of twoThe post identifier.
urla rule34.xxx post URLone of twoThe address of the post's page.

In return: the post a search row carries, with its full tag list.

Configuration

The two credentials are required. Everything else is optional, and all of it goes in the env block of your client config.

VariableDefaultWhat it does
RULE34_USER_IDnone, requiredYour numeric account id.
RULE34_API_KEYnone, requiredYour API key, which is personal.
RULE34_USER_AGENTthe project identityNames your application to the site, with an address where a person can be reached.
RULE34_MIN_INTERVAL_MS1000Gap between two requests, from 1000 to 60000.
RULE34_TIMEOUT_MS20000Deadline for one request, from 1000 to 120000.
RULE34_MAX_RETRIES3Attempts after a transient failure, from 0 to 10.
RULE34_CACHE_TTL_MS300000How long an answer stays in memory, from 0 to 86400000.
RULE34_CACHE_MAX_ENTRIES300Answers held in memory at once, from 0 to 10000.
RULE34_LOG_LEVELerrorsilent, error, info or debug, written to stderr.

Where the credentials come from. Sign in, open Account options, and find the row named API Access Credentials. It shows &api_key=…&user_id=…, and those two values are what goes in the configuration above. If the key is empty, tick Generate New Key? and save.

The site issues one key per person, and asks that applications serving its content display no advertising and put it behind no paywall. This server ships no key of its own, and each user brings their own. Started without credentials, it runs, publishes its tools, and answers every call by naming the two variables to set: it sends no request it knows the site will refuse.

A value outside its range falls back to the default, and the reason is written to stderr.

Errors

Every failure carries one of six codes, a message, and where it helps a hint naming the next move.

CodeWhat happenedWhat to do
not_foundThe site answered, and holds nothing at that address.Check the identifier with search_posts.
invalid_inputThe arguments were refused before any request went out.Read the message, which names the argument. A missing credential is reported here.
rate_limitedThe site asked this client to slow down.Wait the number of seconds the hint names and call again with the same arguments. The post is still there.
parse_failureThe answer arrived in a shape this client cannot read.Report it at the issue tracker.
network_errorThe request did not complete.Try again shortly.
timeoutThe request passed its deadline.Raise RULE34_TIMEOUT_MS, or ask for fewer posts.

As a library

The layer reading the site is published on its own, with its pacing, its cache and its errors, and with no protocol attached.

ts
import { Rule34Client } from "mcp-rule34/client";
const client = new Rule34Client({ credentials: { userId: "…", apiKey: "…" } });const { data, cached } = await client.searchPosts({ tags: ["example"], limit: 5 });console.log(data.total, cached);

Each read answers { data, cached }, and throws an error carrying one of the six codes. The one-second floor between two requests holds here as well.

Pacing and attribution

Requests go out one at a time with at least a second between them, and that floor holds however the server is configured. The User-Agent always ends with the project identity and an address where a person can be reached.

Reads go to the API the site documents, and the credentials it issues are what its terms ask automated reading to use. Every result carries the address of the post's page. Nothing is downloaded: a file address travels through an answer as a string.

This MCP server is an unofficial project, with no affiliation to rule34.xxx.

Privacy

This server collects nothing about you and sends nothing to its author. It runs on your machine, contacts api.rule34.xxx and rule34.xxx and nothing else, holds its answers in memory while it runs, and writes nothing to disk. Your credentials are read from the environment and sent to that site alone. PRIVACY.md states what a request carries and which settings change any of it.

Development

bash
npm installnpm run build:fixturesnpm testnpm run check

Tests run against generated fixtures and make no network request. The live suite, npm run test:live, makes one request per route and runs nightly against the site itself.

Contributing

Bugs, questions and ideas belong in the issue tracker. Pull requests are welcome; opening an issue first helps agree on the shape of the change. See CONTRIBUTING.md.

License

MIT, see LICENSE. The posts and the tags belong to rule34.xxx and to the people who uploaded them.


mcp-rule34 (français)

English version

rule34.xxx est un grand imageboard dont les publications sont indexées entièrement par étiquettes, et il publie une API pour les lire. Une publication porte son identifiant, l'adresse de sa page et de son fichier, ses dimensions, la note que ses visiteurs lui ont donnée, son classement, et la liste complète des étiquettes sous lesquelles elle est rangée. Le site contient des dizaines de millions de publications et répond à une recherche par étiquettes en donnant le nombre qu'elle a trouvé.

Ce serveur relie un client de conversation à cet index. On peut chercher les publications par étiquettes, en combinant les étiquettes exigées, les alternatives et les exclusions, lire la fiche d'une publication par son identifiant, et vérifier comment le site orthographie une étiquette avant de chercher dessus. Il demande un compte et une clé d'API, que le site délivre par personne.

Installation

Claude Code

bash
claude mcp add rule34 --env RULE34_USER_ID=votre-id --env RULE34_API_KEY=votre-cle -- npx -y mcp-rule34

Claude Desktop, Cursor, et tout client au format de configuration standard

json
{  "mcpServers": {    "rule34": {      "command": "npx",      "args": ["-y", "mcp-rule34"],      "env": {        "RULE34_USER_ID": "votre-id",        "RULE34_API_KEY": "votre-cle"      }    }  }}

Node 24 ou plus récent est nécessaire. Les deux identifiants sont obligatoires ; tout le reste, sous Configuration, est facultatif.

Avec Docker

json
{  "mcpServers": {    "rule34": {      "command": "docker",      "args": [        "run",        "-i",        "--rm",        "-e",        "RULE34_USER_ID",        "-e",        "RULE34_API_KEY",        "ghcr.io/smeet666/mcp-rule34:2.1.0"      ]    }  }}

-i garde l'entrée standard ouverte, qui est le canal du protocole, et -t est omis parce qu'un TTY réécrit le flux. Le conteneur a besoin d'un accès HTTPS sortant vers api.rule34.xxx et rule34.xxx, et des deux identifiants pris dans votre environnement : aucun volume, aucun port.

Bundle, sans npm

Téléchargez mcp-rule34-2.1.0.mcpb depuis la dernière publication et ouvrez-le. Un client qui gère les bundles MCP l'installe seul, sans npm à lancer. Les identifiants se posent toujours dans la configuration du client.

Ce qu'on peut demander

  • « Comment le site orthographie-t-il cette étiquette ? »
  • « Trouve les publications portant ces deux étiquettes, triées par note. »
  • « La même recherche, sans monochrome. »
  • « Lis-moi la fiche de la publication 1234567. »
  • « Combien de publications cette recherche trouve-t-elle ? »

Le chemin ordinaire va d'une recherche d'étiquette à une recherche de publications : find_tags donne l'orthographe qu'emploie le site, et search_posts la reprend.

Les outils

OutilCe qu'il fait
find_tagsTrouve l'orthographe d'une étiquette, et combien de publications la portent.
search_postsCherche les publications par étiquettes, avec alternatives et exclusions.
get_postLit la fiche d'une publication par son identifiant ou son adresse.

Vérifiez une étiquette avant de chercher dessus. Le site indexe par étiquette seule, et une étiquette qu'il ne connaît pas ne correspond à rien, ce qui se lit comme un résultat vide plutôt que comme une faute d'orthographe.

find_tags

Trouve l'orthographe d'une étiquette.

ArgumentTypeRequisCe qu'il fait
querychaîne, jusqu'à 60 caractèresouiLe texte à vérifier.

En retour : query tel qu'envoyé, et tags, chacune avec l'orthographe qu'emploie le site et le nombre de publications qui la portent.

search_posts

Cherche les publications par étiquettes.

ArgumentTypeRequisCe qu'il fait
tagstableau de 1 à 10 noms d'étiquettesouiÉtiquettes qu'une publication doit porter.
any_oftableau de 1 à 10 noms d'étiquettesnonÉtiquettes dont une publication doit porter au moins une.
excludetableau de 1 à 10 noms d'étiquettesnonÉtiquettes qu'une publication ne doit pas porter.
media_typeimage, animated, video ou any, défaut anynonImages fixes, GIF ou MP4.
ratingquestionable ou explicitnonLes deux sont cherchés quand il est omis.
sortscore, id, updated ou random, défaut scorenonL'ordre de tri du site.
limitentier, 1 à 100, défaut 20nonPublications à servir.
pageentier, 1 à 200, défaut 1nonQuelle page de publications.

media_type se lit sur les étiquettes du site lui-même, donc la classification vaut ce que vaut l'étiquetage. Les deux classements ci-dessus sont les seuls que le site connaisse : toute autre valeur rend zéro publication et aucune erreur, ce qui livrerait une absence que le site n'a jamais eue.

En retour : tags, any_of et exclude tels que le site les orthographie ; query, la recherche telle qu'elle a été envoyée dans la langue du site ; total, les publications que toute la recherche trouve, tel que le site les compte ; et les publications elles-mêmes, chacune avec son id, post_url, file_url, preview_url, sample_url, width, height, score, rating et tags. La note est celle du site et elle est mise à jour une fois par jour.

get_post

Lit la fiche d'une publication.

ArgumentTypeRequisCe qu'il fait
identier, 1 ou plusl'un des deuxL'identifiant de la publication.
urlune adresse de page rule34.xxxl'un des deuxL'adresse de la page.

En retour : la publication que porte une ligne de recherche, avec sa liste complète d'étiquettes.

Configuration

Les deux identifiants sont obligatoires. Tout le reste est facultatif, et tout se pose dans le bloc env de la configuration du client.

VariableDéfautCe qu'elle fait
RULE34_USER_IDaucun, obligatoireL'identifiant numérique de votre compte.
RULE34_API_KEYaucun, obligatoireVotre clé d'API, qui est personnelle.
RULE34_USER_AGENTl'identité du projetNomme votre application auprès du site, avec une adresse où joindre une personne.
RULE34_MIN_INTERVAL_MS1000Écart entre deux requêtes, de 1000 à 60000.
RULE34_TIMEOUT_MS20000Délai d'une requête, de 1000 à 120000.
RULE34_MAX_RETRIES3Tentatives après un échec passager, de 0 à 10.
RULE34_CACHE_TTL_MS300000Durée pendant laquelle une réponse reste en mémoire, de 0 à 86400000.
RULE34_CACHE_MAX_ENTRIES300Réponses gardées en mémoire à la fois, de 0 à 10000.
RULE34_LOG_LEVELerrorsilent, error, info ou debug, écrit sur la sortie d'erreur.

D'où viennent les identifiants. Connectez-vous, ouvrez Account options, et trouvez la ligne API Access Credentials. Elle affiche &api_key=…&user_id=…, et ces deux valeurs sont ce qui va dans la configuration ci-dessus. Si la clé est vide, cochez Generate New Key? et enregistrez.

Le site délivre une clé par personne, et demande que les applications servant son contenu n'affichent aucune publicité et ne le placent derrière aucun péage. Ce serveur n'embarque aucune clé, et chacun apporte la sienne. Démarré sans identifiants, il tourne, publie ses outils, et répond à chaque appel en nommant les deux variables à poser : il n'envoie aucune requête dont il sait que le site la refusera.

Une valeur hors de sa plage retombe sur le défaut, et la raison est écrite sur la sortie d'erreur.

Erreurs

Chaque échec porte un des six codes, un message, et quand cela aide une indication du geste suivant.

CodeCe qui s'est passéQue faire
not_foundLe site a répondu, et n'a rien à cette adresse.Vérifiez l'identifiant avec search_posts.
invalid_inputLes arguments ont été refusés avant toute requête.Lisez le message, qui nomme l'argument. Un identifiant manquant est signalé ici.
rate_limitedLe site demande à ce client de ralentir.Attendez les secondes indiquées et rappelez avec les mêmes arguments. La publication est toujours là.
parse_failureLa réponse est arrivée dans une forme illisible ici.Signalez-le sur le suivi d'incidents.
network_errorLa requête n'a pas abouti.Réessayez sous peu.
timeoutLa requête a dépassé son délai.Augmentez RULE34_TIMEOUT_MS, ou demandez moins de publications.

Comme bibliothèque

La couche qui lit le site est publiée seule, avec son rythme, son cache et ses erreurs, sans protocole attaché.

ts
import { Rule34Client } from "mcp-rule34/client";
const client = new Rule34Client({ credentials: { userId: "…", apiKey: "…" } });const { data, cached } = await client.searchPosts({ tags: ["example"], limit: 5 });console.log(data.total, cached);

Chaque lecture répond { data, cached }, et lève une erreur portant un des six codes. Le plancher d'une seconde entre deux requêtes tient également ici.

Rythme et attribution

Les requêtes partent une à une avec au moins une seconde entre elles, et ce plancher tient quelle que soit la configuration. Le User-Agent se termine toujours par l'identité du projet et une adresse où joindre une personne.

Les lectures passent par l'API que le site documente, et les identifiants qu'il délivre sont ce que ses conditions demandent d'employer pour une lecture automatisée. Chaque résultat porte l'adresse de la page de la publication. Rien n'est téléchargé : une adresse de fichier traverse une réponse comme une chaîne de caractères.

Ce MCP est un projet non officiel, sans affiliation à rule34.xxx.

Confidentialité

Ce serveur ne collecte rien sur vous et n'envoie rien à son auteur. Il tourne sur votre machine, ne joint que api.rule34.xxx et rule34.xxx, garde ses réponses en mémoire le temps qu'il tourne, et n'écrit rien sur le disque. Vos identifiants sont lus dans l'environnement et envoyés à ce seul site. PRIVACY.md dit ce qu'une requête emporte et quels réglages changent cela.

Développement

bash
npm installnpm run build:fixturesnpm testnpm run check

Les tests s'exécutent sur des fixtures engendrées et n'émettent aucune requête. La suite en direct, npm run test:live, émet une requête par route et tourne chaque nuit contre le site lui-même.

Contribuer

Les anomalies, les questions et les idées ont leur place dans le suivi d'incidents. Les propositions de modification sont bienvenues ; ouvrir un ticket d'abord aide à s'accorder sur la forme du changement. Voir CONTRIBUTING.md.

Licence

MIT, voir LICENSE. Les publications et les étiquettes appartiennent à rule34.xxx et aux personnes qui les ont déposées.

來源:README.md,提交 3474e28

工具

3

search_posts

Search posts by tag

Search rule34.xxx for posts carrying a tag, or several tags at once. Tags are written as one token, so a name said as words is joined by underscores: 'asuka langley sohryu' and 'ranma 1/2' are single tags, and this tool joins them for you. Returns each post's page, its image or video URL, dimensions, score and rating, alongside the number of posts the whole search matches. A row shows the first 12 of a post's tags and says how many it has; call get_post for the whole list with a kind for every tag. Use 'media_type' to ask for still images, animations or video; the site classifies these itself. When a search finds nothing, the answer names the tags rule34.xxx does not hold, or says how many posts the tags match once the restrictions are dropped.

輸入參數pagesorttags必填limitany_ofratingexcludemedia_type

get_post

Read one post

Read one rule34.xxx post, named by its id or by a link to its page. Returns every tag the post carries, each with its kind (character, copyright, artist, general or metadata) and how many posts share it, alongside the image or video, the dimensions, the score, the rating, the uploader, the number of comments, the credited source and the date the site took the post in. Use this after a search, whose rows show only the first few tags of each post.

輸入參數idurl

find_tags

Find how a tag is spelled

Find how rule34.xxx spells a tag, and how many posts carry it. The site matches from the start of a name, so 'kimagure' finds 'kimagure_orange_road' while 'orange road' finds nothing. It offers at most ten names. Use this before searching when a name might be spelled differently, and after a search that found nothing because a tag does not exist.

輸入參數query必填

版本歷史

2
  1. v2.1.0最新Oct 29, 2026
  2. v2.0.2Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分