@discourse/create-site 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/README.md +2 -1
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +4 -1
- package/dist/mcp.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -56,11 +56,11 @@ discourse-create-site create \
|
|
|
56
56
|
- Otherwise exit `0` returns:
|
|
57
57
|
- `redirect_url`: One-time admin sign-in invite link (share ONLY this URL with the user)
|
|
58
58
|
- `user_handoff`: Reminder to share only `redirect_url`
|
|
59
|
-
- `mcp_setup`: Machine-readable MCP setup guidance (`admin_mcp_url`, `site_setting`, `transport`, `mcp_endpoint`, `oauth_metadata_url`, `user_prompt_suggestion`, `agent_instructions`, `detected_client`, `steps`, `client_instructions`)
|
|
59
|
+
- `mcp_setup`: Machine-readable MCP setup guidance (`admin_mcp_url`, `site_setting`, `transport`, `mcp_endpoint`, `oauth_metadata_url`, `user_prompt_suggestion`, `agent_instructions`, `post_setup_note`, `detected_client`, `steps`, `client_instructions`)
|
|
60
60
|
|
|
61
61
|
### 4. Post-provisioning handoff
|
|
62
62
|
Share cleanly with the user in this order:
|
|
63
63
|
1. **Share ONLY `redirect_url`** as a clickable link to open the new site (do not also share the bare `https://<subdomain>.discourse.group` URL, because the user must open `redirect_url` directly to claim and sign in to their admin account).
|
|
64
64
|
2. Next, tell the user that once admin sign-in is complete, they should enable MCP (`mcp_server_enabled`) at a clickable link to `mcp_setup.admin_mcp_url` (`<site_origin>/admin/config/mcp/settings`).
|
|
65
65
|
3. **Do NOT tell the user to run a separate CLI command outside the session.** Instead, tell them to reply `"now add mcp support"` once MCP is enabled.
|
|
66
|
-
4. When the user replies `"now add mcp support"`, follow `mcp_setup.agent_instructions` (using `mcp_setup.client_instructions` as reference if applicable) to add MCP for `mcp_setup.mcp_endpoint` directly.
|
|
66
|
+
4. When the user replies `"now add mcp support"`, follow `mcp_setup.agent_instructions` (using `mcp_setup.client_instructions` as reference if applicable) to add MCP for `mcp_setup.mcp_endpoint` directly. After MCP setup is confirmed, include `mcp_setup.post_setup_note`: "Restart your coding agents after the setup. Most agents read their skills directory and MCP configuration at startup."
|
package/README.md
CHANGED
|
@@ -91,8 +91,9 @@ Newly provisioned sites do not enable Discourse's built-in MCP server by default
|
|
|
91
91
|
|
|
92
92
|
1. Visit `<site_origin>/admin/config/mcp/settings` and enable MCP (`mcp_server_enabled`).
|
|
93
93
|
2. Reply `"now add mcp support"` inside your AI agent session so the agent configures `<site_origin>/mcp` (Streamable HTTP, OAuth discovery at `<site_origin>/.well-known/oauth-protected-resource/mcp`) for you without needing to run an external CLI command.
|
|
94
|
+
3. After MCP setup is confirmed: Restart your coding agents after the setup. Most agents read their skills directory and MCP configuration at startup.
|
|
94
95
|
|
|
95
|
-
`mcp_setup` in `--json` output includes `admin_mcp_url`, `user_prompt_suggestion` (`"now add mcp support"`), `agent_instructions`, and `client_instructions` as a reference for the detected agent client (or generic Streamable HTTP configuration).
|
|
96
|
+
`mcp_setup` in `--json` output includes `admin_mcp_url`, `user_prompt_suggestion` (`"now add mcp support"`), `agent_instructions`, `post_setup_note`, and `client_instructions` as a reference for the detected agent client (or generic Streamable HTTP configuration).
|
|
96
97
|
|
|
97
98
|
## Development
|
|
98
99
|
|
package/dist/mcp.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface McpClientInstruction {
|
|
|
9
9
|
command?: string;
|
|
10
10
|
config_snippet?: Record<string, unknown>;
|
|
11
11
|
}
|
|
12
|
+
export declare const POST_MCP_SETUP_NOTE = "Restart your coding agents after the setup. Most agents read their skills directory and MCP configuration at startup.";
|
|
12
13
|
export interface McpSetupInfo {
|
|
13
14
|
enabled_by_default: false;
|
|
14
15
|
admin_mcp_url: string;
|
|
@@ -18,6 +19,7 @@ export interface McpSetupInfo {
|
|
|
18
19
|
oauth_metadata_url: string;
|
|
19
20
|
user_prompt_suggestion: "now add mcp support";
|
|
20
21
|
agent_instructions: string;
|
|
22
|
+
post_setup_note: string;
|
|
21
23
|
detected_client: DetectedAgent;
|
|
22
24
|
steps: string[];
|
|
23
25
|
client_instructions: McpClientInstruction;
|
package/dist/mcp.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export const POST_MCP_SETUP_NOTE = "Restart your coding agents after the setup. Most agents read their skills directory and MCP configuration at startup.";
|
|
1
2
|
function hasNonEmptyEnv(env, ...keys) {
|
|
2
3
|
return keys.some((key) => Boolean(env[key]?.trim()));
|
|
3
4
|
}
|
|
@@ -106,7 +107,8 @@ export function buildMcpSetup(siteUrl, subdomain, env = process.env) {
|
|
|
106
107
|
mcp_endpoint: mcpEndpoint,
|
|
107
108
|
oauth_metadata_url: oauthMetadataUrl,
|
|
108
109
|
user_prompt_suggestion: userPromptSuggestion,
|
|
109
|
-
agent_instructions: `Do NOT tell the user to run a separate command outside this session. Tell the user to enable MCP (\`mcp_server_enabled\`) at ${adminMcpUrl} after admin sign-in, then reply "${userPromptSuggestion}". When the user replies, add/configure the remote Streamable HTTP MCP server "${subdomain}" for ${mcpEndpoint} (OAuth discovery: ${oauthMetadataUrl}) directly in this environment
|
|
110
|
+
agent_instructions: `Do NOT tell the user to run a separate command outside this session. Tell the user to enable MCP (\`mcp_server_enabled\`) at ${adminMcpUrl} after admin sign-in, then reply "${userPromptSuggestion}". When the user replies, add/configure the remote Streamable HTTP MCP server "${subdomain}" for ${mcpEndpoint} (OAuth discovery: ${oauthMetadataUrl}) directly in this environment. Once MCP setup is confirmed, include this note: "${POST_MCP_SETUP_NOTE}"`,
|
|
111
|
+
post_setup_note: POST_MCP_SETUP_NOTE,
|
|
110
112
|
detected_client: detectedClient,
|
|
111
113
|
steps: [
|
|
112
114
|
"Open the admin sign-in link directly to claim and finish setting up your admin account.",
|
|
@@ -124,6 +126,7 @@ export function formatMcpGuidance(setup) {
|
|
|
124
126
|
` ${setup.admin_mcp_url}`,
|
|
125
127
|
` 3. Once enabled, tell your AI agent: "${setup.user_prompt_suggestion}"`,
|
|
126
128
|
` MCP endpoint (Streamable HTTP): ${setup.mcp_endpoint}`,
|
|
129
|
+
` Note: ${setup.post_setup_note}`,
|
|
127
130
|
].join("\n");
|
|
128
131
|
}
|
|
129
132
|
//# sourceMappingURL=mcp.js.map
|
package/dist/mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,mBAAmB,GAC9B,uHAAuH,CAAC;AAiB1H,SAAS,cAAc,CAAC,GAAsB,EAAE,GAAG,IAAc;IAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACpE,IAAI,cAAc,CAAC,GAAG,EAAE,YAAY,EAAE,wBAAwB,CAAC,EAAE,CAAC;QAChE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IACpD,CAAC;IACD,IACE,cAAc,CACZ,GAAG,EACH,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,sBAAsB,CACvB,EACD,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,cAAc,CAAC,GAAG,EAAE,YAAY,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAClD,CAAC;IACD,IAAI,cAAc,CAAC,GAAG,EAAE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