ao3-mcp

ao3-mcp

Model Context Protocol server for Archive of Our Own: search fanfiction and have an AI read and rank fics for you.

Category
访问服务器

README

ao3-mcp

<!-- mcp-name: io.github.ArturLys/ao3-mcp -->

Python 3.10+ License: MIT

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.

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.

pip install ao3-mcp

Add to your agent

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

{
  "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:

"env": { "GEMINI_API_KEY": "YOUR_GEMINI_KEY" }

<details> <summary>Claude Code</summary>

claude mcp add ao3 -- ao3-mcp --api-key YOUR_GEMINI_KEY

</details>

<details> <summary>Cursor</summary>

Cursor SettingsMCPNew MCP Server, paste the JSON config above.

</details>

<details> <summary>Google Antigravity</summary>

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

</details>

<details> <summary>VS Code / Copilot</summary>

code --add-mcp '{"name":"ao3","command":"ao3-mcp","args":["--api-key","YOUR_GEMINI_KEY"]}'

</details>

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

Param Env var Default What it does
--api-key GEMINI_API_KEY Gemini API key (required).
--model GEMINI_MODEL gemini-flash-latest Model the reader uses.
--backup-model GEMINI_MODEL_BACKUP gemini-flash-lite-latest Fallback model when the main one is throttled.
--min-interval AO3_MIN_INTERVAL 0.6 Minimum seconds between AO3 requests.

Tools

Tool What it does
search_works Search 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_tags Live autocomplete — fuzzy wording → canonical AO3 tag, fandom, ship, or character names.
get_work Full metadata card for one work: tags, stats, summary, series info.
read_works Reads 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:

git clone https://github.com/ArturLys/ao3-mcp.git
cd ao3-mcp
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements.txt

python smoke_test.py YOUR_GEMINI_KEY   # end-to-end check: search → download → digest
python server.py --api-key YOUR_GEMINI_KEY   # or point your client's command at this

Credits

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选