Repository navigation
Description
Parent
What to build
The server builds public links from APP_URL. Today that covers digest and notice emails, the create_document link, and the MCP server's websiteUrl and icon (apps/hocuspocus.server/src/modules/mcp/http/serverFactory.ts). A self-host that leaves APP_URL unset sends all of them to https://docs.plus. So a self-host connector shows the docs.plus website and icon inside Claude or ChatGPT. The self-hosting docs do not say this.
Already done in cdb222d40 and 0dacee392: one trimmed APP_URL with a fallback, and appUrl in the MCP deps. The shared link helpers move to #343, their first user.
Open: criterion 1 only. PUBLIC_RESTAPI_URL for MCP is done (ENV.md §Public origin, configuration.md §Turn on the MCP connector). The link helper belongs to #343.
Benchmark
| Field | Value |
|---|---|
| Metric | (1) Lines in docs/self-hosting/configuration.md §Turn on the MCP connector that name APP_URL (exact count). (2) Connector outputs that point at the self-host when APP_URL is set: the create_document link, the server websiteUrl and the server icon (exact, of 3). |
| Before | (1) 0 on 2026-11-11 at 0b302b222, with the command below. (2) not measured yet: the builder reads it before the docs edit, on a local stack with APP_URL unset. |
| After | not measured yet |
| Condition | Local stack at the commit that closes this issue. Name the date and the commit. |
| How to run | (1) sed -n '/^## Turn on the MCP connector/,/^## Turn on Google/p' docs/self-hosting/configuration.md | grep -c APP_URL. (2) Start the local stack with APP_URL=http://localhost:3000. Read websiteUrl and icons from the MCP initialize result, and the link from one create_document reply. Repeat with APP_URL unset for the before. |
| Pass rule | (1) 1 or more. (2) 3 of 3 point at http://localhost:3000 when it is set. If (2) is below 3 of 3, stop: that is a code bug, so file it under #343 and do not close this issue on docs alone. |
| Guard | bun run format and bun run check:agent-docs pass. No code change. |
| Owner | agent in the repo writes the sentence and runs both checks; maintainer reviews |
| Claim | None. This is an internal docs fix. |
Acceptance criteria
-
docs/self-hosting/configuration.md§Turn on the MCP connector says: "SetAPP_URLto your webapp address. Emails, thecreate_documentlink, and the connector's website and icon use it. If it is unset, they point athttps://docs.plus." - The
APP_URLrow indocs/self-hosting/install.mdkeeps its ENV.md link. That ENV.md section already names MCP links. No change. - No code change.
Blocked by
None — can start now.
Agent brief
Type: AFK — docs only.
apps/hocuspocus.server/ENV.mdalready states the trim, the fallback and the link uses. It needs no change.- Prose follows
.agents/skills/tech-writer/SKILL.md§Simplified English (house standard). - Verify:
sed -n '/^## Turn on the MCP connector/,/^## Turn on Google/p' docs/self-hosting/configuration.md | grep -c APP_URLprints 1 or more. Thenbun run formatandbun run check:agent-docspass at the repo root. - Owner: an agent writes the sentence. The maintainer reviews it.
Out of scope
- The link helpers and the digest's
sectionUrl— Add links and Comment quotes to MCP reads #343. - The webapp link builder — Build stored heading and message links from the pad path, not the address bar #331.
- Landing a cold-opened
?id=link — Land a heading link on its heading, even when the heading is folded or filtered #338.
Activity
HMarzban commentedon Sep 28, 2026
Part of this issue is covered by two commits on
main. They are committed locally and go up with the next push.Done
APP_URL(cdb222d40, fix(hocuspocus): read APP_URL once, without a trailing slash).config/env.tsnow computes(env.APP_URL || 'https://docs.plus').replace(/\/+$/, '')once.config.email.appUrland the CORS fallback both use it. So a blankAPP_URL=no longer gives'', and a trailing/is removed.api/email.tsreadconfig.email.appUrlinstead ofprocess.env.APP_URL. So the digest path throughpgmqConsumer.tsgets the clean value too.apps/hocuspocus.server/ENV.mddescribes the trim and the fallback.0dacee392, feat(hocuspocus): add the create_document MCP tool).InitDepsandServerFactoryDepscarryappUrl, andsrc/index.tspassesconfig.email.appUrl.create_documentreturns<appUrl>/<slug>. No existing tool output changed.Still open in this issue
buildDocumentUrl/buildHeadingUrlhelper, and deleting the digest's privatesectionUrl. It is still indigestContentChanges.ts.docs/self-hosting/configuration.md: telling operators to setAPP_URL.docs/self-hosting/install.md:66: theAPP_URLrow still says "used in email links" only.So acceptance items 3 and 4 are met. Items 1, 2, 6 and 7 remain.
[-]Give the MCP module the app URL and one server heading-link helper[/-][+]Tell self-hosters to set APP_URL, because email and connected-app links use it[/+]HMarzban commentedon Oct 7, 2026
One more env value for this issue:
PUBLIC_RESTAPI_URLalso sets the MCPresourceURL (apps/hocuspocus.server/src/index.ts:134,src/modules/mcp/http/controller.ts:23-24). When it is unset, the URL falls back to the request origin, so a self-hoster behind a proxy must set it. Please document it inapps/hocuspocus.server/ENV.md(which today says only two conversion paths read it) and indocs/self-hosting/configuration.md.HMarzban commentedon Nov 11, 2026
Moved to v2.4.0, 2026-11-11
Maintainer ruling, 2026-11-11: this issue moves to milestone v2.4.0, beside #343. It came into v2.3.6 in a bulk move on 2026-11-09, with no reason given. It is a one-sentence docs fix, with no speed effect.
Body changes, checked at
0b302b222:install.mdrow already links to ENV.md §Email, and ENV.md names MCP links. So criterion 2 needs no change.PUBLIC_RESTAPI_URLask from 2026-10-07 is done: ENV.md §Public origin and configuration.md §Turn on the MCP connector.serverFactory.ts)..agents/skills/tech-writer/SKILL.md.APP_URL0 times.