@ttoss/http-server-mcp 0.24.1 → 0.25.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/README.md CHANGED
@@ -360,7 +360,7 @@ The `WWW-Authenticate: Bearer resource_metadata="…"` header is how MCP clients
360
360
 
361
361
  The two behaviors the [MCP authorization spec](https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/authorization/) requires for client bootstrapping are built into the `auth` option, so you no longer need the hand-rolled middleware shown above:
362
362
 
363
- - **`publicMethods`** — JSON-RPC methods that bypass verification, read from the request body's `method` field. Defaults to `['initialize', 'tools/list']` so clients can discover the server before authenticating. Pass `[]` to require a token for every method, or a custom list to change the exempt set.
363
+ - **`publicMethods`** — JSON-RPC methods that bypass verification, read from the request body's `method` field. Defaults to `['initialize', 'tools/list']` so clients can discover the server before authenticating. Pass `[]` to require a token for every method, or a custom list to change the exempt set. Leaving it unset serves the full tool catalogue — every tool name, description, and input schema — to unauthenticated callers, and logs a one-time warning explaining that and how to close it. Set `publicMethods` explicitly (even to the same default) to silence the warning.
364
364
  - **`resourceMetadataUrl`** — when set, a `401` responds with `WWW-Authenticate: Bearer resource_metadata="<resourceMetadataUrl>"` (RFC 9728) instead of a bare `Bearer`, pointing MCP clients at the protected-resource metadata document. When omitted, the header falls back to `Bearer`.
365
365
 
366
366
  ```typescript
@@ -871,6 +871,8 @@ expect(call.status).toBe(200);
871
871
 
872
872
  Use the default when token auth is handled outside the OAuth flow (Cognito, API keys, Bearer tokens). Set `publicMethods: []` only when you want OAuth clients to self-discover and authenticate before anything else.
873
873
 
874
+ Leaving `publicMethods` unset also exposes the full tool catalogue (`tools/list`) to unauthenticated callers — a tool's name, description, and input schema can leak internal resource names and, for an OpenAPI-derived server, the shape of the whole underlying API. A one-time warning is logged when `auth` is configured without an explicit `publicMethods`, naming the exposure and how to close it. This default is a candidate to tighten to `['initialize']` in a future major; track the decision in [ttoss/ttoss#1176](https://github.com/ttoss/ttoss/issues/1176).
875
+
874
876
  ## AWS Lambda Deployment
875
877
 
876
878
  The default **stateless** mode (see [Stateless vs stateful mode](#stateless-vs-stateful-mode)) is built for serverless: a fresh transport is created per request, nothing is kept in memory between invocations, and responses are plain JSON (no SSE) — exactly the request/response shape API Gateway and Lambda Function URLs expect.
package/dist/index.cjs CHANGED
@@ -531,6 +531,7 @@ var createMcpRouter = (server, options = {}) => {
531
531
  let authCheck;
532
532
  if (auth) {
533
533
  const verifyToken = buildVerifyToken(auth);
534
+ if (auth.publicMethods === void 0) console.warn(`[@ttoss/http-server-mcp] "auth" is configured but "publicMethods" was not set, so it defaults to ${JSON.stringify(DEFAULT_PUBLIC_METHODS)}. This means "tools/list" — the full tool catalogue, including names, descriptions, and input schemas — is served to unauthenticated callers. To require a token for "tools/list" too, set publicMethods: ['initialize']. To keep the current behaviour and silence this warning, set publicMethods: ${JSON.stringify(DEFAULT_PUBLIC_METHODS)} explicitly.`);
534
535
  const publicMethods = new Set(auth.publicMethods ?? DEFAULT_PUBLIC_METHODS);
535
536
  const verify = (0, _ttoss_http_server_auth.authMiddleware)({
536
537
  strategies: ["oauth"],
package/dist/index.d.cts CHANGED
@@ -892,6 +892,10 @@ interface McpAuthOptions {
892
892
  requiredScopes?: string[];
893
893
  /**
894
894
  * JSON-RPC methods (read from `body.method`) that bypass verification.
895
+ * Leaving this unset serves `tools/list` — the full tool catalogue —
896
+ * to unauthenticated callers, and logs a one-time warning explaining how
897
+ * to close it. Set explicitly (even to the same default) to silence the
898
+ * warning; set to `['initialize']` to require a token for `tools/list` too.
895
899
  * @default ['initialize', 'tools/list']
896
900
  */
897
901
  publicMethods?: string[];
package/dist/index.d.mts CHANGED
@@ -893,6 +893,10 @@ interface McpAuthOptions {
893
893
  requiredScopes?: string[];
894
894
  /**
895
895
  * JSON-RPC methods (read from `body.method`) that bypass verification.
896
+ * Leaving this unset serves `tools/list` — the full tool catalogue —
897
+ * to unauthenticated callers, and logs a one-time warning explaining how
898
+ * to close it. Set explicitly (even to the same default) to silence the
899
+ * warning; set to `['initialize']` to require a token for `tools/list` too.
896
900
  * @default ['initialize', 'tools/list']
897
901
  */
898
902
  publicMethods?: string[];
package/dist/index.mjs CHANGED
@@ -528,6 +528,7 @@ var createMcpRouter = (server, options = {}) => {
528
528
  let authCheck;
529
529
  if (auth) {
530
530
  const verifyToken = buildVerifyToken(auth);
531
+ if (auth.publicMethods === void 0) console.warn(`[@ttoss/http-server-mcp] "auth" is configured but "publicMethods" was not set, so it defaults to ${JSON.stringify(DEFAULT_PUBLIC_METHODS)}. This means "tools/list" — the full tool catalogue, including names, descriptions, and input schemas — is served to unauthenticated callers. To require a token for "tools/list" too, set publicMethods: ['initialize']. To keep the current behaviour and silence this warning, set publicMethods: ${JSON.stringify(DEFAULT_PUBLIC_METHODS)} explicitly.`);
531
532
  const publicMethods = new Set(auth.publicMethods ?? DEFAULT_PUBLIC_METHODS);
532
533
  const verify = authMiddleware({
533
534
  strategies: ["oauth"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/http-server-mcp",
3
- "version": "0.24.1",
3
+ "version": "0.25.1",
4
4
  "description": "Model Context Protocol (MCP) server integration for @ttoss/http-server",
5
5
  "keywords": [
6
6
  "ai",
@@ -36,9 +36,9 @@
36
36
  "@modelcontextprotocol/node": "^2.0.0",
37
37
  "@modelcontextprotocol/server": "^2.0.0",
38
38
  "zod": "^4.4.3",
39
- "@ttoss/auth-core": "^0.13.0",
40
- "@ttoss/http-server-auth": "^0.6.0",
41
- "@ttoss/http-server": "^0.7.1"
39
+ "@ttoss/http-server-auth": "^0.6.1",
40
+ "@ttoss/http-server": "^0.8.0",
41
+ "@ttoss/auth-core": "^0.13.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/koa": "^3.0.3",