MediaCrawler MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| APIFY_TOKEN | No | Apify token used for the Xiaohongshu backend. Can also be saved alone in ~/.config/mediacrawler/apify-token.txt (mode 0600); the file is read on each call. | |
| MEDIACRAWLER_HOME | Yes | Path to the cloned MediaCrawler repo (must contain main.py). The only required variable. Default: ~/MediaCrawler | |
| MEDIACRAWLER_RUNNER | No | `uv` → `uv run main.py`; or `python`. Default: uv | |
| MEDIACRAWLER_DELAY_MAX | No | Random delay window maximum (s). Default: 5 | |
| MEDIACRAWLER_DELAY_MIN | No | Random delay window minimum (s). Default: 2 | |
| MEDIACRAWLER_GUARD_DIR | No | Where the optional risk guard keeps its shared state. Default: <HOME>/.risk_guard | |
| MEDIACRAWLER_ENABLE_CDP | No | Reuse your logged-in Chrome. Default: true | |
| MEDIACRAWLER_LOGIN_TYPE | No | `--lt` value: qrcode / phone / cookie. Default: qrcode | |
| MEDIACRAWLER_RATE_CALLS | No | Max tool calls per window. Default: 10 | |
| MEDIACRAWLER_DEFAULT_MAX | No | Items per call when unspecified. Default: 20 | |
| MEDIACRAWLER_RATE_WINDOW | No | Rate-limit window (s). Default: 600 | |
| MEDIACRAWLER_RUN_TIMEOUT | No | Per-run subprocess timeout (s). Default: 1800 | |
| MEDIACRAWLER_SAVE_OPTION | No | Output format (json recommended). Default: json | |
| MEDIACRAWLER_ENABLE_PROXY | No | Enable MediaCrawler's proxy pool. Default: false | |
| MEDIACRAWLER_APIFY_MAX_USD | No | Default per-run Apify charge limit in USD. Default: 2 | |
| MEDIACRAWLER_QUEUE_TIMEOUT | No | How long a crawl may wait for the ones ahead of it (s). Default: 3600 | |
| MEDIACRAWLER_MAX_HARD_LIMIT | No | Absolute cap; larger requests clamped. Default: 50 | |
| MEDIACRAWLER_ENABLE_COMMENTS | No | Collect comments by default. Default: false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_platforms | List supported platforms and the capability matrix. Returns platform codes, human-readable names, and which crawl types each supports. All platforms support search / detail / creator per MediaCrawler. |
| search_posts | Keyword-search a platform and return matching public posts (+comments). Args: platform: one of xhs, dy, ks, bili, wb, tieba, zhihu. keywords: search query. Multiple keywords may be comma-separated. max_count: max posts to fetch (default from config, hard-capped). with_comments: include comments (default from config). sort: optional sort hint (platform-dependent; may be ignored). Returns a dict: {ok, platform, count, items:[{id, author, content, like_count, comment_count, publish_time, url, comments?}], raw_files, warnings}. items holds only what this call crawled; raw_files are MediaCrawler's per-day files, which also hold every earlier crawl of that day. Browser crawls run one at a time across every project on this machine, so this call first waits for any crawl ahead of it (queue_wait_seconds says how long). If that wait outlasts MEDIACRAWLER_QUEUE_TIMEOUT, ok is false and error is "queue_timeout". If the crawl fails and saves nothing, ok is false, error is "crawl_failed" and details gives the reason. If it stops after saving some results, ok stays true with partial: true and the reason in warnings. ok: true with count 0 means the crawl finished without finding anything; check warnings. |
| get_post_detail | Fetch specific posts by their platform id(s), with optional comments. Args: platform: one of xhs, dy, ks, bili, wb, tieba, zhihu. post_ids: platform-native IDs. XHS accepts note IDs, ordinary note URLs and xhslink.com links. with_comments: include comments (default from config). Browser platforms queue behind other local browser crawls. XHS uses Apify. |
| get_creator_posts | Fetch posts from one or more creators' home pages. Args: platform: one of xhs, dy, ks, bili, wb, tieba, zhihu. creator_ids: list of creator ids (or profile URLs for tieba/zhihu). max_count: max posts per creator (default from config, hard-capped). Browser platforms queue behind other local browser crawls. XHS uses Apify. |
| risk_status | Show MediaCrawler's risk guard for a platform: request budget used and whether crawling is paused after a captcha / risk-control signal. Check this before planning a large crawl; the guard is shared by every process using the same MediaCrawler checkout. |
| login_status | Report configuration health and login guidance. MediaCrawler caches login sessions in a browser context. This tool cannot silently re-login; instead it validates configuration and tells you when a manual QR-code scan is likely required. |
| diagnostics | Return MediaCrawler ok is false, with error "startup_failed", when MediaCrawler cannot start. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |