Skip to main content
Glama
linuxdo-mcp
by Xero-Team

linuxdo-mcp

MCP server for reading two Discourse forums: linux.do and idcflare.com. Anonymous by default: no account, no API key, no cookie to paste.

One process serves one site, chosen at startup, because the two need different transports and expose different tools. Everything else — the payload model, the paging rules, the image handling — is shared.

Choosing the site

$ uv run linuxdo-mcp                      # linux.do, the default
$ LINUXDO_SITE=idcflare uv run linuxdo-mcp

LINUXDO_SITE accepts linuxdo or idcflare. The site is resolved before any tool is described, so the tool names, their descriptions, and the server instructions all match the forum actually being read. A host that wants both runs two MCP entries:

{
  "mcpServers": {
    "linuxdo": { "command": "uv", "args": ["run", "linuxdo-mcp"] },
    "idcflare": {
      "command": "uv",
      "args": ["run", "linuxdo-mcp"],
      "env": { "LINUXDO_SITE": "idcflare" }
    }
  }
}

linux.do

idcflare.com

search tool

absent: full-text search needs a login

present: /search.json answers anonymously

Transport

httpx with a stored Cloudflare clearance

curl_cffi reproducing a browser TLS fingerprint

Cloudflare clearance

required, refreshed by a headful browser

never needed; no credential is held

Tags

about 2200, so min_count/limit matter

17, so one page holds the vocabulary

Uploaded images

cdn*.ldstatic.com

idcflare.com

The two forums barely overlap in content: on 2026-12-02 the 60 newest-plus-hot titles on each shared exactly zero topics, and the category trees are unrelated (linux.do is a developer community; idcflare is server deals, reviews, and tutorials). Reading both is running both.

Related MCP server: USCardForum MCP Server

Why there is a browser in the loop (linux.do only)

linux.do sits behind Cloudflare, and every anonymous JSON request is answered with a managed challenge instead of Discourse data:

$ curl https://linux.do/latest.json
HTTP/2 403
cf-mitigated: challenge
<html><head><title>Just a moment...</title></head>…

Measured on 2026-12-01: browser headers, curl_cffi TLS impersonation, and headless Chromium all fail. A headful Chromium with a real GPU solves the challenge in a few seconds and leaves a cf_clearance cookie in its profile. Once that cookie exists, plain httpx with the matching User-Agent gets 200 — the clearance is the only thing the edge wants from an API client.

idcflare needs none of that. Measured on 2026-12-02: its edge judges the TLS fingerprint, not a credential — curl with a browser user agent gets 200, httpx gets 403 cf-mitigated: challenge with every header set tried, and curl_cffi gets 200 with no cookie at all. So the idcflare instance runs curl_cffi and never opens a browser, stores a cookie, or asks for a display.

So the transport has two speeds:

Phase

Mechanism

Frequency

Acquire

headful Chromium on a persistent profile, wait for the challenge to clear

once, then when the cookie stops working

Read

httpx with the stored clearance headers

every tool call

Nothing is fetched with the browser except the initial page load. The browser window appears for a few seconds during acquisition and closes itself.

Install

$ uv sync --extra browser
$ uv run playwright install chromium

--extra browser is only needed for linux.do, and even then it is optional: without Playwright the server still runs, and a challenge fails with a message naming the missing piece. The idcflare instance never imports Playwright.

Use

$ uv run linuxdo-mcp doctor            # where am I? clearance age, edge status
$ uv run linuxdo-mcp doctor --refresh  # linux.do: open the browser once and replace the clearance
$ uv run linuxdo-mcp                   # stdio MCP server
$ uv run linuxdo-mcp --transport streamable-http --host 127.0.0.1 --port 8000

doctor reports the selected site, its transport, and its credential state, then probes /latest.json and — on idcflare — /search.json. On idcflare there is nothing to refresh, so --refresh prints that and does nothing.

For linux.do, the clearance lives in ${XDG_CACHE_HOME:-~/.cache}/linuxdo-mcp/ (mode 0600), next to the Chromium profile. It is never printed, logged, or returned by a tool; session_status reports only a fingerprint, an age, and whether it has gone past 30 days (stale). A stale cookie is still replayed — the browser only runs again when linux.do actually challenges, or when you ask for it. The idcflare instance loads nothing from that directory and reports mode: "anonymous".

On a host without a display the acquisition step cannot run. Copy that directory from a desktop session, or accept that reads will fail with a challenge message.

An MCP host spawns the server with a filtered environment, so DISPLAY and WAYLAND_DISPLAY usually do not reach it even on a desktop. session_status therefore reports browser_available: false there and names the cause in browser_unavailable_reason; the clearance still works, and a refresh has to run from your own shell (doctor --refresh).

Tools

Tool

Answers

browse_topics

what is new (latest), today's score (hot), a period (top), a category, a tag, or a filter by order/status/tag

search

keyword hits with their topic, post, excerpt, and author (idcflare only)

list_categories

category and subcategory ids and slugs, cached ten minutes

list_tags

tag names with topic counts, for browse_topics(tag=...)

get_topic

the posts of one topic, as text; walk a long one with next_post_number

get_post

one post by id, without pulling the topic window

get_post_image

one image of a post as an MCP image block, size-capped

get_user

a profile, plus activity totals and recent topics with include_summary

session_status

the site, its transport, whether a clearance is loaded and whether a refresh can run here

On linux.do there is no search tool: it requires a login for full-text search ({"error_type": "not_logged_in"}). /filter.json still accepts tag:, status:, order: and likes-min: terms anonymously, which is what sort="filter" composes; categories and tags remain the keyword-free way in.

idcflare does answer search anonymously, so that instance registers search: a term returns matched posts with topic_id, post_number, an excerpt as plain text (the highlight markup is stripped), the author, and the topic title joined from the same response. Pass next_page back as page to read on; a page holds up to 50 hits.

Pass a tag's name to browse_topics. Discourse's slug is for display only: an ASCII tag routes by either form, but a Chinese tag's slug is {id}-tag and /tag/31-tag.json returns 404, while /tag/公告.json works.

list_tags returns the band /tags.json publishes (about 2,200 names on linux.do), not every tag a topic can carry: linux.do omits some routable tags from that list (「公告」 is absent there yet /tag/公告.json answers). So a tag missing from list_tags is unknown, not nonexistent — pass it to browse_topics(tag=...) to confirm.

list_categories flattens both levels, because a topic's category_id can name a subcategory: its route carries the parent slug (/c/feedback/announcement/49.json), and a bare /c/announcement/49.json only redirects.

Paging is cursor-driven: browse_topics returns next_page, and passing it back as page yields the next window (null means the listing ended). Page sizes are 30 except for top and hot, which are 50 — read per_page rather than assuming. limit defaults to 50. Trim it below the page size and the reply is cut, trimmed says how many topics were withheld, and next_page is null: a page cursor starts after the whole upstream page, so hand it back and the withheld tail is skipped for good. Raise limit to read that tail, or keep 50 while paging.

Pinned topics occupy the first slots of a page whatever the requested order, so a sort=filter order=likes page starts with them, not with the most-liked ordinary topic. They carry pinned: true; skip them when ranking.

Long topics work the same way: get_topic returns one window of posts plus next_post_number, which is what to pass back as post_number (null means the last window). Windows overlap rather than skip, so a few posts may repeat. The header's highest_post_number is the real end of the walk: deleted posts leave holes, so it exceeds posts_count and stream_length. Exact posts come from post_ids, which costs a second upstream call because linux.do ignores that parameter on the topic route; its next_post_number continues by position from the highest requested number, not by id.

Bodies, images, and truncation

Every read asks for include_raw=true, so body is the author's own Markdown rather than cooked HTML reduced to text: about half the characters on a long post (7,085 vs 15,149 on one measured linux.do post), with tables and link targets intact. Discourse omits raw for a few posts; those fall back to the HTML path automatically, and include_raw=false requests the simplified text outright. Discourse's |WxH size suffix is dropped from an image's alt text, so a Markdown host renders the description instead of alt|690x350.

A small action post (the topic was pinned, closed, or a user joined) has no body at all upstream. Those carry action_code (pinned_globally.enabled) and an empty body, so an empty post is never a rendering failure.

Each post carries images, in document order, with the lightbox's original file and the downscaled render side by side:

{
  "url": "https://cdn3.ldstatic.com/original/4X/c/7/2/…jpeg",
  "thumb_url": "https://cdn3.ldstatic.com/optimized/4X/c/7/2/…_2_512x499.jpeg",
  "alt": "image"
}

thumb_url is null when Discourse served no render for that file; the image is still readable, just only at its original size.

Emoji and avatars are excluded: both are decoration, and a quote or onebox pulls in the quoted author's avatar along with the real content. A read never downloads images; get_post_image does, one file at a time, on request (below). The links need no clearance because the media hosts serve those files publicly.

body is Markdown throughout, with two Discourse forms normalised before it reaches a caller. A quoted reply arrives as BBCode ([quote="user, post:3, topic:1"]…[/quote]) and comes back as a > **user** blockquote; an uploaded image's upload://… short link is replaced with the CDN URL already listed in images, when the two counts line up. If they do not line up, the short link is left alone and images stays the authoritative list.

Reading an image

get_post_image(topic_id, post_id, index) returns the file itself as an MCP image block plus one text line naming it, so a host that renders images can look at a screenshot or a resume without a second download step. Read the post first: index is the position in that post's images.

  • One image per call, on purpose: a 20-post window can embed 20 pictures, and a topic read must not become megabytes of base64.

  • size="full" (default) fetches the original; size="thumb" the inline render. A tall image has an unreadable render (a 1080×5285 resume becomes 102px wide), which is why full is the default. When Discourse has no render for the file, thumb returns the original and the text line says so.

  • max_bytes defaults to 4 MiB. An original over it comes back as its render and the text line says the substitution happened; a render that is also too big is reported rather than retried.

  • Only the selected site's media hosts over https are ever requested: cdn*.ldstatic.com for linux.do, idcflare.com for idcflare. Post content is untrusted input, so any other host in an image URL is refused instead of fetched.

  • A clearance is not sent with an image: the hosts serve these files publicly, and the cookie belongs to the forum host alone.

max_post_chars (default 8000, per post) caps body; a post that hit it reports truncated: true. Raise the cap for that one post instead of treating the cut text as the whole thing.

Development

$ uv run ruff format --check .
$ uv run ruff check .
$ uv run pytest -q

Tests never touch either forum: they drive httpx.MockTransport with captured payloads.

Available Tools

8 tools
browse_topicsBrowse linux.do topicsA
Read-onlyIdempotent

List topics on linux.do by recency, rank, category, tag, or filter.

Use this to discover topic ids; pass one to get_topic for the actual posts. linux.do needs a login for full-text search, so this filter surface is the way in: filter reorders by likes, views, or replies and narrows by state and tag, with no keyword matching. hot is Discourse's daily score, not velocity, and is the same call as top with period=daily.

To page, pass the previous page's next_page back as page; it is null on the last page. A page holds per_page topics (30, or 50 for top/hot), so leave limit at 50 while paging: a smaller limit trims the reply, reports how many it withheld in trimmed, and withholds next_page, because a page cursor cannot resume mid-page. Raise limit to read the withheld tail.

Inputs: tag, page, sort, limit, +4 more. Returns: A page of topics plus the cursor for the next one.

get_postRead one linux.do postA
Read-onlyIdempotent

Read a single post as text.

Prefer this over get_topic when the caller already knows the post id: it fetches one post instead of the topic's default window.

body holds the author's Markdown, images the pictures the post embeds, and truncated says whether max_post_chars cut it.

Inputs: post_id (required), topic_id (required), include_raw, max_post_chars. Returns: One post inside a topic, as text a caller can read and quote.

get_post_imageFetch one image from a post on linux.doA
Read-onlyIdempotent

Return one post image as an MCP image block, so it can be viewed directly.

Read the post first: images there lists what this tool can fetch, in document order, emoji and avatars excluded. One image per call keeps a long topic from arriving as megabytes; ask again with another index for the rest.

Only files on ldstatic.com are fetched, so nothing else a post links to is ever requested. An original larger than max_bytes comes back as its downscaled render, and the text line says so.

Inputs: post_id (required), topic_id (required), size, index, +1 more.

get_topicRead a linux.do topicA
Read-onlyIdempotent

Read one topic with its posts as text.

Returns the header plus one window of posts. To read the rest of a long topic, pass next_post_number back as post_number; it is null once the window reaches the last post. Windows overlap rather than skip, so a caller may see a few posts twice.

post_ids and post_number are two ways to name the same window: ids are exact, a post number gets whichever window contains it. For a single known post, prefer get_post: it makes one request instead of a header plus a window.

Each post carries images in document order, and truncated when its body hit max_post_chars.

Inputs: topic_id (required), post_ids, include_raw, post_number, +1 more. Returns: A topic header plus the posts embedded in this response.

get_userRead a linux.do userA
Read-onlyIdempotent

Read one user's profile, optionally with their activity totals.

Use this to judge who wrote a post; use get_topic for the posts themselves. Anonymous reads see public profiles only, and trust-level gated fields can be absent — an absent number means "not returned", never zero.

Inputs: username (required), include_summary. Returns: A forum profile, plus its activity bucket when the caller asked for it.

list_categoriesList linux.do categoriesA
Read-onlyIdempotent

Return the forum's categories with ids and slugs.

Call this first when a request names a Chinese category (开发调优): the slug cannot be derived from the display name. Cached for ten minutes.

Inputs: no named parameters. Returns: Every category visible to an anonymous reader.

list_tagsList linux.do tagsA
Read-onlyIdempotent

Return the tags /tags.json publishes, with topic counts.

Tags are the closest anonymous substitute for search here. The band holds about 2200 of them and upstream order is not by popularity, so this sorts by count and trims: total is what the forum sent, matched is what survived query and min_count, and tags is the first limit of that.

This band is what the forum lists, not every routable tag: a tag absent here can still work with browse_topics(tag=...), so treat a missing tag as unknown, not nonexistent. Pass a tag's name to browse_topics. Its slug is for display: an ASCII tag routes by either, but a Chinese tag's slug (31-tag) returns 404.

Inputs: limit, query, min_count. Returns: Tags narrowed to what the caller asked for, most-used first.

session_statusReport the linux.do sessionA
Read-onlyIdempotent

Report how this server currently reaches linux.do.

Shows whether a Cloudflare clearance is loaded, its fingerprint and age, and whether a browser refresh can run in this process. When it cannot, browser_unavailable_reason says why: no Chromium, no Playwright, or no DISPLAY — an MCP host may have stripped the display from the child environment, in which case run 'linuxdo-mcp doctor --refresh' from a desktop shell. It never returns the cookie.

Inputs: no named parameters. Returns: What this process currently is to the configured forum, never the credential.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 8 tools

    Disambiguation4/5

    The two read tools (get_topic and get_post) genuinely overlap in the sense that both return post text, but the descriptions explicitly resolve this by telling the agent to prefer get_post for a known post id and get_topic for a window. list_categories, list_tags, browse_topics, get_post_image, get_user, and session_status each target a distinct resource, so selection is unambiguous in practice.

    Naming Consistency4/5

    Seven of eight tools follow a clean verb_noun snake_case pattern (list_categories, browse_topics, list_tags, get_post, get_post_image, get_topic, get_user). session_status breaks the pattern as a bare noun phrase, but it is the sole deviation and remains self-explanatory.

    Tool Count5/5

    Eight tools is well within the sweet spot and each one earns its place: discovery (categories, tags, topics), reading (topic, post, image), identity (user), and diagnostics (session_status). There is no obvious redundancy or padding.

    Completeness4/5

    For a read-only forum client the surface is solid: navigation, topic windows with pagination, single-post fetch, inline images, and user profiles. The main gaps are full-text search (documented as an upstream login restriction with tag/filter workarounds) and any per-user topic/activity listing or write operations, which limit some workflows but do not create dead ends for reading.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to interact with Discourse forums through search, reading topics/posts, managing categories and users. Supports secure authentication and optional write operations with rate limiting.
      14
      19,861 npm
      81
      MIT
    • A
      license
      A
      quality
      Not graded
      maintenance
      Enables interaction with USCardForum, a Discourse-based community focused on US credit cards and points. Provides 22 tools for discovering topics, reading content, researching user profiles, and managing authenticated actions like notifications and bookmarks.
      22
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables interaction with USCardForum, a Discourse community focused on US credit cards and points, providing 22 tools for discovering topics, reading content, researching user profiles, and managing authenticated actions like notifications and bookmarks.
      22
      MIT