@cyanheads/browser-compat-mcp-server 0.1.5 → 0.2.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.
Files changed (66) hide show
  1. package/AGENTS.md +10 -9
  2. package/CLAUDE.md +10 -9
  3. package/Dockerfile +77 -51
  4. package/README.md +30 -18
  5. package/THIRD_PARTY_NOTICES.md +5 -5
  6. package/changelog/0.2.x/0.2.0.md +40 -0
  7. package/changelog/0.2.x/0.2.1.md +41 -0
  8. package/dist/index.js +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.d.ts +4 -1
  11. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.d.ts.map +1 -1
  12. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.js +62 -30
  13. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.js.map +1 -1
  14. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.d.ts +75 -3
  15. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.js +422 -106
  17. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.d.ts +55 -13
  19. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.js +129 -32
  21. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.js +7 -6
  24. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.d.ts.map +1 -1
  26. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.js +38 -23
  27. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.js.map +1 -1
  28. package/dist/mcp-server/tools/definitions/compat-shapes.d.ts +128 -16
  29. package/dist/mcp-server/tools/definitions/compat-shapes.d.ts.map +1 -1
  30. package/dist/mcp-server/tools/definitions/compat-shapes.js +193 -34
  31. package/dist/mcp-server/tools/definitions/compat-shapes.js.map +1 -1
  32. package/dist/services/baseline/baseline-service.d.ts +11 -3
  33. package/dist/services/baseline/baseline-service.d.ts.map +1 -1
  34. package/dist/services/baseline/baseline-service.js +29 -2
  35. package/dist/services/baseline/baseline-service.js.map +1 -1
  36. package/dist/services/baseline/types.d.ts +11 -0
  37. package/dist/services/baseline/types.d.ts.map +1 -1
  38. package/dist/services/bcd/bcd-service.d.ts +33 -12
  39. package/dist/services/bcd/bcd-service.d.ts.map +1 -1
  40. package/dist/services/bcd/bcd-service.js +201 -87
  41. package/dist/services/bcd/bcd-service.js.map +1 -1
  42. package/dist/services/bcd/bcd-text.d.ts +11 -0
  43. package/dist/services/bcd/bcd-text.d.ts.map +1 -0
  44. package/dist/services/bcd/bcd-text.js +127 -0
  45. package/dist/services/bcd/bcd-text.js.map +1 -0
  46. package/dist/services/bcd/types.d.ts +29 -4
  47. package/dist/services/bcd/types.d.ts.map +1 -1
  48. package/dist/services/data-version/data-version-service.d.ts.map +1 -1
  49. package/dist/services/data-version/data-version-service.js +4 -3
  50. package/dist/services/data-version/data-version-service.js.map +1 -1
  51. package/dist/services/search/search-service.d.ts +21 -7
  52. package/dist/services/search/search-service.d.ts.map +1 -1
  53. package/dist/services/search/search-service.js +117 -42
  54. package/dist/services/search/search-service.js.map +1 -1
  55. package/dist/services/targets/targets-service.d.ts +11 -6
  56. package/dist/services/targets/targets-service.d.ts.map +1 -1
  57. package/dist/services/targets/targets-service.js +12 -7
  58. package/dist/services/targets/targets-service.js.map +1 -1
  59. package/dist/services/targets/types.d.ts +9 -2
  60. package/dist/services/targets/types.d.ts.map +1 -1
  61. package/dist/utils/markdown-text.d.ts +11 -0
  62. package/dist/utils/markdown-text.d.ts.map +1 -0
  63. package/dist/utils/markdown-text.js +57 -0
  64. package/dist/utils/markdown-text.js.map +1 -0
  65. package/package.json +15 -15
  66. package/server.json +10 -24
package/AGENTS.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** browser-compat-mcp-server
4
- **Version:** 0.1.5
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.9`
4
+ **Version:** 0.2.1
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.15`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
- **MCP SDK:** `@modelcontextprotocol/server` ^2.1.0
8
- **Zod:** ^4.6.5
7
+ **MCP SDK:** `@modelcontextprotocol/server` ^2.3.1
8
+ **Zod:** ^4.6.7
9
9
 
10
10
  > **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
11
11
 
@@ -208,11 +208,12 @@ Handlers receive a unified `ctx` object. Key properties:
208
208
  | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
209
209
  | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any JSON-serializable value; reads return its JSON form (a `Date` comes back as an ISO string). |
210
210
  | `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
211
- | `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
211
+ | `ctx.inputs` | The request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped` — limited to what the client declared (`elicitation` and its form/url modes, `sampling`, `roots`). Client-supplied: a consent gate trusts only a `ctx.state` record it stored when it asked, bound to the operation, caller, and target (see the `api-context` skill). |
212
+ | `ctx.clientCapabilities` | What the client declared for this request, `undefined` when no view exists. Decides whether to ask for optional context (e.g. roots); never a reason to skip a consent prompt. |
212
213
  | `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
213
214
  | `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
214
215
  | `ctx.signal` | `AbortSignal` for cancellation. |
215
- | `ctx.requestId` | Unique request ID. |
216
+ | `ctx.requestId` | Request ID — the one every log record of the call carries and its error envelope returns as `data.requestId`. |
216
217
  | `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
217
218
 
218
219
  ---
@@ -221,7 +222,7 @@ Handlers receive a unified `ctx` object. Key properties:
221
222
 
222
223
  Handlers throw — the framework catches, classifies, and formats.
223
224
 
224
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Forwarding it is lint-enforced per throw site (`error-contract-recovery-unforwarded`). Mark an entry the service layer throws with `thrownBy: 'service'` so `error-contract-unthrown` skips it — lint-only metadata, nothing at runtime reads it. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
225
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. The framework puts it on the wire whenever a failure carrying that `reason` arrives without a hint — a bare `ctx.fail('reason')` or a service throw with `data: { reason }` — as `data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim; override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Every error envelope also carries `data.requestId`, the id the server's log records for that call carry, and `content[]` closes with `(reason … · request <id>)`. Mark an entry the service layer throws with `thrownBy: 'service'` so `error-contract-unthrown` skips it — lint-only metadata, nothing at runtime reads it. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
225
226
 
226
227
  ```ts
227
228
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -233,7 +234,7 @@ errors: [
233
234
  ],
234
235
  async handler(input, ctx) {
235
236
  const item = await db.find(input.id);
236
- if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
237
+ if (!item) throw ctx.fail('no_match', `No item ${input.id}`);
237
238
  return item;
238
239
  }
239
240
  ```
@@ -415,7 +416,7 @@ security: false # optional — true ONLY for a source
415
416
 
416
417
  ## Publishing
417
418
 
418
- **Every release goes through a release PR, straight-through** — `git-wrapup`'s "Release PR mode", mode `straight-through`. One run: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-and-publish` then fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. A caller's brief may run a given release as `gated` instead — a `release-pr-review` pass on the open PR before `release-and-publish`. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
419
+ **Every release goes through a release PR, straight-through** — `git-wrapup`'s "Release PR mode", mode `straight-through`. One run: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the release digest: theme line, `## Changes`, `## Gates`, changelog link last); `release-and-publish` then fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. A caller's brief may run a given release as `gated` instead — a `release-pr-review` pass on the open PR before `release-and-publish`. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
419
420
 
420
421
  ---
421
422
 
package/CLAUDE.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** browser-compat-mcp-server
4
- **Version:** 0.1.5
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.9`
4
+ **Version:** 0.2.1
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.15`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
- **MCP SDK:** `@modelcontextprotocol/server` ^2.1.0
8
- **Zod:** ^4.6.5
7
+ **MCP SDK:** `@modelcontextprotocol/server` ^2.3.1
8
+ **Zod:** ^4.6.7
9
9
 
10
10
  > **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
11
11
 
@@ -208,11 +208,12 @@ Handlers receive a unified `ctx` object. Key properties:
208
208
  | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
209
209
  | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any JSON-serializable value; reads return its JSON form (a `Date` comes back as an ISO string). |
210
210
  | `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
211
- | `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
211
+ | `ctx.inputs` | The request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped` — limited to what the client declared (`elicitation` and its form/url modes, `sampling`, `roots`). Client-supplied: a consent gate trusts only a `ctx.state` record it stored when it asked, bound to the operation, caller, and target (see the `api-context` skill). |
212
+ | `ctx.clientCapabilities` | What the client declared for this request, `undefined` when no view exists. Decides whether to ask for optional context (e.g. roots); never a reason to skip a consent prompt. |
212
213
  | `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
213
214
  | `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
214
215
  | `ctx.signal` | `AbortSignal` for cancellation. |
215
- | `ctx.requestId` | Unique request ID. |
216
+ | `ctx.requestId` | Request ID — the one every log record of the call carries and its error envelope returns as `data.requestId`. |
216
217
  | `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
217
218
 
218
219
  ---
@@ -221,7 +222,7 @@ Handlers receive a unified `ctx` object. Key properties:
221
222
 
222
223
  Handlers throw — the framework catches, classifies, and formats.
223
224
 
224
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Forwarding it is lint-enforced per throw site (`error-contract-recovery-unforwarded`). Mark an entry the service layer throws with `thrownBy: 'service'` so `error-contract-unthrown` skips it — lint-only metadata, nothing at runtime reads it. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
225
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. The framework puts it on the wire whenever a failure carrying that `reason` arrives without a hint — a bare `ctx.fail('reason')` or a service throw with `data: { reason }` — as `data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim; override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Every error envelope also carries `data.requestId`, the id the server's log records for that call carry, and `content[]` closes with `(reason … · request <id>)`. Mark an entry the service layer throws with `thrownBy: 'service'` so `error-contract-unthrown` skips it — lint-only metadata, nothing at runtime reads it. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
225
226
 
226
227
  ```ts
227
228
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -233,7 +234,7 @@ errors: [
233
234
  ],
234
235
  async handler(input, ctx) {
235
236
  const item = await db.find(input.id);
236
- if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
237
+ if (!item) throw ctx.fail('no_match', `No item ${input.id}`);
237
238
  return item;
238
239
  }
239
240
  ```
@@ -415,7 +416,7 @@ security: false # optional — true ONLY for a source
415
416
 
416
417
  ## Publishing
417
418
 
418
- **Every release goes through a release PR, straight-through** — `git-wrapup`'s "Release PR mode", mode `straight-through`. One run: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-and-publish` then fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. A caller's brief may run a given release as `gated` instead — a `release-pr-review` pass on the open PR before `release-and-publish`. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
419
+ **Every release goes through a release PR, straight-through** — `git-wrapup`'s "Release PR mode", mode `straight-through`. One run: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the release digest: theme line, `## Changes`, `## Gates`, changelog link last); `release-and-publish` then fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. A caller's brief may run a given release as `gated` instead — a `release-pr-review` pass on the open PR before `release-and-publish`. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
419
420
 
420
421
  ---
421
422
 
package/Dockerfile CHANGED
@@ -5,16 +5,16 @@
5
5
  # source code into JavaScript, and prepares the production assets.
6
6
  #
7
7
  # Pinned to $BUILDPLATFORM rather than the target platform: `bun run build` emits
8
- # JavaScript, and only `dist/` crosses into the production stage, which runs its
9
- # own target-arch install. Built for the target instead, the non-native leg of a
10
- # `--platform linux/amd64,linux/arm64` build runs under QEMU, where bun >= 1.4
11
- # aborts with a JavaScriptCore allocator assertion and fails the multi-arch push.
8
+ # JavaScript, and only `dist/` crosses into the production stage. Built for the
9
+ # target instead, the non-native leg of a `--platform linux/amd64,linux/arm64`
10
+ # build runs under QEMU, where bun >= 1.4 aborts with a JavaScriptCore allocator
11
+ # assertion and fails the multi-arch push.
12
12
  #
13
13
  # The constraint this assumes: the build stage produces platform-independent
14
14
  # output. A stage that compiles a native addon needs the target-arch toolchain
15
15
  # and cannot cross-compile this way — drop the flag there.
16
16
  # ==============================================================================
17
- FROM --platform=$BUILDPLATFORM oven/bun:1.4.2 AS build
17
+ FROM --platform=$BUILDPLATFORM oven/bun:1.4.3 AS build
18
18
 
19
19
  WORKDIR /usr/src/app
20
20
 
@@ -34,80 +34,106 @@ RUN bun run build
34
34
 
35
35
 
36
36
  # ==============================================================================
37
- # Production Stage
37
+ # Production Dependencies Stage
38
38
  #
39
- # This stage creates a minimal, optimized, and secure image for running the
40
- # application. It uses a slim base image and only includes production
41
- # dependencies and build artifacts.
39
+ # Installs the production dependency tree for the target platform. Every step
40
+ # here can run JavaScript — bunfig.toml's security scanner runs as a Bun
41
+ # program, and so do the OTel and musl-prune scripts — so the stage runs on
42
+ # $BUILDPLATFORM and cross-installs with `--os`/`--cpu`, which pick each
43
+ # platform-specific optional dependency (native bindings such as DuckDB's) for
44
+ # the target. Only `node_modules` leaves this stage.
45
+ #
46
+ # A clean image rather than `FROM build`: the build stage's node_modules holds
47
+ # devDependencies.
42
48
  # ==============================================================================
43
- FROM oven/bun:1.4.2-slim AS production
49
+ FROM --platform=$BUILDPLATFORM oven/bun:1.4.3 AS deps
44
50
 
45
51
  WORKDIR /usr/src/app
46
52
 
47
- # Set the environment to production for performance and to ensure only
48
- # production dependencies are installed.
49
- ENV NODE_ENV=production
50
-
51
- # OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
52
- ARG APP_VERSION
53
- LABEL org.opencontainers.image.title="browser-compat-mcp-server"
54
- LABEL org.opencontainers.image.description="Browser compatibility and Baseline status for any web feature — offline, from MDN's browser-compat-data, web-features, and caniuse."
55
- LABEL org.opencontainers.image.licenses="Apache-2.0"
56
- LABEL org.opencontainers.image.version="${APP_VERSION}"
57
- LABEL org.opencontainers.image.source="https://github.com/cyanheads/browser-compat-mcp-server"
58
-
59
53
  # Copy dependency manifests. `bunfig.toml` rides along so every install below
60
54
  # passes its release-age gate and security scanner, as a local install does.
61
55
  COPY package.json bun.lock bunfig.toml ./
62
56
 
63
57
  # The scanner bunfig.toml names is a devDependency, and Bun installs a missing
64
58
  # scanner through the same production-filtered install, which omits it and
65
- # aborts. Seed it from the build stage's full install instead. Remove this line
66
- # together with the scanner if bunfig.toml stops naming one.
59
+ # aborts. Seed it from the build stage's full install instead. Remove this line,
60
+ # and the `rm` at the end of this stage, if bunfig.toml stops naming a scanner.
67
61
  COPY --from=build /usr/src/app/node_modules/@socketsecurity/bun-security-scanner ./node_modules/@socketsecurity/bun-security-scanner
68
62
 
63
+ # Docker names the target architecture `amd64`/`arm64`; Bun's `--cpu` takes
64
+ # `x64`/`arm64`. Mapped once here, read by both installs below. `oven/bun`
65
+ # publishes only these two architectures, so any other target fails here.
66
+ ARG TARGETOS
67
+ ARG TARGETARCH
68
+ RUN case "$TARGETARCH" in \
69
+ amd64) echo x64 ;; \
70
+ arm64) echo arm64 ;; \
71
+ *) echo "Unsupported TARGETARCH '$TARGETARCH': expected amd64 or arm64" >&2; exit 1 ;; \
72
+ esac > .bun-cpu
73
+
69
74
  # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
70
75
  # that are not needed in the final production image.
71
76
  # `--omit=peer` drops the framework's optional peer tiers (test runner, service
72
77
  # SDKs, parsers) that Bun would otherwise auto-install. Anything this server
73
78
  # actually imports belongs in its own `dependencies`, so nothing needed at
74
- # runtime is lost. The OTEL step below carries the same flag — without it, that
75
- # install re-resolves the graph and pulls every optional peer back in.
79
+ # runtime is lost.
76
80
  RUN --mount=type=cache,target=/root/.bun/install/cache \
77
- bun install --production --omit=peer --frozen-lockfile --ignore-scripts
81
+ bun install --production --omit=peer --frozen-lockfile --ignore-scripts \
82
+ --os="$TARGETOS" --cpu="$(cat .bun-cpu)"
78
83
 
79
84
  # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
80
85
  # Installed by default. Omit them for a leaner image at build time
81
86
  # with: docker build --build-arg OTEL_ENABLED=false
82
- # Each package is requested at the range the installed framework declares in
83
- # `peerDependencies`, so the resolution stays inside the framework's tested
84
- # peer range; a name with no declared range fails the build.
87
+ # The script reads the list and each range from the installed framework's
88
+ # `peerDependencies` and passes the target flags on to its `bun install`.
89
+ COPY scripts/install-otel.ts ./scripts/
85
90
  ARG OTEL_ENABLED=true
86
91
  RUN --mount=type=cache,target=/root/.bun/install/cache \
87
92
  if [ "$OTEL_ENABLED" = "true" ]; then \
88
- specs=$(bun -e ' \
89
- const { peerDependencies: peers } = await Bun.file("node_modules/@cyanheads/mcp-ts-core/package.json").json(); \
90
- const names = process.argv.slice(1); \
91
- const missing = names.filter((name) => !peers?.[name]); \
92
- if (missing.length > 0) throw new Error(`no peerDependencies range for ${missing.join(", ")}`); \
93
- console.log(names.map((name) => `${name}@${peers[name]}`).join(" ")); \
94
- ' \
95
- @hono/otel \
96
- @opentelemetry/api-logs \
97
- @opentelemetry/exporter-logs-otlp-http \
98
- @opentelemetry/exporter-metrics-otlp-http \
99
- @opentelemetry/exporter-trace-otlp-http \
100
- @opentelemetry/instrumentation-http \
101
- @opentelemetry/instrumentation-pino \
102
- @opentelemetry/resources \
103
- @opentelemetry/sdk-logs \
104
- @opentelemetry/sdk-metrics \
105
- @opentelemetry/sdk-node \
106
- @opentelemetry/sdk-trace-node \
107
- @opentelemetry/semantic-conventions) \
108
- && bun add --omit=dev --omit=peer --ignore-scripts $specs; \
93
+ bun scripts/install-otel.ts --os="$TARGETOS" --cpu="$(cat .bun-cpu)"; \
109
94
  fi
110
95
 
96
+ # `--os`/`--cpu` have no libc counterpart, so a native dependency published in
97
+ # glibc and musl variants (DuckDB's bindings, for one) installs both. The
98
+ # runtime image is Debian (glibc) and never loads the musl copy; the script
99
+ # deletes every package whose own `libc` admits only musl. It follows every
100
+ # install, since a later `bun install` restores what it removes. A server on a
101
+ # musl (Alpine) runtime image drops these two lines.
102
+ COPY scripts/prune-musl-packages.ts ./scripts/
103
+ RUN bun scripts/prune-musl-packages.ts
104
+
105
+ # The seeded scanner served only the installs above; keep it out of the image.
106
+ RUN rm -rf node_modules/@socketsecurity/bun-security-scanner
107
+
108
+
109
+ # ==============================================================================
110
+ # Production Stage
111
+ #
112
+ # This stage creates a minimal, optimized, and secure image for running the
113
+ # application. It uses a slim base image and only includes production
114
+ # dependencies and build artifacts. Its only Bun invocations are HEALTHCHECK
115
+ # and CMD, which run on the real target at container start.
116
+ # ==============================================================================
117
+ FROM oven/bun:1.4.3-slim AS production
118
+
119
+ WORKDIR /usr/src/app
120
+
121
+ # Set the environment to production for performance.
122
+ ENV NODE_ENV=production
123
+
124
+ # OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
125
+ ARG APP_VERSION
126
+ LABEL org.opencontainers.image.title="browser-compat-mcp-server"
127
+ LABEL org.opencontainers.image.description="Browser compatibility and Baseline status for any web feature — offline, from MDN's browser-compat-data, web-features, and caniuse."
128
+ LABEL org.opencontainers.image.licenses="Apache-2.0"
129
+ LABEL org.opencontainers.image.version="${APP_VERSION}"
130
+ LABEL org.opencontainers.image.source="https://github.com/cyanheads/browser-compat-mcp-server"
131
+
132
+ # The manifest comes from the build context: the deps stage's copy was rewritten
133
+ # by the OTel install, and the runtime reads only its name, version, and type.
134
+ COPY package.json ./
135
+ COPY --from=deps /usr/src/app/node_modules ./node_modules
136
+
111
137
  # Copy the compiled application code from the build stage
112
138
  COPY --from=build /usr/src/app/dist ./dist
113
139
 
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![npm](https://img.shields.io/npm/v/@cyanheads/browser-compat-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/browser-compat-mcp-server) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.1.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![Bun](https://img.shields.io/badge/Bun-v1.4.2%2B-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![npm](https://img.shields.io/npm/v/@cyanheads/browser-compat-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/browser-compat-mcp-server) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.3.1-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![Bun](https://img.shields.io/badge/Bun-v1.4.3%2B-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -37,9 +37,9 @@ Web platform compatibility for frontend work: per-browser support from MDN's `@m
37
37
  |:---|:---|
38
38
  | `browsercompat_list_reference` | Enumerate the reference vocabulary the other tools expect — BCD namespaces and browser ids, browserslist agents, Baseline states, groups, and ECMAScript snapshots. |
39
39
  | `browsercompat_get_feature` | Full compatibility record for one feature: Baseline state, standards status, per-browser versions with flags and prefixes, MDN and specification links. |
40
- | `browsercompat_check_baseline` | Ship-or-not across up to 20 features: Baseline state and date, the limiting browser, deprecation flags, and the traffic share requiring it would exclude. |
40
+ | `browsercompat_check_baseline` | Ship-or-not across up to 20 features per call: Baseline state and date, the limiting browser, deprecation flags, and the traffic share requiring it would exclude. |
41
41
  | `browsercompat_search_features` | Find features by plain name, keyword, or code notation when the canonical key is unknown, ranked with the field that matched, filterable by group or ECMAScript snapshot, and pageable. |
42
- | `browsercompat_compare_support` | Check features against an explicit browserslist target query, reporting the failing target per feature and every target that could not be evaluated. |
42
+ | `browsercompat_compare_support` | Check features against an explicit browserslist target query: a whole-query verdict, evaluated coverage, and failing version runs per feature, with the failing and unevaluated target rows paged ten query targets at a time. |
43
43
 
44
44
  ---
45
45
 
@@ -54,17 +54,23 @@ Web platform compatibility for frontend work: per-browser support from MDN's `@m
54
54
 
55
55
  ### `browsercompat_get_feature` <sub>tool</sub>
56
56
 
57
- - One `feature`, 1–200 characters: a BCD key (`css.selectors.has`) or web-features id (`has`). `resolve: true` accepts a name or notation only when the best exact matches name one feature: one key resolves directly, several keys of one feature return `compat_keys`, and two features are a miss. Off by default.
58
- - `outcome` is `found`, `no_compat_data`, or `miss`; `resolved_as` records the match. A miss returns `found: false` with `guidance`. A multi-key id omits `support`, `status`, `limiting_browser`, `mdn_url`, and `spec_urls`; use `compat_keys` for a specific call. Whitespace-only input returns `invalid_feature_input`.
57
+ - One `feature`, 1–200 characters: a BCD key (`css.selectors.has`) or web-features id (`has`). `resolve: true` accepts a name or notation only when the best exact matches name one feature: one key resolves directly, several keys of one feature return its `feature_support` and `compat_keys`, and two features are a miss. Off by default.
58
+ - `outcome` is `found`, `no_compat_data`, or `miss`; `resolved_as` records the match. A miss returns `found: false` with `guidance`. Whitespace-only input returns `invalid_feature_input`.
59
+ - A multi-key id such as `grid` omits `support`, `status`, `mdn_url`, and `spec_urls`, keeps `compat_keys`, and adds `feature_support`: one row per Baseline core browser, `{ browser_id, supported, version?, version_is_upper_bound? }`, relaying the release web-features lists for the feature as a whole. That is web-features' answer for the feature, not a combination of its keys, and a key can differ either way — `a` lists Chrome 1 while `html.elements.a.href.href_sms` is unsupported there. Call with one of `compat_keys` for a key-level answer.
60
+ - `compat_keys` holds at most 100 keys in declaration order, with `compat_keys_total` counting all of them (`svg` owns 614). Continue with `compat_keys_offset` (integer ≥0, default 0) while `compat_keys_next_offset` is present; a zero-key id returns `compat_keys: []` and `compat_keys_total: 0`.
61
+ - Each `support` row reports the statement behind its verdict at the browser's newest release and lists every other statement BCD records for that browser in `other_statements`, in BCD order with notes and links — Safari's `backdrop-filter` row is supported since 18 and lists `{ version_added: "9", prefix: "-webkit-" }`.
59
62
  - `include_runtimes: true` adds `bun`, `deno`, `nodejs`, and `oculus` support to the 13 desktop and mobile browser rows.
63
+ - Feature-level `discouraged` is independent of BCD `status`; `status.discouraged` remains a compatibility alias when status exists. Unsupported and preview-only rows retain their available notes and tracking links.
64
+ - `limiting_browser` is the Baseline core browser whose required release is newest by release date. For a key it appears only when every core browser has full, unprefixed, unflagged support at a resolvable added release; for a multi-key id, only when `feature_support` lists all seven. `version` is the release; `version_is_upper_bound: true` marks a `≤` bound, where support arrived at or before that release.
65
+ - A key with direct callable children returns `subkeys: { total, keys, truncated, next_offset? }`, at most 100 at a time. Continue with `subkeys_offset` (integer ≥0, default 0). Call one child with this tool or up to 20 with `browsercompat_check_baseline`; grandchildren and structural nodes are excluded.
60
66
 
61
67
  ---
62
68
 
63
69
  ### `browsercompat_check_baseline` <sub>tool</sub>
64
70
 
65
- - Up to 20 BCD keys or web-features ids, 1–200 characters each, with one result per entry in input order. A whitespace-only entry returns `invalid_feature_input`.
66
- - Results carry Baseline state and dates, `limiting_browser`, `deprecated`, `experimental`, `discouraged`, and `usage_percent_excluded` with its `usage_source`. Usage is absent, never zero, when no caniuse id exists.
67
- - `all_widely_available` requires every entry to resolve at `widely`; one miss makes it false, and it does not assess deprecation.
71
+ - BCD keys or web-features ids, 1–200 characters each. The first 20 are evaluated, one result per entry in input order; up to 100 are accepted, and entries past the 20th come back verbatim in `omitted_features` for the next call. More than 100 entries is rejected; a whitespace-only entry anywhere returns `invalid_feature_input`.
72
+ - Results carry Baseline state and dates, `limiting_browser` under the conditions above (from web-features' feature-level support for a multi-key id, which keeps its first 10 `compat_keys` and `compat_keys_total`), `deprecated`, `experimental`, and `discouraged`. `usage_percent_excluded` and `usage_source` describe the caniuse feature: a BCD key receives them only when it is the feature's sole declared compat key. Usage is absent when the scope differs or caniuse data is missing, never a fabricated zero.
73
+ - `all_widely_available` requires every entry to resolve at `widely`; one miss or any `omitted_features` entry makes it false, and it does not assess deprecation.
68
74
 
69
75
  ---
70
76
 
@@ -72,15 +78,20 @@ Web platform compatibility for frontend work: per-browser support from MDN's `@m
72
78
 
73
79
  - `query`, 1–100 characters, accepts names, keywords, or notation such as `Array.prototype.at`, `display: grid`, or `<dialog>`. Combine `namespace` (12 BCD namespaces), `baseline` (`widely`, `newly`, `limited`, `not_mapped`), `group` (including nested groups), and `snapshot` (such as `ecmascript-2023`).
74
80
  - `matched_on` explains the six-tier ranking; `path_suffix` marks trailing key segments matching the supplied notation. `support_summary` covers the seven Baseline core browsers (`—` unsupported, `?` unknown). Typed failures: `invalid_query` (zero searchable tokens), `unknown_group`, `unknown_snapshot`.
75
- - Page with `limit` (1–50, default 10) and `offset` (default 0); `totalCount` counts all matches and `nextOffset` appears while more remain. Zero hits succeed with a notice naming which filter to drop; an offset past the matches returns an empty page with a notice.
81
+ - Page with `limit` (default 10, at most 50 per call; 51–1000 is served as 50 and reported in `cap`) and `offset` (default 0); `totalCount` counts all matches and `nextOffset` appears while more remain. Zero hits succeed with a notice naming which filter to drop; an offset past the matches returns an empty page with a notice.
76
82
 
77
83
  ---
78
84
 
79
85
  ### `browsercompat_compare_support` <sub>tool</sub>
80
86
 
81
- - Up to 20 features against a required `targets` browserslist query, such as `defaults` or `> 0.5%, last 2 versions`; local browserslist config is never used. Typed failures: `invalid_target_query`, `no_targets_resolved`, `invalid_feature_input`.
82
- - Each `verdict` is `clears`, `fails`, `inconclusive`, `miss`, or `ambiguous`. `failing_targets` names targets with `partial`, `prefixed`, `flagged`, `removed`, `unsupported`, or `preview_only` support.
83
- - `unchecked_targets` carries `no_bcd_browser`, `unknown_version`, or `no_bcd_data`; `all_clear` requires it to be empty. The response also includes caniuse-derived `target_coverage_percent` and `unchecked_coverage_percent`.
87
+ - Up to 20 features per call against a required `targets` browserslist query, such as `defaults` or `> 0.5%, last 2 versions`; local browserslist config is never used. Up to 100 features are accepted: entries past the 20th come back verbatim in `omitted_features`, which also makes `all_clear` false. Typed failures: `invalid_target_query`, `no_targets_resolved`, `invalid_feature_input`.
88
+ - Every call evaluates the whole query. Each `verdict` is `clears`, `fails`, `inconclusive`, `miss`, or `ambiguous`: `fails` when any evaluated target lacks support, `clears` only when every target in the query was evaluated and supports the feature, `inconclusive` otherwise; `ambiguous` is an id that owns no BCD keys. A query that includes a browser with no compatibility data, as `defaults` does, never clears. `all_clear` is true only when every feature clears.
89
+ - Each compared result names its `support_source`. `bcd_key` judges a key's per-browser support. `web_features_feature` judges a multi-key id such as `grid` on the release web-features lists for the feature as a whole in each Baseline core browser, keeps its first 10 `compat_keys` with `compat_keys_total`, and leaves every other browser unevaluated — `grid` on `defaults` evaluates 24 of 35 targets.
90
+ - A target counts as evaluated only where compatibility data was read for it. Each compared result carries `failing_total`, `failing_ranges`, `evaluated_total`, `evaluated_coverage_percent`, `unchecked_total`, and `unchecked_coverage_percent`. The top level carries `comparable_features`, `targets_resolved_total`, `evaluated_targets_total`, `unchecked_targets_total`, and the caniuse-derived `target_coverage_percent` and `unchecked_coverage_percent`: the share covered by the targets evaluated for every compared feature, and by the rest of the query.
91
+ - Target rows are paged with `target_offset` (integer ≥0, default 0) and `target_limit` (default 10, at most 10 per call; 11–1000 is served as 10 and reported in `cap`). `targets_resolved` (the mapping inventory, each row flagged `evaluated`), `unchecked_targets`, and each result's `failing_targets` and `unchecked_targets` cover only the query targets on the page; verdicts, coverage, and totals are identical on every page. `totalCount` counts the targets in the query and `nextOffset` appears while more remain; an offset past the end returns the summaries with no rows and a notice.
92
+ - `failing_targets` names targets with `partial`, `prefixed`, `flagged`, `removed`, `unsupported`, or `preview_only` support, or — on web-features' feature-level support — `before_feature_support` (the target predates the listed release) or `no_feature_support` (no release listed for that core browser). A row judged on a key also carries the fields of the statement behind its verdict, each only when present: `backdrop-filter` on `safari 15` fails as `prefixed` with `version_added: "9"` and `prefix: "-webkit-"`, and a `flagged` row names its `flags`.
93
+ - `failing_ranges` lists every failing target of a result across the whole query as runs `{ agent, newest, oldest, count, verdict }`: consecutive query targets of one agent failing with one verdict, in query order. A run breaks at any target that passed or was not evaluated, the counts sum to `failing_total`, and the list is the same on every page — `Array.fromAsync` on `defaults` gives `chrome 120` to `109` (2) and `op_mob 80` (1) on all four pages.
94
+ - `unchecked_targets` carries `no_bcd_browser`, `unknown_version`, `no_bcd_data`, `no_feature_level_data` (a non-core browser, or a release before a `≤` bound, under feature-level support), or `no_comparable_feature` — the last when every entry was a miss or ambiguous, so nothing was compared.
84
95
 
85
96
  ---
86
97
 
@@ -88,12 +99,12 @@ Web platform compatibility for frontend work: per-browser support from MDN's `@m
88
99
 
89
100
  | Package | Version | License | Supplies |
90
101
  |:---|:---|:---|:---|
91
- | [`@mdn/browser-compat-data`](https://github.com/mdn/browser-compat-data) | `^8.1.2` | CC0-1.0 | Per-browser support, standards status, MDN and specification links |
92
- | [`web-features`](https://github.com/web-platform-dx/web-features) | `^3.39.0` | Apache-2.0 | Baseline state and dates, discouraged flags, groups, ECMAScript snapshots |
93
- | [`caniuse-lite`](https://github.com/browserslist/caniuse-lite) | `^1.0.30001810` | CC-BY-4.0 | Usage weighting, plus feature titles for the search index |
94
- | [`browserslist`](https://github.com/browserslist/browserslist) | `^4.29.0` | MIT | Target query resolution and coverage figures |
102
+ | [`@mdn/browser-compat-data`](https://github.com/mdn/browser-compat-data) | `^8.1.5` | CC0-1.0 | Per-browser support, standards status, MDN and specification links |
103
+ | [`web-features`](https://github.com/web-platform-dx/web-features) | `^3.42.0` | Apache-2.0 | Baseline state and dates, feature-level core-browser support, discouraged flags, groups, ECMAScript snapshots |
104
+ | [`caniuse-lite`](https://github.com/browserslist/caniuse-lite) | `^1.0.30001815` | CC-BY-4.0 | Usage weighting, plus feature titles for the search index |
105
+ | [`browserslist`](https://github.com/browserslist/browserslist) | `^4.29.3` | MIT | Target query resolution and coverage figures |
95
106
 
96
- CC BY 4.0 requires attribution wherever the caniuse data travels, so every response carrying a usage figure carries this string: `Usage data from caniuse.com, © Can I Use contributors, CC BY 4.0. Figures are a share of the ~96.7% of global traffic caniuse tracks.` Full license texts and notices are in [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md).
107
+ CC BY 4.0 requires attribution wherever the caniuse data travels, so every response carrying a usage figure carries this string: `Usage data from caniuse.com, © Can I Use contributors, CC BY 4.0. Figures are a share of the ~97.3% of global traffic caniuse tracks.` Full license texts and notices are in [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md).
97
108
 
98
109
  ---
99
110
 
@@ -111,9 +122,10 @@ Browser-compat-specific:
111
122
  Agent-friendly output:
112
123
 
113
124
  - Every response echoes `data_version` — the version of each bundled dataset behind the answer, since a pinned snapshot goes stale on exactly the newest features
114
- - A verdict is never claimed for a browser that was not evaluated: unknown support moves the target into `unchecked_targets` and the feature to `inconclusive`
125
+ - A pass is never claimed for a browser that was not evaluated: a feature clears a target query only when compatibility data was read for every target in it, and a target without data is reported in `unchecked_targets` and makes the verdict `inconclusive`
115
126
  - Misses are results, not failures — `found: false` with `guidance` naming the next call, and typed error reasons carrying recovery hints for the input a caller has to fix
116
127
  - Usage figures state the population they are a share of, and carry the caniuse attribution on every response that reports one
128
+ - BCD markup becomes plain text with anchor labels and URLs preserved. Markdown renders literal names such as `<dialog>` visibly; structured text keeps the original plain-text element names.
117
129
 
118
130
  ---
119
131
 
@@ -6,10 +6,10 @@ attribution those datasets require.
6
6
 
7
7
  | Dataset | Version range | License | Source |
8
8
  |:--------|:--------------|:--------|:-------|
9
- | `@mdn/browser-compat-data` | ^8.1.2 | CC0-1.0 | https://github.com/mdn/browser-compat-data |
10
- | `web-features` | ^3.39.0 | Apache-2.0 | https://github.com/web-platform-dx/web-features |
11
- | `caniuse-lite` | ^1.0.30001810 | CC-BY-4.0 | https://github.com/browserslist/caniuse-lite |
12
- | `browserslist` | ^4.29.0 | MIT | https://github.com/browserslist/browserslist |
9
+ | `@mdn/browser-compat-data` | ^8.1.5 | CC0-1.0 | https://github.com/mdn/browser-compat-data |
10
+ | `web-features` | ^3.42.0 | Apache-2.0 | https://github.com/web-platform-dx/web-features |
11
+ | `caniuse-lite` | ^1.0.30001815 | CC-BY-4.0 | https://github.com/browserslist/caniuse-lite |
12
+ | `browserslist` | ^4.29.3 | MIT | https://github.com/browserslist/browserslist |
13
13
 
14
14
  Every tool response echoes the exact version of each dataset it answered from, under
15
15
  `data_version`.
@@ -247,7 +247,7 @@ data is conveyed, so alongside this file every tool response that quotes a usage
247
247
  carries this string verbatim in its `attribution` field:
248
248
 
249
249
  > Usage data from caniuse.com, © Can I Use contributors, CC BY 4.0. Figures are a share of
250
- > the ~96.7% of global traffic caniuse tracks.
250
+ > the ~97.3% of global traffic caniuse tracks.
251
251
 
252
252
  Full license: https://creativecommons.org/licenses/by/4.0/legalcode
253
253
 
@@ -0,0 +1,40 @@
1
+ ---
2
+ summary: "browsercompat_compare_support pages its target rows ten query targets at a time and counts a target as evaluated only where compatibility data was read, so a feature clears only when every target in the query was evaluated. Support notes and descriptions are plain text, and browsercompat_get_feature lists direct subkeys."
3
+ breaking: true
4
+ security: false
5
+ ---
6
+
7
+ # 0.2.0 — 2026-09-30
8
+
9
+ ## Added
10
+
11
+ - **`browsercompat_get_feature` returns `subkeys`** — the direct child keys of the resolved BCD key as `{ total, keys, truncated, next_offset? }`, at most 100 per response, continued with the new `subkeys_offset` input ([#16](https://github.com/cyanheads/browser-compat-mcp-server/issues/16)).
12
+ - **`notes` and `impl_url` on `unsupported` and `preview_only` support rows**, merged from the matching BCD statements in declaration order ([#11](https://github.com/cyanheads/browser-compat-mcp-server/issues/11)).
13
+ - **`browsercompat_compare_support` reports evaluation per feature**: `failing_total`, `evaluated_total`, `evaluated_coverage_percent`, `unchecked_total`, `unchecked_coverage_percent`, and `unchecked_targets` on each compared result, with top-level `comparable_features`, `targets_resolved_total`, `evaluated_targets_total`, and `unchecked_targets_total`. Each `targets_resolved` row carries `evaluated`.
14
+
15
+ ## Changed
16
+
17
+ - **`browsercompat_compare_support` pages its target rows** with `target_offset` (default 0) and `target_limit` (1–10, default 10). A query with more than 10 targets returns the first page of rows where it returned all of them; verdicts, coverage, and totals describe the whole query on every page ([#6](https://github.com/cyanheads/browser-compat-mcp-server/issues/6)).
18
+ - **`totalCount` on `browsercompat_compare_support` counts the targets in the query**, not the features. `shown`, `cap`, and `truncated` are always present, `nextOffset` continues while targets remain, and an offset past the end returns the summaries with an `offsetNotice`. `unchecked_targets` follow query order.
19
+ - **A feature clears only when every target in the query was evaluated and supports it.** With no failing target but any target not evaluated, the verdict is `inconclusive` where it read `clears`, so `defaults` no longer returns `clears` ([#7](https://github.com/cyanheads/browser-compat-mcp-server/issues/7)).
20
+ - **`target_coverage_percent` counts only targets whose compatibility data was read** for every compared feature. When no feature is comparable it is 0, and the mapped targets move to `unchecked_targets` with the new reason `no_comparable_feature`.
21
+ - **`support[].notes` and `description` are plain text** where they carried HTML: BCD markup is removed, entities are decoded once, and each link reads `label (url)` ([#9](https://github.com/cyanheads/browser-compat-mcp-server/issues/9)).
22
+ - **The Markdown text of all five tools escapes literal text**, so a name such as `<dialog>` renders visibly and URLs render as `<https://…>` autolinks. An underscore between two letters or digits is left unescaped, so `and_chr` and tool names stay copyable.
23
+ - **The caniuse attribution reads `~97.3%`** (was `~96.7%`) in `attribution`, `usage_source`, and `THIRD_PARTY_NOTICES.md`. The figure is a constant the tests check against the bundled data.
24
+ - **Docker image**: production dependencies install in a build-platform `deps` stage, with `scripts/install-otel.ts` adding the OpenTelemetry peers, so no target-platform stage runs JavaScript during a multi-arch build. `lint:packaging` enforces it.
25
+
26
+ ## Fixed
27
+
28
+ - **`browsercompat_get_feature` returns a top-level `discouraged`** for a discouraged feature whether or not the result carries a BCD `status`, including ids that span several keys. `status.discouraged` stays where it was populated ([#8](https://github.com/cyanheads/browser-compat-mcp-server/issues/8)).
29
+ - **`browsercompat_check_baseline` reports `usage_percent_excluded` and `usage_source` for a BCD key only when it is the feature's sole declared compat key.** Other keys omit both instead of borrowing the parent feature's figure ([#13](https://github.com/cyanheads/browser-compat-mcp-server/issues/13)).
30
+ - **`limiting_browser` requires full support in every Baseline core browser.** It is omitted when any core browser's support is partial, prefixed, flagged, or preview-only, in both `browsercompat_get_feature` and `browsercompat_check_baseline` ([#14](https://github.com/cyanheads/browser-compat-mcp-server/issues/14)).
31
+
32
+ ## Dependencies
33
+
34
+ - `@cyanheads/mcp-ts-core` ^0.13.9 → ^0.13.10 (the framework forwards each contract's recovery hint, so the explicit `ctx.recoveryFor()` calls are gone; 16 framework skills and `scripts/lint-packaging.ts` resynced)
35
+ - `@mdn/browser-compat-data` ^8.1.2 → ^8.1.3
36
+ - `web-features` ^3.39.0 → ^3.40.0 (the feature is now named `Container queries (size)`; the `resolve: true` examples follow)
37
+ - `caniuse-lite` ^1.0.30001810 → ^1.0.30001812
38
+ - `browserslist` ^4.29.0 → ^4.29.1
39
+ - `vitest` ^5.0.1 → ^5.0.2, `@vitest/coverage-istanbul` 5.0.1 → 5.0.2
40
+ - `@types/node` 26.6.2 → 26.6.3
@@ -0,0 +1,41 @@
1
+ ---
2
+ summary: "Multi-key web-features ids are judged on web-features' feature-level support. compat_keys is bounded, failing rows report the support statement and a whole-query failing_ranges summary, batch tools serve up to a cap and report the rest as omitted_features, and search matches singular and plural forms."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.2.1 — 2026-10-15
8
+
9
+ ## Added
10
+
11
+ - **`feature_support` on multi-key web-features ids** in `browsercompat_get_feature`: one row per Baseline core browser, `{ browser_id, supported, version?, version_is_upper_bound? }`, relaying the release web-features lists for the feature as a whole ([#26](https://github.com/cyanheads/browser-compat-mcp-server/issues/26)).
12
+ - **`browsercompat_check_baseline` and `browsercompat_compare_support` judge a multi-key id on `feature_support`**; `browsercompat_compare_support` names the basis in `support_source` (`bcd_key` or `web_features_feature`) and leaves every non-core browser unevaluated ([#26](https://github.com/cyanheads/browser-compat-mcp-server/issues/26)).
13
+ - **`compat_keys_total` and `compat_keys_offset` / `compat_keys_next_offset`** on `browsercompat_get_feature`, which pages `compat_keys` 100 at a time ([#25](https://github.com/cyanheads/browser-compat-mcp-server/issues/25)).
14
+ - **`other_statements` and the verdict-bearing statement's fields** (`prefix`, `flags`, `partial`, `notes`) on failing `support` and `failing_targets` rows ([#27](https://github.com/cyanheads/browser-compat-mcp-server/issues/27)).
15
+ - **`failing_ranges` on each compared result of `browsercompat_compare_support`**: runs `{ agent, newest, oldest, count, verdict }` covering every failing target in the query, identical on every page ([#28](https://github.com/cyanheads/browser-compat-mcp-server/issues/28)).
16
+ - **`omitted_features` on `browsercompat_check_baseline` and `browsercompat_compare_support`**: entries past the 20th, returned verbatim for the next call, with `all_widely_available` / `all_clear` false ([#29](https://github.com/cyanheads/browser-compat-mcp-server/issues/29)).
17
+ - **`version_is_upper_bound` on `limiting_browser`**, set when the release is a `≤` bound ([#30](https://github.com/cyanheads/browser-compat-mcp-server/issues/30)).
18
+
19
+ ## Changed
20
+
21
+ - **Three output enums gained members**: the `browsercompat_compare_support` failing verdict adds `before_feature_support` and `no_feature_support`, and its unchecked-target reason adds `no_feature_level_data` ([#26](https://github.com/cyanheads/browser-compat-mcp-server/issues/26)).
22
+ - **`compat_keys` on `browsercompat_check_baseline` and `browsercompat_compare_support` results is truncated to the first 10 keys**; `compat_keys_total` gives the full count ([#25](https://github.com/cyanheads/browser-compat-mcp-server/issues/25)).
23
+ - **`limiting_browser` keeps a ranged version's upper bound** instead of dropping the `≤` ([#30](https://github.com/cyanheads/browser-compat-mcp-server/issues/30)).
24
+ - **Batch inputs are served up to a per-call cap instead of rejected.** `browsercompat_check_baseline` and `browsercompat_compare_support` evaluate 20 of up to 100 features; `limit` on `browsercompat_search_features` (up to 1,000) and `target_limit` on `browsercompat_compare_support` (up to 1,000) clamp to 50 and 10, reported in `cap` ([#29](https://github.com/cyanheads/browser-compat-mcp-server/issues/29)).
25
+
26
+ ## Fixed
27
+
28
+ - **`browsercompat_search_features` matches singular and plural forms of a query word**, so `container query` finds `Container queries` ([#24](https://github.com/cyanheads/browser-compat-mcp-server/issues/24)).
29
+ - **`compat_keys` no longer returns every key of an id on every result**: an id owning 614 keys (`svg`) no longer produces a 775 KB response from 20 entries ([#25](https://github.com/cyanheads/browser-compat-mcp-server/issues/25)).
30
+
31
+ ## Dependencies
32
+
33
+ - `@cyanheads/mcp-ts-core` ^0.13.10 → ^0.13.15 (framework skills, scripts, and template files resynced; the Docker deps stage prunes musl-only packages)
34
+ - `@mdn/browser-compat-data` ^8.1.3 → ^8.1.5
35
+ - `web-features` ^3.40.0 → ^3.42.0
36
+ - `browserslist` ^4.29.1 → ^4.29.3
37
+ - `caniuse-lite` ^1.0.30001812 → ^1.0.30001815
38
+ - `pino-pretty` ^13.1.3 → ^13.2.0
39
+ - `zod` ^4.6.5 → ^4.6.7
40
+ - `@biomejs/biome` 2.5.14 → 2.5.15, `@types/node` 26.6.3 → 26.6.5, `@vitest/coverage-istanbul` 5.0.2 → 5.0.4, `vitest` ^5.0.2 → ^5.0.4, `ignore` ^7.0.10 → ^7.0.12, `tsc-alias` ^1.9.5 → ^1.9.7
41
+ - Bun 1.4.2 → 1.4.3 (`packageManager`, Dockerfile base images)
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ await createApp({
30
30
  ],
31
31
  resources: [],
32
32
  prompts: [],
33
- instructions: 'Browser support and Baseline status for web platform features, served from bundled MDN browser-compat-data, web-features, and caniuse data — offline, no API key, no rate limit. Start at browsercompat_search_features when the feature key is unknown; browsercompat_get_feature returns the per-feature record and browsercompat_check_baseline answers ship-or-not across up to 20 features at once. Every tool takes one feature string that is either a BCD key (css.selectors.has) or a web-features id (has), and echoes resolved_as saying which namespace it matched; an unresolved feature comes back as found: false with guidance, never an error. browsercompat_compare_support requires an explicit browserslist query and reports unchecked_targets for target browsers with no compatibility data — a pass is never claimed for a browser that was not evaluated. browsercompat_list_reference enumerates the namespaces, browser ids, browserslist agents, Baseline states, groups, and snapshots the other tools expect. Every response echoes data_version; the data is a package snapshot, so a feature that shipped in the last few weeks may lag.',
33
+ instructions: 'Browser support and Baseline status for web platform features, served from bundled MDN browser-compat-data, web-features, and caniuse data — offline, no API key, no rate limit. Start at browsercompat_search_features when the feature key is unknown; browsercompat_get_feature returns the per-feature record and browsercompat_check_baseline answers ship-or-not across up to 20 features at once. Every tool takes one feature string that is either a BCD key (css.selectors.has) or a web-features id (has), and echoes resolved_as saying which namespace it matched; an unresolved feature comes back as found: false with guidance, never an error. A web-features id that spans several BCD keys, such as grid, is answered from web-features’ own release per Baseline core browser for the feature as a whole, with its compat_keys for a key-level follow-up. browsercompat_compare_support requires an explicit browserslist query and evaluates all of it on every call: verdicts, coverage, and totals describe the whole query, while the target rows cover at most 10 query targets per call — pass nextOffset as target_offset for the next page. A feature clears only when every target in the query was evaluated and supports it; a target with no compatibility data is counted as unchecked and makes the verdict inconclusive, so a pass is never claimed for a browser that was not evaluated. browsercompat_list_reference enumerates the namespaces, browser ids, browserslist agents, Baseline states, groups, and snapshots the other tools expect. Every response echoes data_version; the data is a package snapshot, so a feature that shipped in the last few weeks may lag.',
34
34
  // Keyless public reference data — serve the full inventory without an auth gate.
35
35
  landing: { requireAuth: false },
36
36
  setup(core) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qEAAqE,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,MAAM,sEAAsE,CAAC;AACnH,OAAO,EAAE,uBAAuB,EAAE,MAAM,kEAAkE,CAAC;AAC3G,OAAO,EAAE,0BAA0B,EAAE,MAAM,qEAAqE,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,MAAM,sEAAsE,CAAC;AACnH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAAE,2BAA2B;IAClC,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE;QACxD,iBAAiB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE;KAC9D;IACD,KAAK,EAAE;QACL,0BAA0B;QAC1B,uBAAuB;QACvB,0BAA0B;QAC1B,2BAA2B;QAC3B,2BAA2B;KAC5B;IACD,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EACV,0mCAA0mC;IAC5mC,iFAAiF;IACjF,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAE/B,KAAK,CAAC,IAAI;QACR,wEAAwE;QACxE,4EAA4E;QAC5E,qBAAqB;QACrB,OAAO,CAAC,GAAG,CAAC;YACV,aAAa,EAAE;YACf,kBAAkB,EAAE;YACpB,iBAAiB,EAAE;YACnB,gBAAgB,EAAE;YAClB,cAAc,EAAE;SACjB,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,wBAAwB,EACxB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAC1D,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qEAAqE,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,MAAM,sEAAsE,CAAC;AACnH,OAAO,EAAE,uBAAuB,EAAE,MAAM,kEAAkE,CAAC;AAC3G,OAAO,EAAE,0BAA0B,EAAE,MAAM,qEAAqE,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,MAAM,sEAAsE,CAAC;AACnH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAAE,2BAA2B;IAClC,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE;QACxD,iBAAiB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE;KAC9D;IACD,KAAK,EAAE;QACL,0BAA0B;QAC1B,uBAAuB;QACvB,0BAA0B;QAC1B,2BAA2B;QAC3B,2BAA2B;KAC5B;IACD,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EACV,onDAAonD;IACtnD,iFAAiF;IACjF,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAE/B,KAAK,CAAC,IAAI;QACR,wEAAwE;QACxE,4EAA4E;QAC5E,qBAAqB;QACrB,OAAO,CAAC,GAAG,CAAC;YACV,aAAa,EAAE;YACf,kBAAkB,EAAE;YACpB,iBAAiB,EAAE;YACnB,gBAAgB,EAAE;YAClB,cAAc,EAAE;SACjB,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,wBAAwB,EACxB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAC1D,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
@@ -46,6 +46,7 @@ export declare const browsercompatCheckBaseline: import("@cyanheads/mcp-ts-core"
46
46
  browser_id: z.ZodString;
47
47
  name: z.ZodString;
48
48
  version: z.ZodString;
49
+ version_is_upper_bound: z.ZodOptional<z.ZodBoolean>;
49
50
  }, z.core.$strip>>;
50
51
  deprecated: z.ZodOptional<z.ZodBoolean>;
51
52
  experimental: z.ZodOptional<z.ZodBoolean>;
@@ -56,13 +57,15 @@ export declare const browsercompatCheckBaseline: import("@cyanheads/mcp-ts-core"
56
57
  usage_percent_excluded: z.ZodOptional<z.ZodNumber>;
57
58
  usage_source: z.ZodOptional<z.ZodString>;
58
59
  compat_keys: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ compat_keys_total: z.ZodOptional<z.ZodNumber>;
59
61
  guidance: z.ZodOptional<z.ZodString>;
60
62
  }, z.core.$strip>>;
63
+ omitted_features: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
64
  all_widely_available: z.ZodBoolean;
62
65
  }, z.core.$strip>, readonly [{
63
66
  readonly reason: "invalid_feature_input";
64
67
  readonly code: JsonRpcErrorCode.ValidationError;
65
- readonly when: "An entry in features is whitespace-only. An empty or over-200-character entry is rejected against the input schema instead.";
68
+ readonly when: "An entry in features is whitespace-only, including an entry past the 20th. An empty or over-200-character entry is rejected against the input schema instead.";
66
69
  readonly recovery: "Replace the whitespace-only entry with a BCD key such as css.selectors.has or a web-features id such as has; use browsercompat_search_features to find one.";
67
70
  }], {
68
71
  readonly data_version: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"browsercompat-check-baseline.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browsercompat-check-baseline.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwEjE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwMrC,CAAC"}
1
+ {"version":3,"file":"browsercompat-check-baseline.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browsercompat-check-baseline.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAuFjE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyOrC,CAAC"}