boondmanager-mcp-server 2.9.0 → 2.11.0

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.
Files changed (75) hide show
  1. package/README.md +73 -7
  2. package/dist/config/access-policy.d.ts +5 -0
  3. package/dist/config/access-policy.d.ts.map +1 -1
  4. package/dist/config/access-policy.js +36 -1
  5. package/dist/config/access-policy.js.map +1 -1
  6. package/dist/config/env-flags.d.ts +11 -0
  7. package/dist/config/env-flags.d.ts.map +1 -0
  8. package/dist/config/env-flags.js +16 -0
  9. package/dist/config/env-flags.js.map +1 -0
  10. package/dist/config/profiles.d.ts +71 -0
  11. package/dist/config/profiles.d.ts.map +1 -0
  12. package/dist/config/profiles.js +115 -0
  13. package/dist/config/profiles.js.map +1 -0
  14. package/dist/icons.d.ts +79 -0
  15. package/dist/icons.d.ts.map +1 -0
  16. package/dist/icons.js +169 -0
  17. package/dist/icons.js.map +1 -0
  18. package/dist/instructions.d.ts +21 -0
  19. package/dist/instructions.d.ts.map +1 -0
  20. package/dist/instructions.js +56 -0
  21. package/dist/instructions.js.map +1 -0
  22. package/dist/resources/index.d.ts.map +1 -1
  23. package/dist/resources/index.js +6 -0
  24. package/dist/resources/index.js.map +1 -1
  25. package/dist/schemas/filter-aliases.d.ts +69 -0
  26. package/dist/schemas/filter-aliases.d.ts.map +1 -0
  27. package/dist/schemas/filter-aliases.js +225 -0
  28. package/dist/schemas/filter-aliases.js.map +1 -0
  29. package/dist/schemas/index.d.ts +22 -22
  30. package/dist/schemas/index.d.ts.map +1 -1
  31. package/dist/schemas/index.js +54 -43
  32. package/dist/schemas/index.js.map +1 -1
  33. package/dist/server.d.ts +25 -1
  34. package/dist/server.d.ts.map +1 -1
  35. package/dist/server.js +61 -16
  36. package/dist/server.js.map +1 -1
  37. package/dist/services/boond-client.d.ts.map +1 -1
  38. package/dist/services/boond-client.js +17 -2
  39. package/dist/services/boond-client.js.map +1 -1
  40. package/dist/tools/candidates.d.ts.map +1 -1
  41. package/dist/tools/candidates.js +1 -4
  42. package/dist/tools/candidates.js.map +1 -1
  43. package/dist/tools/companies.d.ts.map +1 -1
  44. package/dist/tools/companies.js +1 -4
  45. package/dist/tools/companies.js.map +1 -1
  46. package/dist/tools/contacts.d.ts.map +1 -1
  47. package/dist/tools/contacts.js +1 -4
  48. package/dist/tools/contacts.js.map +1 -1
  49. package/dist/tools/crud-factory.d.ts +0 -8
  50. package/dist/tools/crud-factory.d.ts.map +1 -1
  51. package/dist/tools/crud-factory.js +67 -15
  52. package/dist/tools/crud-factory.js.map +1 -1
  53. package/dist/tools/opportunities.d.ts.map +1 -1
  54. package/dist/tools/opportunities.js +1 -4
  55. package/dist/tools/opportunities.js.map +1 -1
  56. package/dist/tools/projects.d.ts.map +1 -1
  57. package/dist/tools/projects.js +1 -4
  58. package/dist/tools/projects.js.map +1 -1
  59. package/dist/tools/registration-decorators.d.ts +35 -0
  60. package/dist/tools/registration-decorators.d.ts.map +1 -0
  61. package/dist/tools/registration-decorators.js +30 -0
  62. package/dist/tools/registration-decorators.js.map +1 -0
  63. package/dist/tools/resources.d.ts.map +1 -1
  64. package/dist/tools/resources.js +1 -4
  65. package/dist/tools/resources.js.map +1 -1
  66. package/dist/tools/validation-wrapper.d.ts +43 -0
  67. package/dist/tools/validation-wrapper.d.ts.map +1 -0
  68. package/dist/tools/validation-wrapper.js +108 -0
  69. package/dist/tools/validation-wrapper.js.map +1 -0
  70. package/dist/transports/http.d.ts +57 -3
  71. package/dist/transports/http.d.ts.map +1 -1
  72. package/dist/transports/http.js +145 -9
  73. package/dist/transports/http.js.map +1 -1
  74. package/manifest.json +9 -2
  75. package/package.json +4 -2
@@ -0,0 +1,35 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { DomainName } from "../constants.js";
3
+ /**
4
+ * Per-domain registration decorations, applied centrally in
5
+ * `server.ts::registerAll` so none of the 38 domain files has to know about
6
+ * them. Two jobs, both keyed on the domain the registrar belongs to (which the
7
+ * caller knows for free — it is iterating `TOOL_REGISTRARS`):
8
+ *
9
+ * 1. enrich `*_search` input schemas with filter-correction messages
10
+ * (`validation-wrapper.ts`);
11
+ * 2. record `tool name → domain` so the icon layer can attach the right
12
+ * domain icon without parsing tool names (`icons.ts`).
13
+ *
14
+ * Deliberately NOT merged into `withPolicy`: that wrapper has a fast path
15
+ * returning the untouched server when no operation filter is active, and these
16
+ * decorations must apply unconditionally.
17
+ */
18
+ export interface RegistrationIndex {
19
+ /**
20
+ * Tool name → owning domain. Filled at registration time from
21
+ * `TOOL_REGISTRARS`, so it is exact for multi-word domains
22
+ * (`provider-invoices`) and for tools whose name doesn't start with their
23
+ * domain (`boond_workflow_*` ← `workflows`).
24
+ */
25
+ toolDomains: Map<string, DomainName>;
26
+ }
27
+ export declare function createRegistrationIndex(): RegistrationIndex;
28
+ /**
29
+ * Wrap a server (or an already-wrapped Proxy) so every `registerTool` call made
30
+ * by `domain`'s registrar is decorated. Methods other than `registerTool` pass
31
+ * straight through, bound to the real target so the SDK's private fields keep
32
+ * working (same technique as `withPolicy`).
33
+ */
34
+ export declare function decorateRegistrations(server: McpServer, domain: DomainName, index?: RegistrationIndex): McpServer;
35
+ //# sourceMappingURL=registration-decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registration-decorators.d.ts","sourceRoot":"","sources":["../../src/tools/registration-decorators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACtC;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAmBjH"}
@@ -0,0 +1,30 @@
1
+ import { withValidationFeedback } from "./validation-wrapper.js";
2
+ export function createRegistrationIndex() {
3
+ return { toolDomains: new Map() };
4
+ }
5
+ /**
6
+ * Wrap a server (or an already-wrapped Proxy) so every `registerTool` call made
7
+ * by `domain`'s registrar is decorated. Methods other than `registerTool` pass
8
+ * straight through, bound to the real target so the SDK's private fields keep
9
+ * working (same technique as `withPolicy`).
10
+ */
11
+ export function decorateRegistrations(server, domain, index) {
12
+ return new Proxy(server, {
13
+ get(target, prop) {
14
+ const value = Reflect.get(target, prop, target);
15
+ if (typeof value !== "function")
16
+ return value;
17
+ if (prop === "registerTool") {
18
+ return (...args) => {
19
+ const name = args[0];
20
+ const config = args[1];
21
+ index?.toolDomains.set(name, domain);
22
+ const decorated = config === undefined ? config : withValidationFeedback(name, config, domain);
23
+ return value.apply(target, [name, decorated, ...args.slice(2)]);
24
+ };
25
+ }
26
+ return value.bind(target);
27
+ },
28
+ });
29
+ }
30
+ //# sourceMappingURL=registration-decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registration-decorators.js","sourceRoot":"","sources":["../../src/tools/registration-decorators.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AA4BjE,MAAM,UAAU,uBAAuB;IACrC,OAAO,EAAE,WAAW,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,MAAkB,EAAE,KAAyB;IACpG,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE;QACvB,GAAG,CAAC,MAAM,EAAE,IAAI;YACd,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAY,CAAC;YAC3D,IAAI,OAAO,KAA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AAiB,GAAG,iBAAiB,CAQlF;AAWD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAwO7D"}
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/tools/resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAyLzE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuEzB;AA+BD,KAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAe5E,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,iBAAiB,GAAG,iBAAiB,CAQlF;AAWD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAwO7D"}
@@ -127,20 +127,17 @@ Returns: Liste des demandes d'absences de la ressource.`,
127
127
  ];
128
128
  const RESOURCE_SEARCH_DESCRIPTION = `Recherche des ressources (collaborateurs internes) dans BoondManager avec filtres serveur.
129
129
 
130
- ⚠️ Utilisez les filtres structurés plutôt que la pagination intégrale. Les noms de paramètres ci-dessous sont **ceux exacts** de l'API BoondManager — toute autre orthographe est silencieusement ignorée.
131
-
132
130
  Cas d'usage courants :
133
131
  • **Mes données / mon équipe / mon agence** sans connaître son propre ID : \`perimeterDynamic: ["data"]\` (mes ressources), \`["managers"]\` (mes N-1), \`["agencies"]\` (mes agences).
134
132
  • **Équipe d'une personne X** : \`perimeterManagers: [<X_id>]\` (filtre les ressources dont X est le N+1).
135
133
  • **Mon ID utilisateur** : appeler \`boond_application_current_user\` puis passer cet ID dans \`perimeterManagers\`.
136
134
  • **États / types** : \`resourceStates: [<id>]\`, \`resourceTypes: [<id>]\`. IDs entiers issus du dictionnaire (voir \`boond_application_dictionary\` avec \`setting.state.resource\` ou \`setting.typeOf.resource\`). \`excludeResourceStates\` / \`excludeResourceTypes\` pour exclure.
137
- • **Périmètre organisationnel** : \`perimeterAgencies\`, \`perimeterPoles\`, \`perimeterBusinessUnits\` (IDs entiers). Combiner avec \`narrowPerimeter: true\` pour ET au lieu de OU.
138
135
  • **Compétences / outils** : \`tools: [<toolId>, ...]\` (OU par défaut ; pour ET: \`["#AND#", "1", "2"]\`). \`expertiseAreas\`, \`activityAreas\`, \`languages\` (format \`langueId|niveauId\`).
139
136
  • **Disponibilité / activité** : \`period: "available"\` + \`startDate\`/\`endDate\`. Autres valeurs : \`working\`, \`hired\`, \`left\`, \`employed\`, \`birthday\`, \`seniority\`…
140
137
  • **Recherche par nom** : \`keywords: "Dupont"\` + \`keywordsType: "lastName"\` (ou \`firstName\`, \`fullName\` avec \`keywords: "Dupont#Jean"\`).
141
138
  • **Géolocalisation** : \`coordinates: "48.85,2.35"\` (ou \`location: "Paris"\`) + \`geoDistance: 50\` (km).
142
139
 
143
- Pagination : \`page\` (1+), \`pageSize\` (1-500). Tri : \`sort: "lastName"\` (ou firstName/title/availability/state/updateDate/creationDate) + \`order: "asc"|"desc"\`.
140
+ Tri : \`sort: "lastName"\` (ou firstName/title/availability/state/updateDate/creationDate) + \`order: "asc"|"desc"\`.
144
141
 
145
142
  Returns : liste paginée. Utiliser \`boond_resources_get\` ou les outils d'onglets pour le détail.`;
146
143
  // Merge a partial DT payload into the current DT attributes per the rules
@@ -1 +1 @@
1
- {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/tools/resources.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EACL,kBAAk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AAC,CAAC;QACnD,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,kBAAkB,WAAW,+BAA+B,UAAU,KAAK,IAAI,CAAC,MAAM,6BAA6B;iBAC1H;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/tools/resources.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAElG,MAAM,IAAI,GAAG;IACX,UAAU,EAAE,WAAW;IACvB,gBAAgB,EAAE,YAAY;IAC9B,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,iBAAiB;CAC1B,CAAC;AAEF,MAAM,oBAAoB,GAAG;IAC3B,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,KAAK;CACZ,CAAC;AASX,MAAM,aAAa,GAAoB;IACrC;QACE,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,aAAa;QAClB,KAAK,EAAE,wCAAwC;QAC/C,WAAW,EAAE;;;;;kEAKiD;KAC/D;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,gBAAgB;QACrB,KAAK,EAAE,wCAAwC;QAC/C,WAAW,EAAE;;;;;4DAK2C;KACzD;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,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AAM,CAAC,WAAW,CAAC,CAAC,CAAC;QACzE,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;YACnC,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,gBAAgB,WAAW,kCAAkC,UAAU,mBAAmB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,GAAG;qBACpJ;iBACF;aACF,CAAC;QACJ,CAAC;QACD,MAAM,0BAA0B,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACnD,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,kBAAkB,WAAW,+BAA+B,UAAU,KAAK,IAAI,CAAC,MAAM,6BAA6B;iBAC1H;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { DomainName } from "../constants.js";
2
+ /**
3
+ * Rebuild a strict object schema with a filter-aware unrecognized-key message.
4
+ * Anything else (raw shapes, non-strict objects, unions) is returned as-is —
5
+ * we never make a lenient schema strict as a side effect.
6
+ *
7
+ * The rebuild reuses the exact same field schemas, so defaults, descriptions
8
+ * and per-field messages are preserved. Only issues raised *by the object
9
+ * itself* reach our error function; a field-level failure (e.g. `page: 500`)
10
+ * keeps the message its own schema defines, which is why the returned
11
+ * `undefined` fallback matters.
12
+ */
13
+ export declare function withFilterHints<T>(schema: T, domain?: DomainName): T;
14
+ interface ToolConfigLike {
15
+ inputSchema?: unknown;
16
+ annotations?: {
17
+ openWorldHint?: boolean;
18
+ };
19
+ }
20
+ /**
21
+ * Is this a search-shaped tool, i.e. one whose filter vocabulary is worth
22
+ * explaining?
23
+ *
24
+ * Keyed on the *registration* rather than the name only. `openWorldHint: true`
25
+ * is exactly the annotation the codebase reserves for paginated,
26
+ * keyword-filtered listing tools (see CLAUDE.md §MCP Annotations), so it catches
27
+ * `boond_reporting_{companies,projects,resources,synthesis,production_plans}` —
28
+ * strict schemas carrying the same treacherous `perimeter*` / `*States`
29
+ * vocabulary, which a `_search` suffix test silently skipped — and any future
30
+ * hand-rolled search tool that doesn't happen to be named `*_search`. The name
31
+ * check is kept as an OR so a listing tool that omits the annotation is still
32
+ * covered.
33
+ */
34
+ export declare function isSearchTool(name: string, config?: ToolConfigLike): boolean;
35
+ /**
36
+ * Return the registration config a search tool should be registered with:
37
+ * the same object with its `inputSchema` swapped for the hint-enriched clone.
38
+ * Non-search tools and configs without a strict object schema come back
39
+ * untouched (same reference), so this is a no-op for the ~150 other tools.
40
+ */
41
+ export declare function withValidationFeedback<C extends ToolConfigLike>(name: string, config: C, domain?: DomainName): C;
42
+ export {};
43
+ //# sourceMappingURL=validation-wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-wrapper.d.ts","sourceRoot":"","sources":["../../src/tools/validation-wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAoDlD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,CAAC,CAYpE;AAED,UAAU,cAAc;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC3C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,OAAO,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,CAAC,CAKhH"}
@@ -0,0 +1,108 @@
1
+ import { z } from "zod";
2
+ import { unknownFilterMessage, ENDPOINT_FILTER_ALIASES } from "../schemas/filter-aliases.js";
3
+ /**
4
+ * Turn a `.strict()` search schema's unrecognized-key rejection into a
5
+ * correction the model can act on (SEP-1303).
6
+ *
7
+ * ## Why this is a *schema* wrapper and not a handler wrapper
8
+ *
9
+ * The issue this implements proposed wrapping the tool handler and
10
+ * `safeParse`-ing before the SDK does. That cannot work: `McpServer` validates
11
+ * the input **before** invoking the handler
12
+ * (`server/mcp.js::validateToolInput`), so on a validation failure the handler
13
+ * is never reached. The two options left were (a) declare a permissive schema
14
+ * to the SDK and validate strictly ourselves — which drops
15
+ * `additionalProperties: false` from the advertised `inputSchema`, the thing
16
+ * that lets a client validate before it even calls us — or (b) keep the strict
17
+ * schema and make *its own* error message the correction. We do (b):
18
+ *
19
+ * - the advertised `inputSchema` is byte-for-byte what it was before (verified
20
+ * in the tests: the rebuilt schema's JSON Schema is unchanged);
21
+ * - there is no second parse, so nothing is added to the hot path of a search;
22
+ * - the SDK already reports a validation failure as a *tool* error
23
+ * (`isError: true`) rather than a protocol error — it catches its own
24
+ * `McpError` and funnels it through `createToolError`. So SEP-1303's
25
+ * requirement is met by the SDK; what was missing, and what this adds, is a
26
+ * message worth self-correcting from.
27
+ *
28
+ * Applied to search-shaped tools only (see `isSearchTool`): that is where the
29
+ * filter vocabulary is treacherous (`mainManagers` vs `perimeterManagers`,
30
+ * `states` vs `resourceStates`). `get`/`create`/`update` take ids and attribute
31
+ * names the model reads straight off the schema.
32
+ */
33
+ /** Does the domain have an endpoint-specific filter vocabulary? */
34
+ function searchEndpointOf(domain) {
35
+ if (domain !== undefined && Object.hasOwn(ENDPOINT_FILTER_ALIASES, domain))
36
+ return domain;
37
+ return undefined;
38
+ }
39
+ /**
40
+ * A Zod v4 object schema that *rejects* unknown keys — i.e. `catchall` is
41
+ * `ZodNever`, not merely present. `.catchall(z.string())` also sets it, and
42
+ * rebuilding such a schema as `strictObject` would silently turn a permissive
43
+ * schema into a strict one.
44
+ */
45
+ function isStrictObject(schema) {
46
+ if (!(schema instanceof z.ZodObject))
47
+ return false;
48
+ const def = schema._zod?.def;
49
+ return def?.catchall instanceof z.ZodNever;
50
+ }
51
+ /**
52
+ * Rebuild a strict object schema with a filter-aware unrecognized-key message.
53
+ * Anything else (raw shapes, non-strict objects, unions) is returned as-is —
54
+ * we never make a lenient schema strict as a side effect.
55
+ *
56
+ * The rebuild reuses the exact same field schemas, so defaults, descriptions
57
+ * and per-field messages are preserved. Only issues raised *by the object
58
+ * itself* reach our error function; a field-level failure (e.g. `page: 500`)
59
+ * keeps the message its own schema defines, which is why the returned
60
+ * `undefined` fallback matters.
61
+ */
62
+ export function withFilterHints(schema, domain) {
63
+ if (!isStrictObject(schema))
64
+ return schema;
65
+ const shape = schema.shape;
66
+ const validKeys = Object.keys(shape);
67
+ const endpoint = searchEndpointOf(domain);
68
+ return z.strictObject(shape, {
69
+ error: (issue) => {
70
+ const raw = issue;
71
+ if (raw.code !== "unrecognized_keys" || !Array.isArray(raw.keys))
72
+ return undefined;
73
+ return unknownFilterMessage(raw.keys.map(String), validKeys, endpoint);
74
+ },
75
+ });
76
+ }
77
+ /**
78
+ * Is this a search-shaped tool, i.e. one whose filter vocabulary is worth
79
+ * explaining?
80
+ *
81
+ * Keyed on the *registration* rather than the name only. `openWorldHint: true`
82
+ * is exactly the annotation the codebase reserves for paginated,
83
+ * keyword-filtered listing tools (see CLAUDE.md §MCP Annotations), so it catches
84
+ * `boond_reporting_{companies,projects,resources,synthesis,production_plans}` —
85
+ * strict schemas carrying the same treacherous `perimeter*` / `*States`
86
+ * vocabulary, which a `_search` suffix test silently skipped — and any future
87
+ * hand-rolled search tool that doesn't happen to be named `*_search`. The name
88
+ * check is kept as an OR so a listing tool that omits the annotation is still
89
+ * covered.
90
+ */
91
+ export function isSearchTool(name, config) {
92
+ return name.endsWith("_search") || config?.annotations?.openWorldHint === true;
93
+ }
94
+ /**
95
+ * Return the registration config a search tool should be registered with:
96
+ * the same object with its `inputSchema` swapped for the hint-enriched clone.
97
+ * Non-search tools and configs without a strict object schema come back
98
+ * untouched (same reference), so this is a no-op for the ~150 other tools.
99
+ */
100
+ export function withValidationFeedback(name, config, domain) {
101
+ if (!isSearchTool(name, config) || config?.inputSchema === undefined)
102
+ return config;
103
+ const enriched = withFilterHints(config.inputSchema, domain);
104
+ if (enriched === config.inputSchema)
105
+ return config;
106
+ return { ...config, inputSchema: enriched };
107
+ }
108
+ //# sourceMappingURL=validation-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-wrapper.js","sourceRoot":"","sources":["../../src/tools/validation-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAuB,MAAM,8BAA8B,CAAC;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,mEAAmE;AACnE,SAAS,gBAAgB,CAAC,MAA8B;IACtD,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAAC;QAAE,OAAO,MAAwB,CAAC;IAC5G,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAAe;IACrC,IAAI,CAAC,CAAC,MAAM,YAAY,CAAC,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IACnD,MAAM,GAAG,GAAI,MAAiE,CAAC,IAAI,EAAE,GAAG,CAAC;IACzF,OAAO,GAAG,EAAE,QAAQ,YAAY,CAAC,CAAC,QAAQ,CAAC;AAC7C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAI,MAAS,EAAE,MAAmB;IAC/D,IAAI,CAAC,cAAc,CAAC,MAAM,CAA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 -13,11 +13,22 @@ export interface HttpTransportOptions {
13
13
  maxSessions?: number;
14
14
  /**
15
15
  * Allow-list of Host header hostnames (port-agnostic) for DNS rebinding
16
- * protection. Empty array = validation disabled. Use `["*"]` to opt out
17
- * explicitly. When undefined, a localhost default is applied if bound
18
- * to a loopback interface.
16
+ * protection. Use `["*"]` to opt out explicitly. When undefined **or empty**
17
+ * (an unset / blank env var), a localhost default is applied if bound to a
18
+ * loopback interface, and validation is off otherwise — a blank value never
19
+ * silently disables the check, `*` is the explicit opt-out.
19
20
  */
20
21
  allowedHosts?: string[];
22
+ /**
23
+ * Allow-list of `Origin` header values (scheme + host + port) accepted from
24
+ * browser-based clients. A request with **no** `Origin` is always accepted
25
+ * (curl, gateways, non-browser MCP clients); a request carrying an `Origin`
26
+ * outside this list gets a `403` (MCP 2025-11-25 requirement). Use `["*"]` to
27
+ * opt out explicitly. When undefined **or empty** (an unset / blank env var),
28
+ * the loopback default of `resolveOriginPolicy` applies — same rationale as
29
+ * `allowedHosts`: blank does not mean "disabled".
30
+ */
31
+ allowedOrigins?: string[];
21
32
  /**
22
33
  * Public URL clients use to reach this MCP endpoint — used as the
23
34
  * `resource` field of the protected-resource metadata and in the
@@ -52,8 +63,51 @@ export interface HttpServerHandle {
52
63
  * bound listen interface. Returns an empty array when validation is disabled
53
64
  * (either explicitly via `["*"]` or implicitly when bound to a non-loopback
54
65
  * interface without an explicit list).
66
+ *
67
+ * An empty `configured` array is treated as *unconfigured*, not as "disabled":
68
+ * `MCP_HTTP_ALLOWED_HOSTS=` (or a value of only commas) must not quietly turn a
69
+ * security control off. `["*"]` is the explicit opt-out.
55
70
  */
56
71
  export declare function resolveAllowedHosts(configured: string[] | undefined, host: string): string[];
72
+ /** Resolved `Origin` validation policy — see `resolveOriginPolicy`. */
73
+ export interface OriginPolicy {
74
+ /** `false` = validation disabled; every `Origin` is accepted. */
75
+ enabled: boolean;
76
+ /** Exact-match allow-list, normalised (see `normalizeOrigin`). */
77
+ origins: string[];
78
+ /**
79
+ * Also accept any `http`/`https` origin whose hostname is a loopback literal,
80
+ * **on any port**. Set only by the loopback default, never by an explicit
81
+ * allow-list (an operator who enumerates origins gets exact matching).
82
+ */
83
+ allowAnyLoopback: boolean;
84
+ }
85
+ /**
86
+ * Resolves the effective `Origin` policy, mirroring `resolveAllowedHosts`: an
87
+ * explicit list wins (exact match, port-sensitive), a sole `*` disables
88
+ * validation, a `*` mixed with real origins is dropped with a warning
89
+ * (validation stays on), and the default only applies when bound to a loopback
90
+ * interface. An empty `configured` array counts as unconfigured, not disabled.
91
+ *
92
+ * The loopback default accepts **any loopback origin on any port**, plus the
93
+ * origin of `publicUrl` when one is configured. Pinning the bound port instead
94
+ * (the obvious reading of "origins are port-sensitive") would 403 every real
95
+ * browser client: nothing is ever *served* from this port — it answers JSON-RPC
96
+ * — so the origins that legitimately show up are other local ports (MCP
97
+ * Inspector on `:6274`, a dev server on `:5173`) or the proxy's public URL.
98
+ * The anti-DNS-rebinding property is untouched: a remote page still gets a 403,
99
+ * and an attacker already running code on the loopback interface can simply
100
+ * omit the header, which is always accepted.
101
+ */
102
+ export declare function resolveOriginPolicy(configured: string[] | undefined, host: string, publicUrl?: string): OriginPolicy;
103
+ /** Applies a resolved policy to one `Origin` header value. */
104
+ export declare function isOriginAllowed(policy: OriginPolicy, origin: string): boolean;
105
+ /**
106
+ * Whether a request targets the public protected-resource metadata document.
107
+ * Shared by the `Origin` exemption and the handler itself so the two cannot
108
+ * drift apart. Takes the raw `req.url` — it runs before the `URL` parse.
109
+ */
110
+ export declare function isDiscoveryPath(reqUrl: string | undefined, mcpPath: string): boolean;
57
111
  export declare function resolveHttpOptions(): HttpTransportOptions;
58
112
  export declare function startHttpTransport(createServerFactory: () => McpServer, options: HttpTransportOptions): Promise<HttpServerHandle>;
59
113
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/transports/http.ts"],"names":[],"mappings":"AAIA,OAA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O,EAAE,MAAM,EAAE,CAAC;IAClB;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,CAkBpH;AAkBD,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAK7E;AAKD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGpF;AAiBD,wBAAgB,kBAAkB,IAAI,oBAAoB,CA2BzD;AAkFD,wBAAsB,kBAAkB,CACtC,mBAAmB,EAAE,MAAM,SAAS,EACpC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAmT3B"}
@@ -31,21 +31,30 @@ function readPositiveInt(key, fallback) {
31
31
  return fallback;
32
32
  return Math.floor(parsed);
33
33
  }
34
- function readAllowedHosts() {
35
- const raw = readEnv("MCP_HTTP_ALLOWED_HOSTS");
34
+ function readCsvEnv(key) {
35
+ const raw = readEnv(key);
36
36
  if (raw === undefined)
37
37
  return undefined;
38
- const parts = raw
38
+ return raw
39
39
  .split(",")
40
40
  .map((s) => s.trim())
41
41
  .filter((s) => s.length > 0);
42
- return parts;
42
+ }
43
+ function readAllowedHosts() {
44
+ return readCsvEnv("MCP_HTTP_ALLOWED_HOSTS");
45
+ }
46
+ function readAllowedOrigins() {
47
+ return readCsvEnv("MCP_HTTP_ALLOWED_ORIGINS");
43
48
  }
44
49
  /**
45
50
  * Resolves the effective Host header allow-list given user options and the
46
51
  * bound listen interface. Returns an empty array when validation is disabled
47
52
  * (either explicitly via `["*"]` or implicitly when bound to a non-loopback
48
53
  * interface without an explicit list).
54
+ *
55
+ * An empty `configured` array is treated as *unconfigured*, not as "disabled":
56
+ * `MCP_HTTP_ALLOWED_HOSTS=` (or a value of only commas) must not quietly turn a
57
+ * security control off. `["*"]` is the explicit opt-out.
49
58
  */
50
59
  export function resolveAllowedHosts(configured, host) {
51
60
  if (configured && configured.length > 0) {
@@ -66,6 +75,117 @@ export function resolveAllowedHosts(configured, host) {
66
75
  return LOCALHOST_ALLOWED_HOSTS;
67
76
  return [];
68
77
  }
78
+ /**
79
+ * Canonical form of an origin for comparison: lowercased (scheme and host are
80
+ * case-insensitive) and without a trailing slash (some clients send
81
+ * `http://localhost:3000/`, the spec form has no path).
82
+ *
83
+ * The trailing slashes are stripped with an index scan rather than a
84
+ * `/\/+$/` replace: this runs on the caller-supplied `Origin` header, and an
85
+ * anchored quantifier over a long run of `/` backtracks quadratically
86
+ * (js/polynomial-redos). The scan below is linear whatever the input.
87
+ */
88
+ function normalizeOrigin(value) {
89
+ const trimmed = value.trim();
90
+ let end = trimmed.length;
91
+ while (end > 0 && trimmed.charCodeAt(end - 1) === 47 /* '/' */)
92
+ end--;
93
+ return trimmed.slice(0, end).toLowerCase();
94
+ }
95
+ /**
96
+ * Whether a normalised origin is a browser page served from the local machine.
97
+ *
98
+ * Matching is on the *hostname literal*, not on resolution: `http://127.0.0.1.
99
+ * nip.io` resolves to a loopback address but its hostname is not in the set, so
100
+ * it is correctly rejected — that indirection is exactly the DNS rebinding
101
+ * vector `Origin` validation exists to stop.
102
+ */
103
+ const LOOPBACK_ORIGIN_HOSTNAMES = new Set(["localhost", "127.0.0.1", "[::1]", "::1"]);
104
+ function isLoopbackOrigin(normalizedOrigin) {
105
+ let url;
106
+ try {
107
+ url = new URL(normalizedOrigin);
108
+ }
109
+ catch {
110
+ return false;
111
+ }
112
+ if (url.protocol !== "http:" && url.protocol !== "https:")
113
+ return false;
114
+ return LOOPBACK_ORIGIN_HOSTNAMES.has(url.hostname);
115
+ }
116
+ const VALIDATION_DISABLED = { enabled: false, origins: [], allowAnyLoopback: false };
117
+ /**
118
+ * Resolves the effective `Origin` policy, mirroring `resolveAllowedHosts`: an
119
+ * explicit list wins (exact match, port-sensitive), a sole `*` disables
120
+ * validation, a `*` mixed with real origins is dropped with a warning
121
+ * (validation stays on), and the default only applies when bound to a loopback
122
+ * interface. An empty `configured` array counts as unconfigured, not disabled.
123
+ *
124
+ * The loopback default accepts **any loopback origin on any port**, plus the
125
+ * origin of `publicUrl` when one is configured. Pinning the bound port instead
126
+ * (the obvious reading of "origins are port-sensitive") would 403 every real
127
+ * browser client: nothing is ever *served* from this port — it answers JSON-RPC
128
+ * — so the origins that legitimately show up are other local ports (MCP
129
+ * Inspector on `:6274`, a dev server on `:5173`) or the proxy's public URL.
130
+ * The anti-DNS-rebinding property is untouched: a remote page still gets a 403,
131
+ * and an attacker already running code on the loopback interface can simply
132
+ * omit the header, which is always accepted.
133
+ */
134
+ export function resolveOriginPolicy(configured, host, publicUrl) {
135
+ if (configured && configured.length > 0) {
136
+ if (configured.includes("*")) {
137
+ if (configured.length === 1)
138
+ return VALIDATION_DISABLED;
139
+ logger.warn({ allowedOrigins: configured }, "MCP_HTTP_ALLOWED_ORIGINS contains '*' alongside other origins; ignoring '*' and keeping Origin validation enabled. Set it to exactly '*' to disable validation.");
140
+ return {
141
+ enabled: true,
142
+ origins: configured.filter((o) => o !== "*").map(normalizeOrigin),
143
+ allowAnyLoopback: false,
144
+ };
145
+ }
146
+ return { enabled: true, origins: configured.map(normalizeOrigin), allowAnyLoopback: false };
147
+ }
148
+ if (!LOOPBACK_HOSTS.has(host))
149
+ return VALIDATION_DISABLED;
150
+ return { enabled: true, origins: originOf(publicUrl), allowAnyLoopback: true };
151
+ }
152
+ /**
153
+ * The scheme+host+port of a configured public URL, as a 0- or 1-element list.
154
+ * A server bound to loopback behind a reverse proxy is reached by the browser
155
+ * under that URL, so its origin belongs in the default allow-list — otherwise
156
+ * the documented proxy deployment 403s until the operator discovers
157
+ * `MCP_HTTP_ALLOWED_ORIGINS`.
158
+ */
159
+ function originOf(publicUrl) {
160
+ if (!publicUrl)
161
+ return [];
162
+ try {
163
+ return [normalizeOrigin(new URL(publicUrl).origin)];
164
+ }
165
+ catch {
166
+ return [];
167
+ }
168
+ }
169
+ /** Applies a resolved policy to one `Origin` header value. */
170
+ export function isOriginAllowed(policy, origin) {
171
+ if (!policy.enabled)
172
+ return true;
173
+ const normalized = normalizeOrigin(origin);
174
+ if (policy.origins.includes(normalized))
175
+ return true;
176
+ return policy.allowAnyLoopback && isLoopbackOrigin(normalized);
177
+ }
178
+ /** RFC 9728 §3.2: bare metadata path, plus the resource-path-suffixed variant. */
179
+ const OAUTH_METADATA_PATH = "/.well-known/oauth-protected-resource";
180
+ /**
181
+ * Whether a request targets the public protected-resource metadata document.
182
+ * Shared by the `Origin` exemption and the handler itself so the two cannot
183
+ * drift apart. Takes the raw `req.url` — it runs before the `URL` parse.
184
+ */
185
+ export function isDiscoveryPath(reqUrl, mcpPath) {
186
+ const pathname = (reqUrl ?? "").split("?")[0];
187
+ return pathname === OAUTH_METADATA_PATH || pathname === `${OAUTH_METADATA_PATH}${mcpPath}`;
188
+ }
69
189
  /**
70
190
  * Extracts the hostname (without port) from a Host header. Returns
71
191
  * `undefined` if the header is missing or malformed.
@@ -103,6 +223,7 @@ export function resolveHttpOptions() {
103
223
  sessionSweepIntervalMs: readPositiveInt("MCP_HTTP_SESSION_SWEEP_INTERVAL_MS", DEFAULT_SESSION_SWEEP_INTERVAL_MS),
104
224
  maxSessions: readPositiveInt("MCP_HTTP_MAX_SESSIONS", DEFAULT_MAX_SESSIONS),
105
225
  allowedHosts: readAllowedHosts(),
226
+ allowedOrigins: readAllowedOrigins(),
106
227
  publicUrl: readEnv("MCP_HTTP_PUBLIC_URL"),
107
228
  staticAuth,
108
229
  };
@@ -181,6 +302,7 @@ export async function startHttpTransport(createServerFactory, options) {
181
302
  const sessionSweepIntervalMs = options.sessionSweepIntervalMs ?? DEFAULT_SESSION_SWEEP_INTERVAL_MS;
182
303
  const maxSessions = options.maxSessions ?? DEFAULT_MAX_SESSIONS;
183
304
  const allowedHosts = resolveAllowedHosts(options.allowedHosts, options.host);
305
+ const originPolicy = resolveOriginPolicy(options.allowedOrigins, options.host, options.publicUrl);
184
306
  const resourceUrl = resolveResourceUrl(options);
185
307
  const authorizationServer = resolveAuthorizationServer();
186
308
  const advertisedScopes = resolveAdvertisedScopes();
@@ -192,7 +314,7 @@ export async function startHttpTransport(createServerFactory, options) {
192
314
  const resourceOrigin = resourceUrl.endsWith(options.path)
193
315
  ? resourceUrl.slice(0, resourceUrl.length - options.path.length)
194
316
  : resourceUrl;
195
- const metadataUrl = `${resourceOrigin}/.well-known/oauth-protected-resource${options.path}`;
317
+ const metadataUrl = `${resourceOrigin}${OAUTH_METADATA_PATH}${options.path}`;
196
318
  const wwwAuthenticate = `Bearer realm="${resourceUrl}", resource_metadata="${metadataUrl}"`;
197
319
  const sweepIdleSessions = async () => {
198
320
  const cutoff = Date.now() - sessionTtlMs;
@@ -270,6 +392,23 @@ export async function startHttpTransport(createServerFactory, options) {
270
392
  return;
271
393
  }
272
394
  }
395
+ // Origin validation (MCP 2025-11-25): a browser-initiated request coming
396
+ // from an unexpected origin must be rejected with 403. A *missing* Origin
397
+ // is allowed — non-browser clients (curl, gateways, MCP CLI clients)
398
+ // never send one, and the Host check above already covers DNS rebinding.
399
+ // Like the Host check, this runs after /healthz so probes stay unaffected,
400
+ // and it skips the RFC 9728 discovery document: that document is public,
401
+ // credential-free and read-only, and a browser client only fetches it
402
+ // *because* we pointed it there from a 401 challenge — 403ing it would
403
+ // dead-end the OAuth bootstrap the challenge just started.
404
+ if (originPolicy.enabled && !isDiscoveryPath(req.url, options.path)) {
405
+ const originHeader = req.headers.origin;
406
+ const origin = Array.isArray(originHeader) ? originHeader[0] : originHeader;
407
+ if (origin && !isOriginAllowed(originPolicy, origin)) {
408
+ writeJsonRpcError(res, 403, `Invalid Origin: ${origin}`);
409
+ return;
410
+ }
411
+ }
273
412
  // Reject oversized payloads up front when the client advertises the
274
413
  // length, before buffering anything. The streaming guard in
275
414
  // readJsonBody still covers chunked / lying Content-Length cases.
@@ -282,10 +421,7 @@ export async function startHttpTransport(createServerFactory, options) {
282
421
  // Public OAuth2 discovery endpoint (RFC 9728). Not served in static-auth
283
422
  // mode — exposing it would cause OAuth-aware clients (mcp-remote, etc.)
284
423
  // to attempt a full OAuth dance that will never complete.
285
- if (!options.staticAuth &&
286
- req.method === "GET" &&
287
- (url.pathname === "/.well-known/oauth-protected-resource" ||
288
- url.pathname === `/.well-known/oauth-protected-resource${options.path}`)) {
424
+ if (!options.staticAuth && req.method === "GET" && isDiscoveryPath(url.pathname, options.path)) {
289
425
  writeProtectedResourceMetadata(res);
290
426
  return;
291
427
  }