progmaweb
The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.
Clonegit clone https://git.progmasoft.com/progmaweb
Serve the Agenceland MCP Marketplace on agencelandmcp.progmasoft.com
- Commit
f584096e9d26f8b4bfe07f73829c810f298b3d86- Author
- Leitwolf11 ·
- Parents
bdf8c8cf23cd
Changes
README.md | 1 + apps/web/app/mcp/page.tsx | 55 ++++++++++++++++++++++ apps/web/app/robots.ts | 3 +- apps/web/app/sitemap.ts | 3 ++ apps/web/e2e/pages.ts | 1 + apps/web/lib/mcp-messages.ts | 107 ++++++++++++++++++++++++++++++++++++++++++ apps/web/proxy.ts | 7 +++ apps/web/tests/sites.test.mjs | 11 +++++ docs/ARCHITECTURE.md | 8 ++-- ops/nginx/progmaweb.conf | 47 +++++++++++++++++++ 10 files changed, 239 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d825e62..d46e053 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ the ASP.NET Core API. - `credentials.progmasoft.com`, `authorize.progmasoft.com` and `console.progmasoft.com` serve Progmasoft OAuth: the issuer, the pages people sign in and consent on, and the Progmasoft Console. See [Progmasoft OAuth](docs/OAUTH.md). - `product.progmasoft.com` serves the product catalog, and `license.progmasoft.com` the Progmasoft Source License. +- `agencelandmcp.progmasoft.com` serves the Agenceland MCP Marketplace, which lists no server and takes no uploads. The same Nginx file also answers `viget.progmasoft.com` with 410 Gone, sends `catch3.progmasoft.com` to `catch3.uk`, and serves the Maven repository on `maven.progmasoft.com`; [Operations](ops/README.md) describes those and the other diff --git a/apps/web/app/mcp/page.tsx b/apps/web/app/mcp/page.tsx new file mode 100644 index 0000000..642a0da --- /dev/null +++ b/apps/web/app/mcp/page.tsx @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: AGPL-3.0-or-later + +import type { Metadata } from "next"; +import { Footer } from "@/components/Footer"; +import { SiteHeader } from "@/components/SiteHeader"; +import { getLocale } from "@/lib/locale.server"; +import { getMcpMessages } from "@/lib/mcp-messages"; +import "../site.css"; + +export async function generateMetadata(): Promise<Metadata> { + const text = getMcpMessages(await getLocale()); + return { + title: text.metadataTitle, + description: text.metadataDescription, + alternates: { canonical: "https://agencelandmcp.progmasoft.com/" }, + }; +} + +/** agencelandmcp.progmasoft.com: the Agenceland MCP Marketplace, empty and closed to uploads. */ +export default async function McpMarketplacePage() { + const locale = await getLocale(); + const text = getMcpMessages(locale); + return ( + <div className="pm-page"> + <SiteHeader locale={locale} /> + <main> + <section className="pm-hero"> + <div className="pm-shell pm-product-hero"> + <p className="eyebrow">{text.eyebrow}</p> + <h1>{text.title}</h1> + <p className="pm-lede">{text.description}</p> + </div> + </section> + <section className="pm-section"> + <div className="pm-shell pm-policy"> + <section aria-labelledby="mcp-servers"> + <h2 id="mcp-servers">{text.serversHeading}</h2> + <p>{text.noServers}</p> + </section> + <section aria-labelledby="mcp-publishing"> + <h2 id="mcp-publishing">{text.uploadsHeading}</h2> + <p>{text.uploadsClosed}</p> + </section> + <section aria-labelledby="mcp-installing"> + <h2 id="mcp-installing">{text.installHeading}</h2> + <p>{text.install}</p> + </section> + </div> + </section> + </main> + <Footer locale={locale} /> + </div> + ); +} diff --git a/apps/web/app/robots.ts b/apps/web/app/robots.ts index 6d26429..7c40f9f 100644 --- a/apps/web/app/robots.ts +++ b/apps/web/app/robots.ts @@ -21,7 +21,8 @@ export default async function robots(): Promise<MetadataRoute.Robots> { // Each host with pages of its own names its own sitemap. const sitemap = canonicalHost === "product.progmasoft.com" || - canonicalHost === "license.progmasoft.com" + canonicalHost === "license.progmasoft.com" || + canonicalHost === "agencelandmcp.progmasoft.com" ? `https://${canonicalHost}/sitemap.xml` : "https://progmasoft.com/sitemap.xml"; return { diff --git a/apps/web/app/sitemap.ts b/apps/web/app/sitemap.ts index 74e4184..8e49b02 100644 --- a/apps/web/app/sitemap.ts +++ b/apps/web/app/sitemap.ts @@ -15,6 +15,9 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> { ) .split(":", 1)[0] ?.toLowerCase(); + if (host === "agencelandmcp.progmasoft.com") { + return [{ url: "https://agencelandmcp.progmasoft.com/" }]; + } if (host === "license.progmasoft.com") { return [ { diff --git a/apps/web/e2e/pages.ts b/apps/web/e2e/pages.ts index a0c4335..9ac50d1 100644 --- a/apps/web/e2e/pages.ts +++ b/apps/web/e2e/pages.ts @@ -20,6 +20,7 @@ export const layoutPages = [ "license.progmasoft.com/pm-spl/1.0/information/", "license.progmasoft.com/pm-spl/1.0/faq/", "license.progmasoft.com/pm-spl/1.0/categories/", + "agencelandmcp.progmasoft.com/", ] as const; /** Every host name of the pages above. */ diff --git a/apps/web/lib/mcp-messages.ts b/apps/web/lib/mcp-messages.ts new file mode 100644 index 0000000..a99cd1b --- /dev/null +++ b/apps/web/lib/mcp-messages.ts @@ -0,0 +1,107 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: AGPL-3.0-or-later + +import type { Locale } from "./localization"; + +/** The text of agencelandmcp.progmasoft.com, the Agenceland MCP Marketplace. */ +export interface McpMessages { + metadataTitle: string; + metadataDescription: string; + eyebrow: string; + title: string; + description: string; + serversHeading: string; + noServers: string; + uploadsHeading: string; + uploadsClosed: string; + installHeading: string; + install: string; +} + +/** The marketplace in every published language. */ +export const mcpMessages: Record<Locale, McpMessages> = { + "en-US": { + metadataTitle: "Agenceland MCP Marketplace", + metadataDescription: + "The MCP servers Agenceland installs, from verified publishers with pinned versions.", + eyebrow: "Agenceland", + title: "Agenceland MCP Marketplace", + description: + "MCP servers for Agenceland from verified publishers, each with a pinned version and the permissions it asks for shown before it is installed.", + serversHeading: "Servers", + noServers: "The marketplace lists no server.", + uploadsHeading: "Publishing", + uploadsClosed: + "The marketplace takes no uploads. Publishing opens to Progmasoft accounts later; the Privacy Policy and the Security Policy say what applies to uploads.", + installHeading: "Installing", + install: + "Agenceland installs a server with agenceland mcp add <Account>.<Server>, or from the MCP Marketplace inside Agenceland.", + }, + "de-DE": { + metadataTitle: "Agenceland MCP Marketplace", + metadataDescription: + "Die MCP-Server, die Agenceland installiert, von verifizierten Herausgebern mit festen Versionen.", + eyebrow: "Agenceland", + title: "Agenceland MCP Marketplace", + description: + "MCP-Server für Agenceland von verifizierten Herausgebern, jeder mit fester Version und den Berechtigungen, die er verlangt, angezeigt vor der Installation.", + serversHeading: "Server", + noServers: "Der Marketplace führt keinen Server.", + uploadsHeading: "Veröffentlichen", + uploadsClosed: + "Der Marketplace nimmt keine Uploads an. Das Veröffentlichen öffnet sich später für Progmasoft-Konten; was für Uploads gilt, sagen die Datenschutzerklärung und die Sicherheitsrichtlinie.", + installHeading: "Installieren", + install: + "Agenceland installiert einen Server mit agenceland mcp add <Konto>.<Server> oder über den MCP Marketplace in Agenceland.", + }, + "ru-RU": { + metadataTitle: "Agenceland MCP Marketplace", + metadataDescription: + "MCP-серверы, которые устанавливает Agenceland, от проверенных издателей с закреплёнными версиями.", + eyebrow: "Agenceland", + title: "Agenceland MCP Marketplace", + description: + "MCP-серверы для Agenceland от проверенных издателей: у каждого закреплённая версия, а разрешения, которые он запрашивает, показываются до установки.", + serversHeading: "Серверы", + noServers: "В Marketplace нет ни одного сервера.", + uploadsHeading: "Публикация", + uploadsClosed: + "Marketplace не принимает загрузки. Публикация откроется для учётных записей Progmasoft позже; что относится к загрузкам, говорят Политика конфиденциальности и Политика безопасности.", + installHeading: "Установка", + install: + "Agenceland устанавливает сервер командой agenceland mcp add <Учётная запись>.<Сервер> или через MCP Marketplace внутри Agenceland.", + }, + "fr-FR": { + metadataTitle: "Agenceland MCP Marketplace", + metadataDescription: + "Les serveurs MCP qu’Agenceland installe, d’éditeurs vérifiés, en versions fixées.", + eyebrow: "Agenceland", + title: "Agenceland MCP Marketplace", + description: + "Des serveurs MCP pour Agenceland d’éditeurs vérifiés, chacun en version fixée, avec les autorisations qu’il demande affichées avant l’installation.", + serversHeading: "Serveurs", + noServers: "Le Marketplace ne référence aucun serveur.", + uploadsHeading: "Publication", + uploadsClosed: + "Le Marketplace n’accepte aucun envoi. La publication s’ouvrira plus tard aux comptes Progmasoft ; la Politique de confidentialité et la Politique de sécurité disent ce qui s’applique aux envois.", + installHeading: "Installation", + install: + "Agenceland installe un serveur avec agenceland mcp add <Compte>.<Serveur>, ou depuis le MCP Marketplace dans Agenceland.", + }, +}; + +export function getMcpMessages(locale: Locale): McpMessages { + return mcpMessages[locale]; +} + +/** Drops the trailing slash of every path but the root. */ +function trimmed(pathname: string): string { + return pathname.length > 1 && pathname.endsWith("/") + ? pathname.slice(0, -1) + : pathname; +} + +/** The public pages of agencelandmcp.progmasoft.com: the marketplace alone. */ +export function mcpRoute(pathname: string): string | null { + return trimmed(pathname) === "/" ? "/mcp" : null; +} diff --git a/apps/web/proxy.ts b/apps/web/proxy.ts index b154cf6..3249856 100644 --- a/apps/web/proxy.ts +++ b/apps/web/proxy.ts @@ -12,6 +12,7 @@ import { } from "@/lib/localization"; import { authorizeRoute, consoleRoute, issuerRoute } from "@/lib/credentials"; import { licenseRoute, productRoute } from "@/lib/sites"; +import { mcpRoute } from "@/lib/mcp-messages"; import { contentSecurityPolicy, createNonce, @@ -63,6 +64,12 @@ const ownSites: OwnSite[] = [ route: licenseRoute, api: false, }, + { + hosts: hostsOf("agencelandmcp"), + root: "/mcp", + route: mcpRoute, + api: false, + }, ]; function handle(request: NextRequest) { diff --git a/apps/web/tests/sites.test.mjs b/apps/web/tests/sites.test.mjs index ddd4959..778ab57 100644 --- a/apps/web/tests/sites.test.mjs +++ b/apps/web/tests/sites.test.mjs @@ -12,6 +12,7 @@ import { products, } from "../lib/products.ts"; import { productRoute } from "../lib/sites.ts"; +import { mcpMessages, mcpRoute } from "../lib/mcp-messages.ts"; function shape(value) { if (Array.isArray(value)) { @@ -79,3 +80,13 @@ test("the product hosts map to their internal routes", () => { assert.equal(productRoute("/tazel/extra"), null); assert.equal(productRoute("/../x"), null); }); + +test("the MCP Marketplace has its root alone, in every language", () => { + assert.equal(mcpRoute("/"), "/mcp"); + assert.equal(mcpRoute("/servers"), null); + assert.equal(mcpRoute("/upload"), null); + const english = shape(mcpMessages["en-US"]); + for (const locale of supportedLocales) { + assert.deepEqual(shape(mcpMessages[locale]), english, locale); + } +}); diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 2f176b6..5ff7395 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -16,7 +16,7 @@ Both listen on loopback only. Nginx is the only public listener and terminates T browser | HTTPS v -Nginx (progmasoft.com, account., credentials., authorize., console., product., license.) +Nginx (progmasoft.com, account., credentials., authorize., console., product., license., agencelandmcp.) | | | pages: http://127.0.0.1:3010 | OAuth hosts only: /connect/*, /.well-known/* (issuer) v | and /api/* go straight to http://127.0.0.1:5085 @@ -44,6 +44,7 @@ One build serves every host. The host of a request, not a separate deployment, d | `console.progmasoft.com` | the Progmasoft Console: OAuth 2.1 tokens of the account's applications (`/credentials`, `/credentials/new`, `/credentials/<clientId>`) | `/console` | | `product.progmasoft.com` | the product catalog: `/`, `/<product>`, `/categories`, `/languages`, `/releases` | `/products` | | `license.progmasoft.com` | the Progmasoft Source License 1.0 and its pages | `/license` | +| `agencelandmcp.progmasoft.com` | the Agenceland MCP Marketplace: one page, no server listed, no uploads | `/mcp` | Nginx alone answers three more names from the same file: `viget.progmasoft.com` with 410 Gone (ViGet was closed), `catch3.progmasoft.com` with a permanent redirect to `catch3.uk`, and `maven.progmasoft.com` with the static Maven @@ -58,10 +59,10 @@ hosts during development. 1. **Language parameter.** `?lang=<locale>` with a published locale stores the language cookie and redirects to the same URL without the parameter. See [Localization](LOCALIZATION.md). -2. **Sites of their own.** On the credentials, authorize, console, product and license hosts, a public path is +2. **Sites of their own.** On the credentials, authorize, console, product, license and agencelandmcp hosts, a public path is rewritten into the host's internal tree (the table above); a path the host does not have shows its not-found page. `/api/*` passes through on the credentials, authorize and console hosts only. -3. **Internal trees stay internal.** `/issuer`, `/authorize`, `/console`, `/products` and `/license` on any other host +3. **Internal trees stay internal.** `/issuer`, `/authorize`, `/console`, `/products`, `/license` and `/mcp` on any other host show the not-found page. 4. **Account root.** `/` on the account host is rewritten to the internal `/account` page, so the account landing page has the short URL. @@ -89,6 +90,7 @@ The host is read from `X-Forwarded-Host` first and `Host` second, without the po | `/`, `/credentials`, `/credentials/new[/<kind>]`, `/credentials/<clientId>` (console host) | the Progmasoft Console | no | | `/`, `/<product>`, `/categories`, `/languages`, `/releases` (product host) | the product catalog | yes | | `/`, `/pm-spl/1.0/<page>` (license host) | the Progmasoft Source License | yes | +| `/` (agencelandmcp host) | the Agenceland MCP Marketplace | yes | `robots.txt` and `sitemap.xml` are generated per host: the product and license hosts list their own pages, every other host lists the apex homepage only. Nginx additionally sends `X-Robots-Tag: noindex` for the whole account host. diff --git a/ops/nginx/progmaweb.conf b/ops/nginx/progmaweb.conf index 7a1fd56..60d4a5f 100644 --- a/ops/nginx/progmaweb.conf +++ b/ops/nginx/progmaweb.conf @@ -447,6 +447,53 @@ server { } } +# The Agenceland MCP Marketplace (agencelandmcp.progmasoft.com): pages of the Next.js site only; +# it takes no uploads, so a request body is never larger than a form. +server { + listen 80; + listen [::]:80; + server_name agencelandmcp.progmasoft.com; + + location ^~ /.well-known/acme-challenge/ { + root /var/lib/letsencrypt; + default_type text/plain; + } + + location / { + return 308 https://agencelandmcp.progmasoft.com$request_uri; + } +} + +server { + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + server_name agencelandmcp.progmasoft.com; + + ssl_certificate /etc/letsencrypt/live/progmasoft.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/progmasoft.com/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + + client_max_body_size 1m; + + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-Frame-Options "DENY" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always; + + location / { + proxy_pass http://127.0.0.1:3010; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 60s; + } +} + # catch3.progmasoft.com was Catch3's site; every path moves to catch3.uk. server { listen 80;