Ao3 Mcp

io.github.ArturLys由 GitHub 帳號 ArturLys 發布v0.1.2更新於 Oct 27, 2026

Search AO3 and have fics read by a secondary model before they're recommended

概覽

AI 產生的概覽

搜尋 AO3 同人小說,並由一個次要 Gemini 模型通讀全文,向助理回傳結構化報告與排名。

可以做什麼
  • 依同人圈、配對、角色、標籤、分級、字數、完結狀態與排序搜尋 AO3 作品,支援 AO3 搜尋運算子語法。
  • 透過即時自動完成把模糊說法解析為標準的 AO3 標籤、同人圈、配對與角色名稱。
  • 取得單篇作品的詮釋資料卡,包含標籤、統計、摘要與系列資訊。
  • 用次要 Gemini 模型通讀 1 至 20 篇全文,回傳每篇的情節、角色、文風、原文片段與內容提醒報告,並附上比較排名。
適用情境
適合希望推薦依據正文而非作者簡介的情況,也適合用 AI 寫小說或角色扮演時,從真實同人作品取得某一題材的節奏與文風參考。
執行需求
以 Python 3.10 以上版本透過 pip 安裝的在地套件執行。需要 Gemini API 金鑰,可用 --api-key 參數或 GEMINI_API_KEY 環境變數提供,說明稱免費額度已足夠。另有選用設定可選擇閱讀模型、備援模型與 AO3 請求間隔。需要連線至 AO3 與 Google Gemini API 的網路。
安裝前請注意
小說正文會傳送給 Google 的 Gemini API 閱讀,所搜尋的內容會離開本機。金鑰可放在環境變數而非命令列參數中,以免出現在參數清單裡。AO3 沒有官方 API,本服務以擷取網頁方式取得內容,可能被 Cloudflare 驗證阻擋。AO3 包含各種分級作品,包括成人內容,會依搜尋篩選條件原樣取得。小說下載內容會在本機快取 24 小時。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

ao3-mcp

[PyPI] [CI] [Python 3.10+] [License: MIT]

[ao3-mcp MCP server]

An MCP (Model Context Protocol) server that connects AI agents — Claude, Cursor, or any MCP client — to the Archive of Our Own. Search AO3 fanfiction with full filters, resolve fuzzy wording to canonical tags, and get fics actually read before they're recommended.

The trick: your agent never reads fic text. It delegates reading to a cheap secondary model (Gemini), which digests whole fics — even 150k-word novels — and returns structured reports. Your agent's context stays clean; the recommendations are based on the real text, not the blurb.

agent ──MCP──> server.py                 ├─ ao3.py     AO3 scraping (no public API exists) — throttled and polite                 └─ reader.py  Gemini reads the fics, reports back: plot, style,                               prose samples, content notes, a ranking

Why this beats blurb-based recommendations

An AO3 blurb is an ad written by the author. This server's workflow is: search wide (40–60 results), have the reader model read the shortlist — up to 20 full fics in one call — and recommend only what was actually read, with verbatim prose samples so quality is judged from the text itself.

Not just for finding your next read

If you write with an AI — fanfic, original fiction, roleplay — this doubles as an inspiration engine. Mid-scene, your agent can pull up how real fic authors handle the exact beat you're on:

Find three highly-kudosed fics where rivals are forced to share a bed, read them,and tell me how each one builds the tension — pacing, POV, what they leave unsaid.

The reader reports back with structure, style notes, and verbatim prose samples, so the model gets grounded in how the trope is actually written — not what it imagines fanfic sounds like. Works the same for roleplay: pull reports on fics that nail a character's voice and feed them in as style reference.

Install

Requires Python 3.10+ and a free Gemini API key:

Go to aistudio.google.com/api-keys, sign in with any Google account, and click "Create API key". The free tier is enough — no billing setup needed.

bash
pip install ao3-mcp

Add to your agent

Point command at ao3-mcp and pass your key with --api-key:

json
{  "mcpServers": {    "ao3": {      "command": "ao3-mcp",      "args": ["--api-key", "YOUR_GEMINI_KEY"]    }  }}

Prefer to keep the key out of the args list? Drop --api-key and pass it in an env block instead — the server reads GEMINI_API_KEY from the environment as a fallback:

json
"env": { "GEMINI_API_KEY": "YOUR_GEMINI_KEY" }
Claude Code
bash
claude mcp add ao3 -- ao3-mcp --api-key YOUR_GEMINI_KEY
Cursor

Cursor Settings → MCP → New MCP Server, paste the JSON config above.

Google Antigravity

Add the JSON config above to .gemini/antigravity/mcp_config.json.

VS Code / Copilot
bash
code --add-mcp '{"name":"ao3","command":"ao3-mcp","args":["--api-key","YOUR_GEMINI_KEY"]}'

Then just ask:

Find me a completed enemies-to-lovers longfic in <fandom>, read the top candidates, and tell me which is best written.

Launch params

ParamEnv varDefaultWhat it does
--api-keyGEMINI_API_KEY—Gemini API key (required).
--modelGEMINI_MODELgemini-flash-latestModel the reader uses.
--backup-modelGEMINI_MODEL_BACKUPgemini-flash-lite-latestFallback model when the main one is throttled.
--min-intervalAO3_MIN_INTERVAL0.6Minimum seconds between AO3 requests.

Tools

ToolWhat it does
search_worksSearch AO3: fandom, ship, character, tags, rating, word count, completion, sorting. 20 results/page, up to 5 pages per call. The query field supports AO3's full search-operator syntax (words>10000, kudos>500, sort:kudos, …).
find_tagsLive autocomplete — fuzzy wording → canonical AO3 tag, fandom, ship, or character names.
get_workFull metadata card for one work: tags, stats, summary, series info.
read_worksReads 1–20 full fics with the secondary model and returns a structured report per fic — plot, characters, style, verbatim prose samples, content notes — plus a comparison ranking them against your question.

Fic downloads are cached locally for 24h, so re-reading a fic with a new question costs no AO3 requests.

Good to know

  • AO3 has no API — this scrapes its (clean) HTML, one request at a time, throttled to one every 0.6s by default (tune with --min-interval) and honoring Retry-After. AO3 is volunteer-run; the politeness is deliberate.
  • Cloudflare: AO3 blocks plain HTTP clients. This uses curl_cffi with a mobile-Safari TLS fingerprint, which passes as of writing. If requests start failing with 403 + cf-mitigated: challenge, change IMPERSONATE in ao3.py.
  • Privacy: fic text goes to Google's Gemini API for reading; nothing else leaves your machine, no telemetry.
  • Adult content: AO3 hosts works across all ratings. The server passes through whatever your search scopes — use the rating filter and AO3's warning tags to control what gets fetched.

Make it yours

It's a small, single-purpose server — a few hundred readable lines with no framework magic. Fork it and edit anything: rewrite the reader's prompt, swap in a different model, change the throttle, add a tool. That's the intended way to use it.

Run it from source:

bash
git clone https://github.com/ArturLys/ao3-mcp.gitcd ao3-mcppython -m venv .venvsource .venv/bin/activate        # Windows: .venv\Scripts\activatepip install -r requirements.txt
python smoke_test.py YOUR_GEMINI_KEY   # end-to-end check: search → download → digestpython server.py --api-key YOUR_GEMINI_KEY   # or point your client's command at this

Credits

License

MIT

來源:README.md,提交 3e596e5

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分