discourse-mcp
Provides tools for interacting with Discourse forum software, including reading and writing posts and topics, searching, managing drafts, and reading images for vision models.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@discourse-mcp show me the latest topics on the forum"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
discourse-mcp (Cloudflare-friendly fork)
Fork of the official discourse/discourse-mcp that routes Discourse API traffic through impers (curl-impersonate / curl_cffi-style TLS fingerprints).
Use this when the target forum sits behind Cloudflare (or similar) and the stock MCP gets 403 Just a moment... from Node's native fetch.
Upstream | This fork | |
HTTP |
|
|
Default fingerprint | — |
|
CF 403 | fails immediately | delayed retry (same profile, backoff) |
Images | markdown |
|
HTTP rate limit | write tools ~1/s only | Optional sliding window on all HTTP ( |
libcurl-impersonate | — | impers resolve order; if missing, |
Requires Node.js >= 24.
Install in Grok Build
1. Profile (auth)
Create ~/.grok/discourse-profile.json (example for a User API key):
{
"site": "https://www.example.com/",
"impersonate": "chrome120",
"auth_pairs": [
{
"site": "https://www.example.com/",
"user_api_key": "YOUR_USER_API_KEY",
"user_api_client_id": "discourse-mcp"
}
],
"read_only": false,
"allow_writes": true,
"log_level": "info",
"rate_limit_max": 15,
"rate_limit_window_ms": 60000,
"rate_limit_min_interval_ms": 200
}HTTP sliding-window rate limit
Measured on uscardforum (Cloudflare / edge):
Observation | Value |
Burst until first 429 | ~20 sequential requests |
Recovery after full burst | ~40s of continued 429 on probes, then OK |
Sustained 1 req / 0.8–1.2s | Still hits 429 after ~20 → not pure RPS |
Sustained 1 rps in earlier run | Can stay green for short runs, but window still caps at ~20 |
So the dominant pattern is ~20 requests per rolling ~60s window, not a fixed RPS ceiling. Client-side limit should be a sliding window.
Profile / CLI:
Field | Meaning |
| Max requests in the window ( |
| Window length (default |
| Optional min gap between requests |
uscardforum-safe defaults used locally: 15 / 60s + 200ms min interval (margin under the ~20 hard edge).
Cross-process / all clients: when rate limiting is enabled, timestamps are stored under a shared cache directory (not ~/.grok):
Platform | Default state dir |
macOS / Linux |
|
Windows |
|
Override with profile rate_limit_state_dir or env DISCOURSE_MCP_RATE_LIMIT_DIR.
One file per site origin (sha1(origin).json) + .lock. Multiple Grok/Claude/Cursor MCP processes share the same window. If the file lock fails, the process falls back to in-memory limiting and logs an error.
Generate a User API key (no admin required):
npx -y github:Sakura-Byte/discourse-mcp generate-user-api-key \
--site https://www.example.com/ \
--save-to ~/.grok/discourse-profile.json2. ~/.grok/config.toml
[mcp_servers.discourse]
command = "npx"
args = [
"-y",
"github:Sakura-Byte/discourse-mcp",
"--profile",
"/Users/YOU/.grok/discourse-profile.json",
]
enabled = true
startup_timeout_sec = 120First launch may download npm deps and
libcurl-impersonate(or useghif GitHub API is rate-limited). Prefer a longerstartup_timeout_sec.
3. Refresh MCP
New Grok session, or
/mcps→rrefreshCheck:
grok mcp doctor discourse
Related MCP server: Discourse MCP
Install in other MCP clients
Claude Desktop / Cursor-style JSON
{
"mcpServers": {
"discourse": {
"command": "npx",
"args": [
"-y",
"github:Sakura-Byte/discourse-mcp",
"--profile",
"/absolute/path/to/profile.json"
]
}
}
}Local clone
git clone https://github.com/Sakura-Byte/discourse-mcp.git
cd discourse-mcp
npm install # runs prepare → tsc build
node dist/index.js --profile /path/to/profile.jsonGrok / client:
[mcp_servers.discourse]
command = "node"
args = ["/ABS/PATH/discourse-mcp/dist/index.js", "--profile", "/path/to/profile.json"]
enabled = true
startup_timeout_sec = 60libcurl-impersonate
Resolution order (impers native):
LIBCURL_IMPERSONATE_PATHLIBCURL_PATHCommon install paths
GitHub download into
~/.cache/impers/libcurl-impersonate/{platform}-{arch}/System libcurl (no impersonate)
If step 4 fails (e.g. API rate limit), this fork tries gh:
Situation | Behaviour |
|
|
| Interactive |
no | Install/login hints + manual extract path |
brew install gh && gh auth login # recommended onceOverride: DISCOURSE_MCP_REQUIRE_IMPERSONATE=0 allows starting without impersonate (CF sites will usually fail).
CLI / profile flags (same as upstream + extras)
Flag / field | Meaning |
| Load config from file |
| Tether to one site |
| Per-site API / User API keys |
| Enable write tools |
| Browser fingerprint (also in profile) |
| Verbose HTTP |
Reading images (for vision models)
MCP tools should return images as Image Content blocks (not only a base64 string inside JSON text):
{
"content": [
{ "type": "text", "text": "{...metadata...}" },
{ "type": "image", "data": "<base64>", "mimeType": "image/jpeg" }
]
}Use discourse_read_image:
{ "post_id": 8564338, "max_images": 2 }{ "url": "upload://q9cFN6AzFPTkcn4CVcNmkuXNDTi.jpeg" }{ "url": "https://asset-cdn.example.com/.../photo.jpeg" }Typical flow: discourse_read_post → see  in raw → discourse_read_image with post_id or that upload:// URL.
See upstream docs for the rest of the tool list (search, read topic/post, create post/topic, drafts, …).
Upstream
Based on discourse/discourse-mcp (MIT).
Cloudflare / impers / gh bootstrap changes live in this fork only.
Available Tools
13 toolsdiscourse_filter_topicsFilter TopicsA
Filter topics with a concise query language. Returns JSON object with results array (id, slug, title) and meta (page, limit, has_more). Query syntax: category/categories (comma=OR, '=category'=without subcats, '-'=exclude), tag/tags (comma=OR, '+'=AND), status:(open|closed|archived|listed|unlisted|public), in:(bookmarked|watching|tracking|muted|pinned), dates: created/activity-(before|after) YYYY-MM-DD or N days, order: activity|created|latest-post|likes|views with optional -asc.
Inputs: filter (required), page, per_page.
discourse_get_chat_messagesGet Chat MessagesC
Get messages from a chat channel. Returns JSON object with channel_id, messages array (id, username, created_at, message, edited, thread_id, in_reply_to_id), and meta.
Inputs: channel_id (required), direction, page_size, target_date, +1 more.
discourse_get_draftGet DraftA
Retrieve a specific draft by key. Returns JSON with draft_key, sequence, and parsed data (title, reply, categoryId, tags, action).
Inputs: draft_key (required), sequence.
discourse_get_queryGet Data Explorer QueryA
Get full details of a Data Explorer query including SQL and parameters. Requires admin API key.
Inputs: id (required).
discourse_get_userGet UserB
Get user info. Returns JSON with id, username, name, trust_level, created_at, bio, admin, and moderator.
Inputs: username (required).
discourse_list_user_postsList User PostsA
Get paginated list of user posts/replies. Returns JSON object with posts array (id, topic_id, post_number, slug, title, created_at, excerpt, category_id) and meta (page, limit, has_more).
Inputs: username (required), page, limit.
discourse_list_usersList UsersA
List users via admin API. Requires admin API key. Returns ~100 users per page (Discourse's fixed page size). Returns JSON with users array and pagination meta.
Inputs: asc, page, order, query, +1 more.
discourse_read_imageRead ImageA
Fetch Discourse post images for the model to view. Returns MCP image content (base64 + mimeType) plus a short text summary. Pass url (https / upload:// / short path) and/or post_id to extract images from a post. Use after discourse_read_post/topic when raw contains . Does not rotate browser profiles; uses the same authenticated HTTP client as other tools.
Inputs: url, post_id, max_bytes, max_images, +1 more.
discourse_read_postRead PostA
Read a specific post. Returns JSON with id, topic_id, post_number, username, created_at, and raw content.
Inputs: post_id (required).
discourse_read_topicRead TopicB
Read topic metadata and posts. Returns JSON with id, title, slug, category_id, tags, and posts array.
Inputs: topic_id (required), post_limit, start_post_number.
discourse_run_queryRun Data Explorer QueryA
Execute a Data Explorer query with parameters. Returns columns, rows, result_count, duration_ms. Queries run in read-only transactions with 10-second timeout. Requires admin API key.
Inputs: id (required), limit, params, explain.
discourse_searchDiscourse SearchB
Search site content. Returns JSON object with results array of matching topics (id, slug, title) and meta (total, has_more).
Inputs: query (required), max_results.
discourse_select_siteSelect SiteA
Validate and select a Discourse site. Returns JSON with site URL and title.
Inputs: site (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool targets a distinct resource or operation: users, chat messages, drafts, queries, topics, posts, images, and site selection. Even search and filter_topics are clearly differentiated by keyword vs. structured query, and read_topic/read_post operate at different granularities.
Tools follow a discourse_verb_noun pattern, but use multiple verbs for retrieval (list, get, read) without a strict rule. For instance, get_chat_messages returns a collection while list_user_posts uses 'list', and read_topic/read_post use 'read' for content-heavy resources.
13 tools is well-scoped, covering users, content, search, queries, and site management without unnecessary overlap or bloat. The count aligns well with the server's apparent purpose as a comprehensive Discourse read/query interface.
The set covers read/search/query needs comprehensively, including topics, posts, images, users, chat, and Data Explorer. Minor gaps exist such as no category/tag listing tool and no write operations, but filter_topics can work around category/tag needs, making the limitations workable.
Maintenance
Related MCP Connectors
Fetch web pages and APIs past anti-bot walls, with reusable browser sessions.
Cloudflare Solver: Scraping API designed to bypass Cloudflare protection.
Search or monitor any Flarum-powered forum for discussions, replies, participants, dates, and…
Stealth scraping & search. Bypasses Cloudflare, DataDome & LinkedIn via Cyborg HITL approach.
Related MCP Servers
AlicenseAqualityCmaintenanceEnables 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.1421,085 npm80MIT- AlicenseAqualityNot gradedmaintenanceEnables AI agents to interact with Discourse forums through search, reading topics/posts, managing categories and tags, chat channels, and optionally creating content with safeguarded write operations.15MIT
- AlicenseNot gradedqualityAmaintenanceEnables programmatic interaction with the UnknownCheats forum by bypassing Cloudflare protection using a headed Chrome browser. Supports searching forums, reading threaded discussions with pagination, extracting code blocks in multiple languages, and maintaining persistent authenticated sessions.12 npm13MIT
- AlicenseBqualityCmaintenanceEnables searching and reading linux.do Discourse forum content, including topics, categories, tags, and user info, using a login cookie for trusted access.13GPL 3.0