Goldnat Plugins
← Back to Discourse

Discourse AI Connect — Installation & Setup Guide

Install and configure the Sinatra bridge + Discourse plugin (Servio Protocol) for your Discourse community. 5 free tools + 6 Pro. Moderator Pro sold separately.

📅 Updated: 2026-07-07 🎬 Video: discourse-install-connect

Overview

Goldnat AI Connect for Discourse consists of 2 components:

  1. Sinatra bridge (Ruby) — a separate OAuth + Manifest service
  2. Discourse plugin (Ruby on Rails) — installed inside the Discourse container

This structure is required because Discourse core doesn’t expose “middleware”-style plugins — the bridge needs to be standalone.

What you get:

  • 5 free toolssearchTopics, getTopic, getLatestTopics, getPost, getCategories
  • Pro upgradegetUserProfile, createTopic, replyToTopic, editPost, sendMessage, likePost
  • Separate Pro extension: discourse-moderator-ai-connect (Moderation + Groups + Admin)

Note: This guide assumes Discourse is already installed and running. The plugin is configured by your site administrator.

Prerequisites

  • Discourse 3.1+ (installed via Docker)
  • Ruby 3.1+ (ships with Discourse)
  • PostgreSQL 13+
  • Redis 6+
  • Bridge server — Ruby 3.2+ + Sinatra
  • HTTPS required
  • Site admin

Installation

Step 1: Install the plugin in Discourse

Edit containers/app.yml:

Download the plugin package from your personal area at goldnat.ai and host it where your Discourse server can reach it (your own Git server or an internal URL), then reference that location:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone <your-hosted-discourse-ai-connect-url>

Run:

cd /var/discourse
./launcher rebuild app

Step 2: Run the Sinatra bridge

Download the bridge package from your personal area at goldnat.ai (sign in → your plugins → download the latest version), then extract and set it up:

cd /var/www/
# Extract the package you downloaded from goldnat.ai into ./discourse-ai-connect
cd discourse-ai-connect/sinatra_service
bundle install
cp .env.example .env

Edit .env:

DISCOURSE_URL=https://forum.example.com
DISCOURSE_API_KEY=YOUR_ADMIN_API_KEY
DB_HOST=localhost
DB_NAME=discourse_aiconnect
PORT=3086

Run under systemd or PM2:

bundle exec ruby app.rb

Step 3: Reverse Proxy

ProxyPass /api/ai-connect http://localhost:3086/api/ai-connect
ProxyPassReverse /api/ai-connect http://localhost:3086/api/ai-connect

Connecting to an AI Agent

  1. https://forum.example.com/my-tokens — the bridge’s token management page.
  2. Generate Prompt → paste into your agent.
  3. OAuth PKCE runs → approve.

First Test

  • “Search topics about deployment” → discourse.searchTopics with q=deployment
  • “What categories does this community have?” → discourse.getCategories
  • “What does the first topic say?” → discourse.getTopic + discourse.getPost

With Pro:

  • “Create a new topic in ‘Q&A’” → discourse.createTopic
  • “Like this post” → discourse.likePost

Reconnecting

Tokens valid for 30 days. Refresh:

  1. My Tokens → Revoke the old.
  2. Generate Prompt again.

Token Management

/my-tokens page on the bridge. Filters + revoke as with the other plugins.

Uninstalling

1. Revoke all tokens

  • My Tokens → Revoke All — kills every active session.

2. Stop the Sinatra bridge

systemctl stop discourse-aiconnect-bridge
systemctl disable discourse-aiconnect-bridge

Or, if running under PM2: pm2 stop discourse-ai-connect && pm2 delete discourse-ai-connect.

3. Remove the reverse-proxy rules

  • Delete the ProxyPass /api/ai-connect ... lines from your Apache/Nginx vhost.
  • Reload the web server.

4. Remove the Discourse plugin

Edit containers/app.yml — remove the git clone <your-hosted-discourse-ai-connect-url> line you added for the plugin.

cd /var/discourse
./launcher rebuild app

5. Remove the bridge code

rm -rf /var/www/discourse-ai-connect

6. Drop the DB (fresh reinstall only)

DROP DATABASE discourse_aiconnect;

Warning: Deletes all token history.

Common Troubleshooting

ErrorCauseFix
Bridge 502Sinatra not runningsystemctl status discourse-aiconnect-bridge
Plugin not loadedRebuild failed./launcher logs app — check for errors
OAuth PKCE failedMissing Discourse API KeyVerify DISCOURSE_API_KEY in .env
Topic not accessibleCategory restrictedThe token-generating user must be able to see the category

Support

Need help? Contact us and we’ll get back to you.

Video Tutorial (Coming Soon)

Segments: (A) Goldnat AI Connect on the Servio Protocol, (B) installing the plugin in the Discourse container + rebuild, (C) running the Sinatra bridge, (D) connecting to an AI agent + typical queries.

Screenshots

Adding the plugin to app.yml
Edit containers/app.yml
launcher rebuild
Run ./launcher rebuild app
Token management page
Generate prompt for AI agent connection

🎬 Video Tutorial — Coming Soon

A 3-5 minute video covering: intro → install → connect → demo.

Tag: discourse-install-connect

Status: Awaiting production

Pro

Discourse AI Connect Pro — Moderator Tools

New here? Start with the basic setup guide above.

What Pro adds

The free Discourse bridge gives AI agents read-only access (browse topics, posts, categories, search). Pro adds the write tools, so an agent can create topics, reply, edit content, send private messages and like posts.

Pro ships as a separate package (discourse-moderator-ai-connect) that installs alongside the free bridge. The core Sinatra service holds the tool infrastructure; the Pro package holds the Pro tools and registers them into the same manifest — they never appear unless the edition is Pro.

Pro tools

ToolScopeWhat it does
createTopicwriteCreate a new topic in a category
replyToTopicwritePost a reply to an existing topic
editPostwriteEdit an existing post
sendMessagewriteSend a private message to a user
likePostwriteLike or unlike a post

Enabling Pro

  1. Install the free Discourse bridge first (see the basic guide above).
  2. Install the discourse-moderator-ai-connect package alongside it.
  3. Set the edition to Pro: AICONNECT_EDITION=pro in the Sinatra service’s environment, then restart it.
  4. Regenerate your connection prompt — the five Pro tools now appear in the manifest.

Scope note

All Pro tools require the write scope. Every action runs as the token owner, so it is limited to what that user may do in Discourse — the scope is the ceiling, the user’s trust level and permissions are the floor.

This guide is informational and non-binding. Steps and behavior can vary between platforms and plugin versions. For the binding terms, see the Terms & Conditions.

Tools

Available tool calls.

29 tools exposed via the Servio protocol. Pro tools are marked.

discourse

  • discourse.createTopic Creates a new topic in the Discourse forum. Pro
  • discourse.editPost Edits an existing post in Discourse. Pro
  • discourse.getCategories Returns the list of categories in the forum.
  • discourse.getCategory Get full details of a category by ID or slug: name, description, colour, icon, parent category, sub-categories, per-group permissions, default settings and permitted tags.
  • discourse.getLatestTopics Returns the latest topics published in the forum.
  • discourse.getPost Returns a single post by ID.
  • discourse.getPostRevisionContent Get the full content of a specific revision of a post, including the original Markdown and what changed.
  • discourse.getPostRevisions List the edit history of a post: who edited it, when, and the diff of each change.
  • discourse.getTag Get full details of a tag: name, description, colour, icon, topic count, tag group, synonyms, the categories it is allowed in, and who may use it.
  • discourse.getTopic Returns a single topic including its posts.
  • discourse.getTopicPostsRange Get a specific range of posts within a topic (for example posts 10 to 20). Useful for paging through long threads.
  • discourse.getTopicSummary Get an AI summary of a long topic, including key points and main participants. Requires AI summarisation to be enabled on the forum.
  • discourse.getTopTopics Get the top topics for a period — daily, weekly, monthly, yearly or all time — using the forum's popularity settings.
  • discourse.getUserProfile Returns a user profile (name, details, statistics). Pro
  • discourse.likePost Adds a like to a post. Pro
  • discourse.listCategories List every category with its metadata: name, description, colour, icon, parent, topic count, view and post permissions, and default settings.
  • discourse.listTags List every tag with its name, topic count, colour, icon, description and tag group.
  • discourse.listTopicsByCategory List topics in a category, with sorting (latest, top, unanswered) and filtering by tag, status or date.
  • discourse.listTopicsByTag List topics carrying a given tag, with sorting and filtering by category, date or status.
  • discourse.replyToTopic Replies to an existing topic in the forum. Pro
  • discourse.searchByAuthor Find everything a member has written — topics they opened, posts and replies — filtered by date, category or tag. Useful for tracing a contributor's history.
  • discourse.searchByTag Search content by one tag or a combination of tags, with further filtering by date, category or author.
  • discourse.searchCategories Find categories by name, description or tag. Returns the category hierarchy, access permissions and topic counts.
  • discourse.searchInCategory Search within one category and its sub-categories. Supports the same filters and sorting as a general search, but scoped for accuracy.
  • discourse.searchPosts Search the BODY of XenForo posts, ranked by relevance. Supports XenForo search syntax: "an exact phrase" in quotes, +required, -excluded. Multiple words must all appear in the same post, in any order. Returns results plus total, page and has_more — use page to walk through them. To search thread titles instead, use searchThreads. Date options: (1) since=Xw for open range from X ago until now; (2) date_from+date_to for exact window (e.g. date_from=2026-03-09&date_to=2026-03-15); (3) since+until for relative window (e.g. since=3w&until=2w = the week 3 weeks ago). All params optional.
  • discourse.searchTags Search tags by keyword, filtered by tag group, category, minimum topic count and status.
  • discourse.searchTopics Searches topics by keywords.
  • discourse.searchUsers Search user accounts by name or email
  • discourse.sendMessage Sends a private message to a user in the forum. Pro