You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add opt-in domains for managing AI agents, scripted custom tools, and AI feature settings with admin and write safeguards. Include compact discovery views, import/export support, custom-tool authoring guidance, and conditional resource registration.
Prevent sensitive HTTP response bodies from reaching logs and handle empty 204 responses from delete operations.
- `debug`: Shows all HTTP requests, responses, and detailed error information
91
+
- `debug`: Shows HTTP request URLs, statuses, and detailed network/retry information (response bodies are never logged because admin APIs may echo sensitive content)
92
92
- `info`: Shows retry attempts and general operational messages
93
93
- `error`: Shows only errors
94
94
- `silent`: No logging output
95
95
- `--show_emails` (default: false). includes emails in user tools. Requires admin access
- `--toolsets <name[,name...]>`: Expose selected built-in domains. Omit for the default catalog (all non-opt-in domains); use `--toolsets all` to include opt-in domains such as `workflows`. See [Built-in toolsets](#built-in-toolsets).
97
+
- `--toolsets <name[,name...]>`: Expose selected built-in domains. Omit for the default catalog (all non-opt-in domains); use `--toolsets all` to include opt-in workflows and AI administration domains. See [Built-in toolsets](#built-in-toolsets).
98
98
- `--site <url>`: Tether MCP to a single site and hide `discourse_select_site`.
- `--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`.
@@ -151,7 +151,7 @@ Flags still override values from the profile.
151
151
152
152
### Built-in toolsets
153
153
154
-
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 (all non-opt-in domains). The experimental admin-only `workflows` domain is opt-in. Use `--toolsets all` to explicitly load every domain.
154
+
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 (all non-opt-in domains). The admin-only `workflows`, `ai_agents`, `ai_custom_tools`, and `ai_features` domains are opt-in. Use `--toolsets all` to explicitly load every domain.
155
155
156
156
Pass one name or a comma-separated union:
157
157
@@ -201,6 +201,9 @@ Available toolsets are:
201
201
|`uploads`| File upload |
202
202
|`data_explorer`| Query retrieval, execution, creation, update, and deletion |
203
203
|`workflows`*(opt-in)*| Admin-only workflow discovery, graph authoring, expression evaluation, pin-data, draft runs, step runs, executions, and version management |
204
+
|`ai_agents`*(opt-in)*| Admin-only AI agent discovery, typed lifecycle, bot-user creation, and portable import/export |
205
+
|`ai_custom_tools`*(opt-in)*| Admin-only database-backed scripted custom-tool guide, lifecycle, actual execution testing, and import/export |
206
+
|`ai_features`*(opt-in)*| Admin-only AI feature discovery and exact-area, non-secret feature-setting updates; also includes agent discovery |
204
207
|`all`*(sentinel)*| Expands to every built-in toolset, including opt-in domains; absorbs other selections |
205
208
206
209
Toolset membership is intentionally separate from safety and authorization:
@@ -227,6 +230,32 @@ The `workflows` toolset targets the experimental `discourse-workflows` plugin (`
227
230
228
231
Flat connections such as `[{"from":"Start","to":"Check","type":"main"}]` are accepted and converted to Discourse's nested wire format. Use the source node's catalog output key: condition/filter ports are `true` and `false`, not always `main`. MCP rejects one-sided graph updates before HTTP. Runs are not dry-runs and can create posts, send chat messages, or call external HTTP.
229
232
233
+
#### Discourse AI administration
234
+
235
+
The three AI administration domains require a Discourse admin API key (or an admin user API key accepted by the selected endpoint). They are independently opt-in and default-off. Mutations—and custom-tool test execution—also require both `--allow_writes` and `--read_only=false`.
236
+
237
+
```bash
238
+
# Configure agents without exposing scripted source management
The agent index is intentionally concise by default: `discourse_ai_list_agents` omits system prompts and per-agent configuration, returning summary counts plus slim tool/model catalogs. Use `discourse_ai_get_agent` with an ID to inspect one full configuration. `view: "full"` is available only for clients that explicitly need the complete upstream index.
252
+
253
+
`discourse_ai_list_custom_tools` follows the same pattern: it returns compact records and preset signatures without scripts, bindings, or verbose parameter documentation. Use `discourse_ai_get_custom_tool` for one stored tool, or call the guide with `topic: "presets"` and a `preset_id` for one complete preset example.
254
+
255
+
`ai_custom_tools` manages Discourse's database-backed `AiTool` records. It is separate from remote tools dynamically discovered at `/ai/tools`, which remain controlled by `--tools_mode`. Script authoring is synchronous MiniRacer JavaScript: define `invoke(parameters)`; do not use `async`, browser APIs, or Node modules. Call `discourse_ai_get_custom_tool_guide` with only the focused `topic` you need. `preset_id` is optional and meaningful only for `topic: "presets"`; it is ignored for other topics. Use `topic: "preamble"` for the exact selected-server contract before creating or substantially changing a script. The same exact live preamble and minimal template is exposed as the conditional `discourse://ai/custom-tools/authoring-guide` resource when this toolset is selected. Resources are application-driven; the guide tool is model-controlled, so autonomous clients should use the tool rather than assume a host attached the resource. A future optional authoring prompt would be user-controlled and would guide an explicitly initiated workflow rather than replace model-callable discovery.
256
+
257
+
**Safety:**`discourse_ai_test_custom_tool` actually executes code and can issue external requests or cause site side effects. Feature updates alter production behavior immediately and are limited to non-secret settings returned from one exact `ai-features/<module>` area. Custom-tool source, prompts, bindings, exports, and test parameters should be treated as sensitive. Use the narrowest toolset combination and test on a non-production site first.
258
+
230
259
-**Remote Tool Execution API (optional)**
231
260
232
261
- With `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.
@@ -278,6 +307,12 @@ Resources provide static/semi-static read-only data via URI addressing. Use thes
- Applications may attach this resource; models can retrieve the same content with `discourse_ai_get_custom_tool_guide` and `topic: "preamble"`
315
+
281
316
## Tools
282
317
283
318
Built‑in tools (always present unless noted). All tools return **strict JSON** (no Markdown).
@@ -540,7 +575,7 @@ You can also manually create User API Keys via the Discourse UI (if enabled by t
540
575
-**Should I use Admin API Keys or User API Keys?** Use User API Keys for personal use (no admin required). Use Admin API Keys only when you need admin-level operations or are setting up a system-wide integration.
541
576
-**Getting "fetch failed" errors?** Run with `--log_level debug` to see detailed error information including:
542
577
- The exact URL being requested
543
-
- HTTP status codes and response bodies
578
+
- HTTP status codes (response bodies are deliberately not logged because they may contain sensitive content)
toolsets: BuiltinToolsetsSchema.optional().describe("Built-in tool domains to expose (array or comma-separated string). Omit for the default catalog; use all to include opt-in domains such as workflows."),
105
+
toolsets: BuiltinToolsetsSchema.optional().describe("Built-in tool domains to expose (array or comma-separated string). Omit for the default catalog; use all to include opt-in workflows and AI administration domains."),
106
106
site: z.string().url().optional().describe("Tether MCP to a single Discourse site; hides select_site and preselects this site"),
107
107
default_search: z.string().optional().describe("Optional search prefix added to every search query (set via --default-search)"),
0 commit comments