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.

11 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.getLatestTopics Returns the latest topics published in the forum.
  • discourse.getPost Returns a single post by ID.
  • discourse.getTopic Returns a single topic including its posts.
  • discourse.getUserProfile Returns a user profile (name, details, statistics). Pro
  • discourse.likePost Adds a like to a post. Pro
  • discourse.replyToTopic Replies to an existing topic in the forum. Pro
  • discourse.searchTopics Searches topics by keywords.
  • discourse.sendMessage Sends a private message to a user in the forum. Pro