
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@discourse/mcp
Advanced tools
A Model Context Protocol (MCP) stdio server that exposes Discourse forum capabilities as tools for AI agents.
src/index.ts → compiled to dist/index.js (binary name: discourse-mcp)@modelcontextprotocol/sdknpx -y @discourse/mcp@latest
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)
npx -y @discourse/mcp@latest --allow_writes --read_only=false --auth_pairs '[{"site":"https://try.discourse.org","api_key":"'$DISCOURSE_API_KEY'","api_username":"system"}]'
{
"mcpServers": {
"discourse": {
"command": "npx",
"args": ["-y", "@discourse/mcp@latest"],
"env": {}
}
}
}
Alternative: if you prefer a global binary after install, the package exposes
discourse-mcp.{ "mcpServers": { "discourse": { "command": "discourse-mcp", "args": [] } } }
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"}]': Per‑site API key overrides. You can include multiple entries; the matching entry is used for the selected site.Write safety
discourse_create_post, discourse_create_topic, discourse_create_category, and discourse_create_user are only registered when all are true:
--allow_writes AND not --read_only AND some auth is configured (either default flags or a matching auth_pairs entry).Flags & defaults
--read_only (default: true)--allow_writes (default: false)--timeout_ms <number> (default: 15000)--concurrency <number> (default: 4)--log_level <silent|error|info|debug> (default: info)--tools_mode <auto|discourse_api_only|tool_exec_api> (default: auto)--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-post).--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. The tools prefer raw content by requesting include_raw=true.--cache_dir <path> (reserved)--profile <path.json> (see below)Profile file (keep secrets off the command line)
{
"auth_pairs": [
{ "site": "https://try.discourse.org", "api_key": "<redacted>", "api_username": "system" }
],
"read_only": false,
"allow_writes": true,
"log_level": "info",
"tools_mode": "auto",
"site": "https://try.discourse.org"
,
"default_search": "tag:ai order:latest-post"
,
"max_read_length": 50000
}
Run with:
node dist/index.js --profile /absolute/path/to/profile.json
Flags still override values from the profile.
Remote Tool Execution API (optional)
tools_mode=auto (default) or tool_exec_api, the server discovers remote tools via GET /ai/tools after you select a site (or immediately at startup if --site is provided) and registers them dynamically. Set --tools_mode=discourse_api_only to disable remote tool discovery.Networking & resilience
Privacy
Built‑in tools (always present unless noted):
discourse_search
{ query: string; with_private?: boolean; max_results?: number (1–50, default 10) }{ "results": [{ "id": 123, "url": "https://…", "title": "…" }] }
discourse_read_topic
{ topic_id: number; post_limit?: number (1–20, default 5) }discourse_read_post
{ post_id: number }discourse_list_categories
{}discourse_list_tags
{}discourse_get_user
{ username: string }discourse_filter_topics
{ filter: string; page?: number (default 1); per_page?: number (1–50) }=category = without subcats, - prefix = exclude); tag/tags (comma = OR, + = AND) and tag_group; status:(open|closed|archived|listed|unlisted|public); personal in: (bookmarked|watching|tracking|muted|pinned); dates: created/activity/latest-post-(before|after) with YYYY-MM-DD or relative days N; numeric: likes[-op]-(min|max), posts-(min|max), posters-(min|max), views-(min|max); order: activity|created|latest-post|likes|likes-op|posters|title|views|category with optional -asc; free text terms are matched.discourse_create_post (only when writes enabled; see Write safety)
{ topic_id: number; raw: string (≤ 30k chars) }discourse_create_topic (only when writes enabled; see Write safety)
{ title: string; raw: string (≤ 30k chars); category_id?: number; tags?: string[] }discourse_create_user (only when writes enabled; see Write safety)
Input: { username: string (1-20 chars); email: string; name: string; password: string; active?: boolean; approved?: boolean }
discourse_create_category (only when writes enabled; see Write safety)
Input: { name: string; color?: hex; text_color?: hex; parent_category_id?: number; description?: string }
Notes:
Requirements: Node >= 18, pnpm.
Install / Build / Typecheck / Test
pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm build && pnpm dev
Project layout
src/index.tssrc/http/client.tssrc/tools/registry.tssrc/tools/builtin/*src/tools/remote/tool_exec_api.tssrc/util/logger.ts, src/util/redact.tsTesting notes
dist/test/**/*.js). Ensure pnpm build before pnpm test if invoking scripts individually.Publishing (optional)
@discourse/mcp and exposes a bin named discourse-mcp. Prefer npx @discourse/mcp@latest for frictionless usage.Conventions
See AGENTS.md for additional guidance on using this server from agent frameworks.
try.discourse.org:npx -y @discourse/mcp@latest --log_level debug
# In client: call discourse_select_site with {"site":"https://try.discourse.org"}
npx -y @discourse/mcp@latest --site https://try.discourse.org
npx -y @discourse/mcp@latest --allow_writes --read_only=false --auth_pairs '[{"site":"https://try.discourse.org","api_key":"'$DISCOURSE_API_KEY'","api_username":"system"}]'
npx -y @discourse/mcp@latest --allow_writes --read_only=false --auth_pairs '[{"site":"https://try.discourse.org","api_key":"'$DISCOURSE_API_KEY'","api_username":"system"}]'
# In your MCP client, call discourse_create_category with for example:
# { "name": "AI Research", "color": "0088CC", "text_color": "FFFFFF", "description": "Discussions about AI research" }
npx -y @discourse/mcp@latest --allow_writes --read_only=false --auth_pairs '[{"site":"https://try.discourse.org","api_key":"'$DISCOURSE_API_KEY'","api_username":"system"}]'
# In your MCP client, call discourse_create_topic, for example:
# { "title": "Agentic workflows", "raw": "Let’s discuss agent workflows.", "category_id": 1, "tags": ["ai","agents"] }
create_post missing? You’re in read‑only mode. Enable writes as described above.--tools_mode=discourse_api_only.discourse_select_site? Yes, start with --site <url> to tether to a single site.--timeout_ms, and note built‑in retry/backoff on 429/5xx.FAQs
Discourse MCP CLI server (stdio) exposing Discourse tools via MCP
We found that @discourse/mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.

Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.

Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.