[ { "id": "BC2-001", "title": "The built-in host serves every Node server", "package": "@frontmcp/sdk", "category": "change", "severity": "high", "since": "2.0.0", "old": "// 1.x: a handler route, Express middleware or Express 4 makes Express serve the server, with a one-time notice\n@FrontMcp({ http: { routes: [{ method: 'GET', path: '/report', handler: (req, res) => res.sendFile(reportPath) }] } })", "new": "// 2.0: the built-in host serves it, and res.sendFile() throws HttpHostFeatureError without @frontmcp/host-express\nimport { expressHost } from '@frontmcp/host-express'; // npm i @frontmcp/host-express express cors\n@FrontMcp({ http: { hostFactory: expressHost(), routes: [{ method: 'GET', path: '/report', handler: (req, res) => res.sendFile(reportPath) }] } })", "migration": "In 2.0 the built-in `node:http` host serves every Node server, and the fallback to Express that 1.x keeps is removed (#1582). In 1.15 the built-in host serves a server whose routes and middleware are all FrontMCP's own (#1536), and Express serves the server when it has a route or middleware of its own (a `handler` route in `http.routes`, for example), or a path syntax only Express's router matches, or when the installed Express is one the built-in host cannot stand in for (Express 4 with body-parser 1, or `raw-body` or `content-type` not installed). Each case logs a one-time notice that names it and `future: { builtInHost: true }`. In 2.0, installing `@frontmcp/host-express` is the opt-in to Express: when it is installed the server uses it and logs that it did, and `hostFactory: expressHost(overrides?)` passes Express options explicitly. On the built-in host, an Express-only request or response member (`res.sendFile()`, `res.cookie()`, `res.type()`, `res.set()`, `req.ip`, `req.app`, ...) throws `HttpHostFeatureError`, naming the member and `npm i @frontmcp/host-express express cors`, and a route path whose syntax only Express's router matches is refused when the route is registered (use literal and `:name` segments). The Express host's code moves into `@frontmcp/host-express`; in 1.x the package re-exports the SDK's. `http.userContent` serves files through Express and needs `express` installed. To prepare in 1.15: set `future: { builtInHost: true }` in `@FrontMcp`, which turns on the 2.0 host now, and run your tests. Port a route that uses Express members to a web-standard `fetch` route (BC2-005), or set response headers with `res.setHeader()`; or install `@frontmcp/host-express` with `express` and `cors` and keep the Express host: `hostFactory: expressHost()` serves the server on it in 1.15 already, with no notice." }, { "id": "BC2-002", "title": "express, cors, raw-body and content-type are not peers of @frontmcp/sdk", "package": "@frontmcp/sdk", "category": "change", "severity": "medium", "since": "2.0.0", "old": "// 1.x: @frontmcp/sdk lists express, cors, raw-body and content-type as required peers\nnpm i @frontmcp/sdk express cors", "new": "// 2.0: a server on the built-in host installs the SDK; a server on the Express host installs Express with @frontmcp/host-express\nnpm i @frontmcp/sdk\nnpm i @frontmcp/sdk @frontmcp/host-express express cors", "migration": "`express`, `cors`, `raw-body` and `content-type` are required peers of `@frontmcp/sdk` in 1.x, and leave its peer dependencies in 2.0 (#1582), so a package manager stops installing them or asking for them. ESM servers then stop importing Express when the SDK loads. A server on the Express host lists `@frontmcp/host-express`, `express` and `cors` in its own dependencies, as the error for a missing Express member says. In 1.15 a server already runs on the built-in host with `express`, `cors` and `body-parser` missing; there the built-in host uses the `cors` package for `http.cors`, and stops at startup with `HttpHostFeatureError` (`npm i cors`) when `http.cors` is set and `cors` is not installed, and `http.userContent` needs `express`. To prepare: add the packages your server uses (`cors` for `http.cors`, and `express` with `@frontmcp/host-express` for the Express host) to your own `dependencies`." }, { "id": "BC2-003", "title": "getHandler() returns a Node request listener", "package": "@frontmcp/sdk", "category": "change", "severity": "medium", "since": "2.0.0", "old": "const app = await FrontMcpInstance.createHandler(config); // 1.x: the Express app, with a one-time notice in 1.15", "new": "const listener = await FrontMcpInstance.createRequestListener(config); // (req, res), with close(); no notice\nhttp.createServer(listener).listen(3000);", "migration": "In 1.x `getHandler()` and `FrontMcpInstance.createHandler(config)` return the Express app, and in 1.15 they log a one-time notice that says so. In 2.0 they return a Node request listener `(req, res)` (#1582). `getRequestListener()` (on the server and on every host) and `FrontMcpInstance.createRequestListener(config)` return that listener now, with no notice; the listener from `createRequestListener()` has `close()`, which shuts the server down as `shutdown()` does. Use them where the handler is called as `(req, res)`, as `http.createServer()` and a Vercel function call it. Code that needs the Express app itself (`app.use()`, a wrapper that takes an Express app) installs `@frontmcp/host-express`: the server then runs on the Express host and `getHandler()` returns its app, as it does in 1.15 under `future: { builtInHost: true }`. Under that flag, without `@frontmcp/host-express`, `getHandler()` already returns the listener; with `hostFactory: expressHost()`, it returns the Express app with no notice. The entries `frontmcp build` generates for Vercel and Lambda get their handler from `createHandler()`, so those builds give the notice too." }, { "id": "BC2-004", "title": "Form bodies and Express 4 query strings are flat fields, and JSON must be UTF-8", "package": "@frontmcp/sdk", "category": "change", "severity": "low", "since": "2.0.0", "old": "// 1.x, served by Express (qs): a=1&b[c]=2 -> { a: '1', b: { c: '2' } }\n// Content-Type: application/json; charset=utf-16 -> decoded", "new": "// 2.0, on the built-in host: a=1&b[c]=2 -> { a: '1', 'b[c]': '2' }\n// Content-Type: application/json; charset=utf-16 -> 415 Unsupported Media Type", "migration": "In 1.x, Express (`qs`) parses a form body (`application/x-www-form-urlencoded`), and under Express 4 a query string, into nested objects, and decodes JSON in a charset other than UTF-8. In 1.15 each of these requests is handed to Express and logs a one-time notice. In 2.0 the built-in host parses form fields and query strings as flat fields (`a[b]=1` stays the key `\"a[b]\"`), and answers JSON in another charset with `415 Unsupported Media Type` (#1582). A gzip, deflate or br body is decoded with `http.bodyLimit` applied to its decoded size (413 past it, 400 for data that does not decode, 415 for an unknown encoding), as Express decodes it in 1.x, so a compressed body gives no notice. To prepare: read nested form or query keys yourself (`\"b[c]\"`), and send JSON as UTF-8. `future: { builtInHost: true }` turns this on in 1.15." }, { "id": "BC2-005", "title": "Web-standard routes are the default style of http.routes", "package": "@frontmcp/sdk", "category": "change", "severity": "medium", "since": "2.0.0", "old": "routes: [{ method: 'GET', path: '/status/:id', handler: (req, res) => res.json({ id: req.params.id }) }]", "new": "routes: [{ method: 'GET', path: '/status/:id', fetch: async (request, { params }) => Response.json({ id: params.id }) }]", "migration": "1.15 adds web-standard routes to `http.routes` (#1593): `fetch: (request, { params, authSession }) => Response`. A `fetch` route answers the same on the built-in host, the Express host, `@frontmcp/host-express`, `createFetchHandler()` and the serverless builds, behind the same Host check, CORS, security headers, body limit, IP filter and auth as a `handler` route, and no host falls back to Express for it. In 2.0 web-standard routes become the default style, and the `ServerRequest`/`ServerResponse` style (`handler: (req, res, next)`) moves into `@frontmcp/host-express` (#1582). In 1.15 a `handler` route makes Express serve the server, with the notice ` is the server's own, so Express serves every request`; a server whose own routes are all `fetch` routes stays on the built-in host. To prepare: write new routes with `fetch`, and port `handler` routes to it; a `handler` route that uses an Express member needs `@frontmcp/host-express` (BC2-001)." }, { "id": "BC2-006", "title": "The landing page is on by default", "package": "@frontmcp/sdk", "category": "change", "severity": "low", "since": "2.0.0", "old": "// 1.x: a browser GET on the MCP path (Accept: text/html) gets an error unless http.landingPage is true\n@FrontMcp({ http: { landingPage: true } })", "new": "// 2.0: it gets the landing page; landingPage: false keeps the 1.x answer\n@FrontMcp({ http: { landingPage: false } })", "migration": "`http.landingPage` (#1600) answers a browser that opens the MCP URL (a `GET` on the MCP path whose `Accept` names `text/html` and not `text/event-stream`) with a page that shows the server's name, version and description, the tools an anonymous caller may list, and how to add the server to common MCP clients. It is off in 1.x and on by default in 2.0. MCP clients' requests are answered the same either way, and `/sse` and `/message` never get the page. 1.x gives no notice for it. To prepare: set `http.landingPage: true` to see the page now, or `false` to keep the 1.x answer in 2.0; `{ render }` serves a page of your own." }, { "id": "BC2-007", "title": "FrontMCP alone sets the claims that tell a person from a machine", "package": "@frontmcp/sdk", "category": "change", "severity": "medium", "since": "2.0.0", "old": "// 1.x: the token reads as a machine, and a one-time notice names client_id\nauth: { mode: 'local', authenticate: async () => ({ ok: true, sub: 'ada', claims: { client_id: 'ada' } }) }", "new": "// 2.0, or future: { reservedClaims: true } in 1.15: client_id is dropped and Ada signs in as a person\nauth: { mode: 'local', authenticate: async () => ({ ok: true, sub: 'ada', claims: { upstream_client_id: 'ada' } }) }", "migration": "FrontMCP reads `gty`, `idtyp`, `client_id`, `azp`, `cid` and `appid` (with `sub`) to tell a person from a machine. In local mode the `claims` an `auth.authenticate()` verifier returns go into the token FrontMCP issues, so a verifier that copies claims from elsewhere can make a person's token read as a machine's. In 1.15 these claims still reach the token, and the first time a verifier returns one, a one-time notice names them (#1607). In 2.0 FrontMCP drops them from the verifier's `claims` before the token is issued, on sign-in and on refresh, so the principal comes only from claims FrontMCP sets, as `future: { reservedClaims: true }` does in 1.15. FrontMCP's own `client_credentials` tokens (`auth.clientCredentials`) keep `gty: 'client_credentials'` and their `client:` subject. The set is exported from `@frontmcp/auth` as `PRINCIPAL_KIND_CLAIMS`. To prepare: give such a claim a name of your own (`upstream_client_id`) and read it under that name, then set the flag." } ]