{"id":"388620fc-314c-424c-84b4-c171240840ae","slug":"article2md","kind":"mcp","name":"article2md","summary":"Archive web articles — WeChat 公众号, Zhihu, Xiaohongshu, or any URL — as clean Markdown with local images. Built for Obsidian and LLM workflows.","owner":"tzrea1-Q","repoUrl":"https://github.com/tzrea1-Q/article2md","license":"MIT","licenseTier":"permissive","trust":"community","stars":2,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-06-11T02:49:23.000Z","addedAt":"2026-10-21T04:39:04.002Z","logoUrl":"https://avatars.githubusercontent.com/u/265031071?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["files-documents","browser-web","cloud-infra"],"tags":["archiver","cli","knowledge-base","llm","markdown","obsidian","playwright","readability"],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-21T04:39:20.930Z","sample":false,"url":"https://conduits.dev/tools/article2md","language":"JavaScript","transports":["stdio"],"install":{"npm":"article2md"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# article2md\n\n[English](README.md) | [简体中文](README.zh-CN.md)\n\n[![CI](https://github.com/tzrea1-Q/article2md/actions/workflows/ci.yml/badge.svg)](https://github.com/tzrea1-Q/article2md/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/article2md)](https://www.npmjs.com/package/article2md)\n[![node](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](package.json)\n[![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)\n\nTurn any web article — including WeChat, Zhihu, and Xiaohongshu posts behind login walls — into clean, semantic Markdown with locally saved images. Built for Obsidian-style knowledge bases and LLM workflows, and it runs entirely on your machine.\n\n## Why article2md\n\n- **Login-wall Chinese platforms.** WeChat Official Account, Zhihu, and Xiaohongshu articles get deleted or expire all the time. article2md archives them through your own logged-in browser session — no password stored, nothing sent to a cloud.\n- **Images live next to your notes.** Every image is downloaded into a local `assets/` folder with stable names, so your archive never shows broken images when a CDN link dies.\n- **Made for knowledge bases.** `index.md` starts with YAML front matter (`title`, `source`, `author`, `saved`, …) that Obsidian and Logseq understand out of the box.\n- **Made for LLM pipelines.** `--stdout` prints clean Markdown for piping into any AI CLI or script.\n- **Quality you can trust.** Every archive gets a quality grade plus a `manifest.json`; anything suspicious also gets a `diagnostics.json` for review.\n\n## Quick start\n\n```bash\nnpm install -g article2md\nnpx playwright install chromium   # one-time browser download\n\narticle2md save \"https://www.anthropic.com/engineering/building-effective-agents\"\n```\n\nAlready copied a link? Just run:\n\n```bash\narticle2md save\n```\n\nPrefer a local web UI?\n\n```bash\narticle2md ui\n```\n\n## How it compares\n\n|  | article2md | Browser clipper extensions | Cloud URL→Markdown services |\n|---|---|---|---|\n| WeChat / Zhihu / Xiaohongshu behind login | Yes, with your own session | Partial | No |\n| Images downloaded locally | Yes, stable `assets/` names | Varies | No, remote links |\n| Batch archiving | Yes | No | Yes |\n| Privacy | Fully local | Local | Pages sent to a cloud |\n| Quality report | Manifest + diagnostics | No | No |\n\n## Usage\n\n```bash\n# Save a single article (directory per article)\narticle2md save \"https://example.com/article\" --out ~/notes/articles\n\n# Save the URL currently on your clipboard\narticle2md save\n\n# Print Markdown to stdout (no files written; great for piping into LLM tools)\narticle2md save \"https://example.com/article\" --stdout\n\n# Batch save a list of URLs\narticle2md batch urls.txt --out ~/notes/articles --skip-existing\n\n# Local web UI\narticle2md ui --port 4312\n```\n\nCommon options:\n\n```text\n-o, --out <directory>     Output directory. Defaults to \"articles\".\n--stdout                  Print Markdown to stdout instead of writing files (save only).\n--no-front-matter         Skip the YAML front matter block.\n--force                   Overwrite an existing article directory.\n--skip-existing           Skip when the article directory already exists.\n--dry-run                 Show the planned output path without writing files.\n--image-retries <count>   Retry failed image downloads. Defaults to 1.\n--image-timeout-ms <ms>   Image download timeout. Defaults to 15000.\n```\n\nURL list format for `batch`:\n\n```text\n# Blank lines and full-line comments are ignored.\nhttps://www.anthropic.com/research/building-effective-agents\nhttps://openai.com/research/\nhttps://example.com/article#section\n```\n\n## Use with AI agents (MCP)\n\narticle2md ships an [MCP](https://modelcontextprotocol.io) server, so agents like Cursor, Claude Code, and Claude Desktop can archive articles for you mid-conversation — \"save this article to my knowledge base\" just works.\n\nAdd it to your MCP config (e.g. `~/.cursor/mcp.json` or Claude Desktop's `claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"article2md\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"article2md\", \"mcp\", \"--out\", \"/absolute/path/to/your/articles\"]\n    }\n  }\n}\n```\n\nIf article2md is installed globally, `\"command\": \"article2md\", \"args\": [\"mcp\", \"--out\", \"...\"]` works too.\n\nExposed tools:\n\n- `save_article` — archive a URL as Markdown with local images into your articles directory\n- `read_article` — return an article as clean Markdown text without writing files\n- `auth_status` — check which login sessions (zhihu / weixin / xiaohongshu) are saved\n\n`--out` sets the default output directory (`~` is expanded); the agent can override it per call. Logging in for walled sources still happens in your terminal: `article2md auth login <profile>`.\n\n## Output\n\nEach article becomes a folder. Titles with Chinese characters keep them in the folder name; English-only titles use ASCII slugs.\n\n```text\narticles/\n  building-effective-agents/\n    index.md          # Markdown with YAML front matter\n    manifest.json     # metadata, quality grade, image list\n    diagnostics.json  # written only when the archive needs review\n    original.html     # rendered page snapshot\n    preview.html      # local preview with images\n    assets/\n      001-diagram-a1b2c3.png\n```\n\n`index.md` starts with front matter your note tools can index:\n\n```yaml\n---\ntitle: \"Building effective agents\"\nsource: \"https://www.anthropic.com/engineering/building-effective-agents\"\nsite: \"Anthropic\"\nsaved: \"2026-08-12T15:46:18.177Z\"\nquality: \"exact-ish\"\n---\n```\n\nDisable it with `--no-front-matter` or `\"frontMatter\": false` in the config file.\n\n`batch-report.json` records per-URL status: `success`, `skipped`, `dry-run`, or `failed` (a failed URL never stops the rest of the batch).\n\n## Fixed sources\n\narticle2md recognizes these sources and applies dedicated extraction rules; every other public page goes through the generic article extractor:\n\nAnthropic, OpenAI, Google DeepMind, Google Research, Hugging Face, Microsoft Research, Berkeley AI Research, Lilian Weng, Chip Huyen, Simon Willison, Jiqizhixin (机器之心), QbitAI (量子位), Zhihu (知乎), WeChat Official Accounts (微信公众号), Xiaohongshu (小红书), Medium, Substack.\n\nWant another site to work great? [Request a source adapter](https://github.com/tzrea1-Q/article2md/issues/new?template=source_request.yml) or add one yourself — see [CONTRIBUTING.md](CONTRIBUTING.md).\n\nIt intentionally drops page chrome: navigation, ads, footers, recommendations, popups, and comments.\n\n## Session login (Zhihu, WeChat, Xiaohongshu, Medium, Substack)\n\nSome articles require a logged-in browser session — Zhihu login walls, WeChat verification, Xiaohongshu notes, Medium member-only stories, Substack paid posts, or sites that challenge automated browsers. Log in once in a headed Chromium window; archive commands then reuse the saved Playwright `storageState`:\n\n```bash\narticle2md auth login zhihu        # or weixin / xiaohongshu / medium / substack\narticle2md auth status\narticle2md auth logout all\n```\n\nSessions are stored per profile under `~/.article2md/sessions/` (override with `ARTICLE2MD_SESSIONS_DIR`). They contain cookies — never commit them.\n\n## Configuration\n\nCopy `article2md.config.example.json` to `article2md.config.json` to set local defaults:\n\n```json\n{\n  \"out\": \"articles\",\n  \"skipExisting\": false,\n  \"force\": false,\n  \"dryRun\": false,\n  \"frontMatter\": true,\n  \"imageRetries\": 1,\n  \"imageTimeoutMs\": 15000\n}\n```\n\n## Install from source\n\n```bash\ngit clone https://github.com/tzrea1-Q/article2md.git\ncd article2md\nnpm install\nnpx playwright install chromium\nnode ./src/index.js save \"https://example.com/article\"\n```\n\n## Quality grades\n\n- `exact-ish`: fixed source matched and passed semantic checks\n- `good`: generic extraction passed semantic checks\n- `needs-review`: extraction succeeded, but warnings suggest a manual check\n- `failed`: reserved for future recoverable-failure reports\n\n## Roadmap\n\nHighlights (see [ROADMAP.md](ROADMAP.md) for details):\n\n- Medium / Substack adapters\n- Single-file export and clipboard watch mode\n- RSS/Atom feed input for batch archiving\n\n## Contributing\n\n- Run `npm test` before opening a PR\n- Behavior changes need new or updated tests\n- Keep changes focused so they are easy to review\n- Missing Chromium locally? Run `npx playwright install chromium`\n\n## Security boundaries\n\nThis tool archives pages you can already open in your browser. Zhihu, WeChat, and Xiaohongshu support reuses a local Playwright `storageState` saved after you log in manually.\n\n| Allowed | Not allowed |\n|---------|-------------|\n| You log in manually; the tool persists and reuses `storageState` | Storing passwords or auto-filling credentials |\n| Archiving pages your account can already view | Defeating captchas, paywalls, or anti-bot systems |\n| Session files stay in your local profile directory | Sharing/committing session files; mixing cookies across sites |\n\nReport security issues privately through GitHub Security Advisories first.\n\n## License\n\nMIT\n"}