MCP server exposing Discourse forum features for AI agents to read, search, and optionally write posts and manage users.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
💡 Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Discourse MCP.
discourse_select_siteValidate and select a Discourse site. Returns JSON with site URL and title.
discourse_searchSearch site content. Returns JSON object with results array of matching topics (id, slug, title) and meta (total, has_more).
discourse_filter_topicsDiscover topics through a filtered, top, or hot view. Filtered uses Discourse TopicsFilter syntax; top uses Discourse's authoritative top score and defaults to weekly; hot is defined exactly as daily top (not sentiment, controversy, or real-time velocity). Returns a uniform rich topic projection and truthful pagination metadata.
discourse_read_topicRead topic metadata and posts. Large post limits can require multiple upstream requests. For moderation queues, prefer reviewable list/detail evidence instead of fanning this tool out across flagged topics.
discourse_read_postRead a specific post. Returns JSON with id, topic_id, post_number, username, created_at, and raw content.
discourse_read_topic_postsRead exact, earliest, latest, around-post, or username-filtered topic evidence. Selection is bounded to 50 posts and reports the visible stream size without claiming the entire topic was loaded.
A Model Context Protocol (MCP) stdio server that exposes Discourse forum capabilities as tools and resources for AI agents.
src/index.ts → compiled to dist/index.js (binary name: discourse-mcp)@modelcontextprotocol/sdk--allow_writes is sufficient and deprecates read_only=false; 0.3.0 added operator-selectable toolsets, structured directory output, and expanded opt-in administration capabilities; 0.2.x introduced breaking changes from 0.1.x, including JSON-only tool output; category/group resources remain deprecated compatibility surfaces alongside canonical list tools)Then, in your MCP client, either:
Call the discourse_select_site tool with { "site": "https://try.discourse.org" } to choose a site, or
Start the server tethered to a site using --site https://try.discourse.org (in which case discourse_select_site is hidden).
Enable writes (opt‑in, safe‑guarded)
This exposes discourse_select_site plus the read-only Data Explorer tools. Add --site, authentication, and the write flags as needed; see Built-in toolsets.
Alternative: if you prefer a global binary after install, the package exposes
discourse-mcp.
The server registers tools under the MCP server name @discourse/mcp. Choose a target Discourse site either by:
Using the discourse_select_site tool at runtime (validates via /about.json), or
Supplying --site <url> to tether the server to a single site at startup (validates via /about.json and hides discourse_select_site).
Auth
--auth_pairs '[{"site":"https://example.com","api_key":"...","api_username":"system"}]'--auth_pairs '[{"site":"https://example.com","user_api_key":"...","user_api_client_id":"..."}]'http_basic_user and http_basic_pass to any auth_pairs entry. This is useful for Discourse sites protected by HTTP Basic Authentication at the reverse proxy level.auth_pairs; the matching entry is used for the selected site. If both user_api_key and api_key are provided for the same site, user_api_key takes precedence.Write safety
--allow_writes is enabled. This includes post, topic, private-message, category, user, upload, draft, and saved Data Explorer query mutations.auth_pairs entry for the selected site; otherwise they return an error.Flags & defaults
--help, -h, or positional help: print current CLI help and exit successfully before loading profiles or starting a transport.
--version, -v, or positional version: print one package-version line and exit successfully. -v means version; logging verbosity uses --log_level.
--allow_writes (default: false): enable mutation tools. This single explicit opt-in is sufficient.
--read_only <boolean>: deprecated compatibility setting. true is an explicit read-only override and conflicts with --allow_writes; false has no effect and should be removed from commands and profiles.
--timeout_ms <number> (default: 15000)
--concurrency <number> (default: 4)
--log_level <silent|error|info|debug> (default: info)
debug: Shows HTTP request URLs, statuses, and detailed network/retry information (response bodies are never logged because admin APIs may echo sensitive content)info: Shows retry attempts and general operational messageserror: Shows only errorssilent: No logging output--show_emails (default: false). includes emails in user tools. Requires admin access
--tools_mode <auto|discourse_api_only|tool_exec_api> (default: auto)
--toolsets <name[,name...]>: Expose selected built-in domains. Omit for the compact default catalog (all non-opt-in domains); use --toolsets all to include opt-in category/group/tag-group, moderation, workflow, and AI administration domains. See Built-in toolsets.
--site <url>: Tether MCP to a single site and hide discourse_select_site.
--default-search <prefix>: Unconditionally prefix every search query (e.g., tag:ai order:latest).
--max-read-length <number>: Maximum characters returned for post content (default 50000). Applies to discourse_read_post and per-post content in discourse_read_topic and discourse_read_private_message. The tools prefer raw content by requesting include_raw=true.
--allowed_upload_paths <paths>: Comma-separated list or JSON array of directories allowed for local file uploads. Required to enable local file uploads in discourse_upload_file. Example: --allowed_upload_paths "/home/user/images,/tmp/uploads" or --allowed_upload_paths '["/home/user/images"]'. These security-sensitive paths do not receive ~ expansion.
--transport <stdio|http> (default: stdio): Use standard input/output by default, or loopback-only Streamable HTTP with JSON responses. HTTP explicitly supports one stateful MCP client/session per process. Every post-initialize request must carry the returned Mcp-Session-Id; a second initialize is rejected. After session DELETE/close, restart the process before connecting another client. /health returns 503 restart_required in that closed state. Request bodies are bounded to 4 MiB.
--port <number> (default: 3000): Port to listen on when using HTTP transport.
--cache_dir <path> (reserved)
--profile <path.json> (see below)
Profile file (keep secrets off the command line)
Run with:
Flags still override values from the profile. A leading current-user ~, ~/, or ~\ in the profile path expands to the current home directory; ~otheruser, shell-style expansion elsewhere, and upload-allowlist expansion are intentionally unsupported.
Toolsets let an operator expose only the built-in domains needed by an MCP client. They are optional: when --toolsets and the profile field are both omitted, the server registers the default catalog (including search, discourse_search, and discourse_filter_topics). Administrative and specialized domains marked (opt-in) below—including themes—must be selected explicitly. Use --toolsets all only when every built-in domain is deliberately required.
Pass one name or a comma-separated union:
Profiles use an array (a comma-separated string is also accepted):
Available toolsets are:
Factual signals from GitHub, npm, and our automated checks — not a rating.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/discourse-discourse-mcp)<a href="https://allmcps.com/mcp/discourse-discourse-mcp"><img src="https://allmcps.com/api/badge/discourse-discourse-mcp?style=directory" alt="Discourse MCP on AllMCPs" /></a>