@cyanheads/browser-compat-mcp-server 0.1.4 → 0.2.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 (57) hide show
  1. package/AGENTS.md +11 -10
  2. package/CLAUDE.md +11 -10
  3. package/Dockerfile +75 -38
  4. package/README.md +35 -36
  5. package/THIRD_PARTY_NOTICES.md +1 -1
  6. package/changelog/0.1.x/0.1.5.md +27 -0
  7. package/changelog/0.2.x/0.2.0.md +40 -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.map +1 -1
  11. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.js +21 -16
  12. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.d.ts +33 -2
  14. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.js +264 -89
  16. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.d.ts +11 -0
  18. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.js +66 -21
  20. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.js +7 -6
  23. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.js.map +1 -1
  24. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.js +25 -18
  26. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/compat-shapes.d.ts +1 -1
  28. package/dist/mcp-server/tools/definitions/compat-shapes.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/compat-shapes.js +16 -13
  30. package/dist/mcp-server/tools/definitions/compat-shapes.js.map +1 -1
  31. package/dist/services/bcd/bcd-service.d.ts +4 -1
  32. package/dist/services/bcd/bcd-service.d.ts.map +1 -1
  33. package/dist/services/bcd/bcd-service.js +56 -14
  34. package/dist/services/bcd/bcd-service.js.map +1 -1
  35. package/dist/services/bcd/bcd-text.d.ts +11 -0
  36. package/dist/services/bcd/bcd-text.d.ts.map +1 -0
  37. package/dist/services/bcd/bcd-text.js +127 -0
  38. package/dist/services/bcd/bcd-text.js.map +1 -0
  39. package/dist/services/data-version/data-version-service.d.ts.map +1 -1
  40. package/dist/services/data-version/data-version-service.js +4 -3
  41. package/dist/services/data-version/data-version-service.js.map +1 -1
  42. package/dist/services/search/search-service.d.ts +2 -6
  43. package/dist/services/search/search-service.d.ts.map +1 -1
  44. package/dist/services/search/search-service.js +3 -23
  45. package/dist/services/search/search-service.js.map +1 -1
  46. package/dist/services/targets/targets-service.d.ts +11 -6
  47. package/dist/services/targets/targets-service.d.ts.map +1 -1
  48. package/dist/services/targets/targets-service.js +12 -7
  49. package/dist/services/targets/targets-service.js.map +1 -1
  50. package/dist/services/targets/types.d.ts +7 -2
  51. package/dist/services/targets/types.d.ts.map +1 -1
  52. package/dist/utils/markdown-text.d.ts +11 -0
  53. package/dist/utils/markdown-text.d.ts.map +1 -0
  54. package/dist/utils/markdown-text.js +57 -0
  55. package/dist/utils/markdown-text.js.map +1 -0
  56. package/package.json +13 -12
  57. package/server.json +3 -3
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.4
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
4
+ **Version:** 0.2.0
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.10`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
- **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
8
- **Zod:** ^4.4.3
7
+ **MCP SDK:** `@modelcontextprotocol/server` ^2.1.0
8
+ **Zod:** ^4.6.5
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
 
@@ -74,7 +74,7 @@ export const searchItems = tool('search_items', {
74
74
  annotations: { readOnlyHint: true },
75
75
  input: z.object({
76
76
  query: z.string().describe('Search terms'),
77
- limit: z.number().default(10).describe('Max results'),
77
+ limit: z.number().int().min(1).max(100).default(10).describe('Max results (1–100)'),
78
78
  }),
79
79
  output: z.object({
80
80
  items: z.array(z.object({
@@ -206,13 +206,14 @@ Handlers receive a unified `ctx` object. Key properties:
206
206
  | Property | Description |
207
207
  |:---------|:------------|
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
- | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
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
  ```
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.4
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
4
+ **Version:** 0.2.0
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.10`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
- **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
8
- **Zod:** ^4.4.3
7
+ **MCP SDK:** `@modelcontextprotocol/server` ^2.1.0
8
+ **Zod:** ^4.6.5
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
 
@@ -74,7 +74,7 @@ export const searchItems = tool('search_items', {
74
74
  annotations: { readOnlyHint: true },
75
75
  input: z.object({
76
76
  query: z.string().describe('Search terms'),
77
- limit: z.number().default(10).describe('Max results'),
77
+ limit: z.number().int().min(1).max(100).default(10).describe('Max results (1–100)'),
78
78
  }),
79
79
  output: z.object({
80
80
  items: z.array(z.object({
@@ -206,13 +206,14 @@ Handlers receive a unified `ctx` object. Key properties:
206
206
  | Property | Description |
207
207
  |:---------|:------------|
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
- | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
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
  ```
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.0 AS build
17
+ FROM --platform=$BUILDPLATFORM oven/bun:1.4.2 AS build
18
18
 
19
19
  WORKDIR /usr/src/app
20
20
 
@@ -34,59 +34,97 @@ 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 does the OTel script — so the stage runs on $BUILDPLATFORM
42
+ # and cross-installs with `--os`/`--cpu`, which pick each platform-specific
43
+ # optional dependency (native bindings such as DuckDB's) for the target. Only
44
+ # `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.0-slim AS production
49
+ FROM --platform=$BUILDPLATFORM oven/bun:1.4.2 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
- # Copy dependency manifests
60
- COPY package.json bun.lock ./
53
+ # Copy dependency manifests. `bunfig.toml` rides along so every install below
54
+ # passes its release-age gate and security scanner, as a local install does.
55
+ COPY package.json bun.lock bunfig.toml ./
56
+
57
+ # The scanner bunfig.toml names is a devDependency, and Bun installs a missing
58
+ # scanner through the same production-filtered install, which omits it and
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.
61
+ COPY --from=build /usr/src/app/node_modules/@socketsecurity/bun-security-scanner ./node_modules/@socketsecurity/bun-security-scanner
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
61
73
 
62
74
  # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
63
75
  # that are not needed in the final production image.
64
76
  # `--omit=peer` drops the framework's optional peer tiers (test runner, service
65
77
  # SDKs, parsers) that Bun would otherwise auto-install. Anything this server
66
78
  # actually imports belongs in its own `dependencies`, so nothing needed at
67
- # runtime is lost. The OTEL step below carries the same flag — without it, that
68
- # install re-resolves the graph and pulls every optional peer back in.
79
+ # runtime is lost.
69
80
  RUN --mount=type=cache,target=/root/.bun/install/cache \
70
- 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)"
71
83
 
72
84
  # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
73
85
  # Installed by default. Omit them for a leaner image at build time
74
86
  # with: docker build --build-arg OTEL_ENABLED=false
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/
75
90
  ARG OTEL_ENABLED=true
76
91
  RUN --mount=type=cache,target=/root/.bun/install/cache \
77
92
  if [ "$OTEL_ENABLED" = "true" ]; then \
78
- bun add --omit=dev --omit=peer --ignore-scripts @hono/otel \
79
- @opentelemetry/instrumentation-http \
80
- @opentelemetry/exporter-metrics-otlp-http \
81
- @opentelemetry/exporter-trace-otlp-http \
82
- @opentelemetry/instrumentation-pino \
83
- @opentelemetry/resources \
84
- @opentelemetry/sdk-metrics \
85
- @opentelemetry/sdk-node \
86
- @opentelemetry/sdk-trace-node \
87
- @opentelemetry/semantic-conventions; \
93
+ bun scripts/install-otel.ts --os="$TARGETOS" --cpu="$(cat .bun-cpu)"; \
88
94
  fi
89
95
 
96
+ # The seeded scanner served only the installs above; keep it out of the image.
97
+ RUN rm -rf node_modules/@socketsecurity/bun-security-scanner
98
+
99
+
100
+ # ==============================================================================
101
+ # Production Stage
102
+ #
103
+ # This stage creates a minimal, optimized, and secure image for running the
104
+ # application. It uses a slim base image and only includes production
105
+ # dependencies and build artifacts. Its only Bun invocations are HEALTHCHECK
106
+ # and CMD, which run on the real target at container start.
107
+ # ==============================================================================
108
+ FROM oven/bun:1.4.2-slim AS production
109
+
110
+ WORKDIR /usr/src/app
111
+
112
+ # Set the environment to production for performance.
113
+ ENV NODE_ENV=production
114
+
115
+ # OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
116
+ ARG APP_VERSION
117
+ LABEL org.opencontainers.image.title="browser-compat-mcp-server"
118
+ 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."
119
+ LABEL org.opencontainers.image.licenses="Apache-2.0"
120
+ LABEL org.opencontainers.image.version="${APP_VERSION}"
121
+ LABEL org.opencontainers.image.source="https://github.com/cyanheads/browser-compat-mcp-server"
122
+
123
+ # The manifest comes from the build context: the deps stage's copy was rewritten
124
+ # by the OTel install, and the runtime reads only its name, version, and type.
125
+ COPY package.json ./
126
+ COPY --from=deps /usr/src/app/node_modules ./node_modules
127
+
90
128
  # Copy the compiled application code from the build stage
91
129
  COPY --from=build /usr/src/app/dist ./dist
92
130
 
@@ -128,7 +166,6 @@ ENV MCP_TRANSPORT_TYPE="http"
128
166
  ENV MCP_SESSION_MODE="stateless"
129
167
  ENV MCP_LOG_LEVEL="info"
130
168
  ENV LOGS_DIR="/var/log/browser-compat-mcp-server"
131
- ENV MCP_FORCE_CONSOLE_LOGGING="true"
132
169
 
133
170
  # Expose the port the server listens on
134
171
  EXPOSE ${MCP_HTTP_PORT}
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.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0%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.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/)
11
11
 
12
12
  </div>
13
13
 
@@ -39,7 +39,7 @@ Web platform compatibility for frontend work: per-browser support from MDN's `@m
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
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. |
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 and evaluated coverage per feature, with the failing and unevaluated target rows paged ten query targets at a time. |
43
43
 
44
44
  ---
45
45
 
@@ -47,53 +47,45 @@ Web platform compatibility for frontend work: per-browser support from MDN's `@m
47
47
 
48
48
  ### `browsercompat_list_reference` <sub>tool</sub>
49
49
 
50
- - One required `topic`: `bcd_namespaces` (12), `bcd_browsers` (17), `browserslist_agents` (19), `baseline_states` (4), `groups` (104), `snapshots` (11)
51
- - Entries carry `id`, `label`, and `detail`, plus `count`, `reported`, `bcd_browser`, `usage_percent`, `maps_from`, or `spec_url` where the topic has them
52
- - `groups` and `snapshots` ids are the values `browsercompat_search_features` takes as `group` and `snapshot`
53
- - `browserslist_agents` gives each agent's browser-compat-data counterpart or `null` — the `null` ones can never be evaluated and always land in `unchecked_targets`
50
+ - Required `topic`: `bcd_namespaces` (12), `bcd_browsers` (17), `browserslist_agents` (19), `baseline_states` (4), `groups` (104), or `snapshots` (11). Group and snapshot ids feed the search filters.
51
+ - Entries carry `id`, `label`, and `detail`, plus `count`, `reported`, `bcd_browser`, `usage_percent`, `maps_from`, or `spec_url` where applicable. An agent's `bcd_browser: null` means support comparisons cannot evaluate it and report it in `unchecked_targets`.
54
52
 
55
53
  ---
56
54
 
57
55
  ### `browsercompat_get_feature` <sub>tool</sub>
58
56
 
59
- - One `feature` string, 1–200 characters: a BCD key (`css.selectors.has`) or a web-features id (`has`); `resolved_as` echoes which one matched and how
60
- - `resolve: true` falls back to the search index for a plain name or notation (`Container queries`, `Element.prototype.animate`) and accepts its best exact matches only when they name one feature: one key resolves to that key, several keys of one feature resolve to the feature with `compat_keys`, and two features are a miss. Off by default, so a typo returns a miss rather than a confident answer about the wrong feature
61
- - `include_runtimes: true` adds `bun`, `deno`, `nodejs`, and `oculus` rows to the 13 reported desktop and mobile browsers
62
- - `outcome` is `found` | `no_compat_data` | `miss` — a miss is `found: false` with `guidance`, never an error
63
- - A web-features id spanning more than one BCD key omits the per-key fields (`support`, `status`, `limiting_browser`, `mdn_url`, `spec_urls`) and returns `compat_keys` to re-call with
64
- - Typed failure: `invalid_feature_input` (whitespace-only `feature`)
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`.
59
+ - `include_runtimes: true` adds `bun`, `deno`, `nodejs`, and `oculus` support to the 13 desktop and mobile browser rows.
60
+ - 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.
61
+ - `limiting_browser` appears only when every Baseline core browser has full, unprefixed, unflagged support at a resolvable added release.
62
+ - 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.
65
63
 
66
64
  ---
67
65
 
68
66
  ### `browsercompat_check_baseline` <sub>tool</sub>
69
67
 
70
- - Up to 20 BCD keys or web-features ids per call, 1–200 characters each; one result per entry, in input order
71
- - Each result carries Baseline state and dates, `limiting_browser`, `deprecated` / `experimental` / `discouraged`, and `usage_percent_excluded` alongside the `usage_source` it is a share of
72
- - `usage_percent_excluded` is absent — never zero — when the feature reaches no caniuse id
73
- - `all_widely_available` answers the Baseline question alone: every entry resolved at `widely`, one miss forces it false, and deprecation does not enter it
74
- - Typed failure: `invalid_feature_input` (a whitespace-only entry)
68
+ - 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`.
69
+ - Results carry Baseline state and dates, `limiting_browser` under the full-support condition above, `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.
70
+ - `all_widely_available` requires every entry to resolve at `widely`; one miss makes it false, and it does not assess deprecation.
75
71
 
76
72
  ---
77
73
 
78
74
  ### `browsercompat_search_features` <sub>tool</sub>
79
75
 
80
- - `query` 1–100 characters: a plain name, a keyword, or code notation such as `Array.prototype.at`, `display: grid`, or `<dialog>`
81
- - Optional filters, combinable: `namespace` (one of the 12 BCD namespaces), `baseline` (`widely` | `newly` | `limited` | `not_mapped`), `group` (a web-features group, nested groups included), and `snapshot` (an ECMAScript edition such as `ecmascript-2023`)
82
- - `limit` 1–50, default 10, and `offset` (default 0) to page through the full ranking; `nextOffset` is present while matches remain
83
- - Every hit carries `matched_on`, the field that matched, so the six-tier ranking is inspectable rather than a score; `path_suffix` marks a key whose trailing segments match the dotted or property-value notation typed
84
- - `support_summary` is one line across the seven Baseline core browsers, with `—` for unsupported and `?` for unknown
85
- - Zero hits are a successful empty result plus a notice naming which filter to drop; `totalCount` counts every match, and an `offset` past it returns an empty page with a notice
86
- - Typed failures: `invalid_query` (a query that normalizes to zero tokens), `unknown_group`, `unknown_snapshot`
76
+ - `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`).
77
+ - `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`.
78
+ - 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.
87
79
 
88
80
  ---
89
81
 
90
82
  ### `browsercompat_compare_support` <sub>tool</sub>
91
83
 
92
- - Up to 20 features against a required `targets` browserslist query (`defaults`, `> 0.5%, last 2 versions`) — required so browserslist never falls back to config in the server's working directory
93
- - `verdict` per feature: `clears` | `fails` | `inconclusive` | `miss` | `ambiguous`; `failing_targets` names each failing target with the verdict behind it (`partial`, `prefixed`, `flagged`, `removed`, `unsupported`, `preview_only`)
94
- - `unchecked_targets` lists every target the server declined to judge, with `no_bcd_browser` | `unknown_version` | `no_bcd_data`; `all_clear` requires that list to be empty
95
- - `target_coverage_percent` and `unchecked_coverage_percent` give the caniuse-derived traffic share of the evaluated and unevaluated tokens
96
- - Typed failures: `invalid_target_query`, `no_targets_resolved`, `invalid_feature_input`
84
+ - 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`.
85
+ - 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. A query that includes a browser with no compatibility data, as `defaults` does, never clears. `all_clear` is true only when every feature clears.
86
+ - A target counts as evaluated only where compatibility data was read for it. Each compared result carries `failing_total`, `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.
87
+ - Target rows are paged with `target_offset` (integer ≥0, default 0) and `target_limit` (1–10, default 10). `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.
88
+ - `failing_targets` names targets with `partial`, `prefixed`, `flagged`, `removed`, `unsupported`, or `preview_only` support. `unchecked_targets` carries `no_bcd_browser`, `unknown_version`, `no_bcd_data`, or `no_comparable_feature` — the last when every entry was a miss or ambiguous, so nothing was compared.
97
89
 
98
90
  ---
99
91
 
@@ -101,12 +93,12 @@ Web platform compatibility for frontend work: per-browser support from MDN's `@m
101
93
 
102
94
  | Package | Version | License | Supplies |
103
95
  |:---|:---|:---|:---|
104
- | [`@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 |
105
- | [`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 |
106
- | [`caniuse-lite`](https://github.com/browserslist/caniuse-lite) | `^1.0.30001810` | CC-BY-4.0 | Usage weighting, plus feature titles for the search index |
107
- | [`browserslist`](https://github.com/browserslist/browserslist) | `^4.29.0` | MIT | Target query resolution and coverage figures |
96
+ | [`@mdn/browser-compat-data`](https://github.com/mdn/browser-compat-data) | `^8.1.3` | CC0-1.0 | Per-browser support, standards status, MDN and specification links |
97
+ | [`web-features`](https://github.com/web-platform-dx/web-features) | `^3.40.0` | Apache-2.0 | Baseline state and dates, discouraged flags, groups, ECMAScript snapshots |
98
+ | [`caniuse-lite`](https://github.com/browserslist/caniuse-lite) | `^1.0.30001812` | CC-BY-4.0 | Usage weighting, plus feature titles for the search index |
99
+ | [`browserslist`](https://github.com/browserslist/browserslist) | `^4.29.1` | MIT | Target query resolution and coverage figures |
108
100
 
109
- 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).
101
+ 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).
110
102
 
111
103
  ---
112
104
 
@@ -124,9 +116,10 @@ Browser-compat-specific:
124
116
  Agent-friendly output:
125
117
 
126
118
  - 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
127
- - 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`
119
+ - 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`
128
120
  - 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
129
121
  - Usage figures state the population they are a share of, and carry the caniuse attribution on every response that reports one
122
+ - 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.
130
123
 
131
124
  ---
132
125
 
@@ -246,12 +239,18 @@ cp .env.example .env
246
239
 
247
240
  ## Configuration
248
241
 
249
- There are no server-specific environment variables: no API keys, no base URLs, and deliberately no browserslist configuration variable — the target query is always a tool input rather than ambient state. Only the framework transport settings apply.
242
+ There are no server-specific environment variables: no API keys, no base URLs, and deliberately no browserslist configuration variable — the target query is always a tool input rather than ambient state. Framework transport, logging, and telemetry settings remain configurable.
250
243
 
251
244
  | Variable | Description | Default |
252
245
  |:---------|:------------|:--------|
253
246
  | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
254
247
  | `MCP_HTTP_PORT` | Port for the HTTP server. | `3010` |
248
+ | `MCP_SESSION_MODE` | HTTP session mode, explicitly set by `.env.example` and Docker. When unset, the framework's `auto` fallback resolves to `stateful`. | `stateless` |
249
+ | `OTEL_ENABLED` | Enable OpenTelemetry; local installs need the framework's optional telemetry peers. Docker includes them by default. | `false` |
250
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | Base URL for traces (`/v1/traces`) and metrics (`/v1/metrics`); signal-specific endpoints override it. | Unset |
251
+ | `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | Explicit OTLP log endpoint, used as-is; the base endpoint never enables log export. | Unset |
252
+ | `LOG_TOOL_FAILURE_PAYLOADS` | Log failed-call arguments and results. Redaction matches key names only; free-form values can retain secrets. | `false` |
253
+ | `LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES` | UTF-8 byte cap per logged payload. | `16384` |
255
254
 
256
255
  See [`.env.example`](./.env.example) for the full list of optional framework overrides.
257
256
 
@@ -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,27 @@
1
+ ---
2
+ summary: "Framework 0.13.9 adoption with clearer argument recovery and guarded Docker telemetry installs."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.1.5 — 2026-09-26
8
+
9
+ ## Changed
10
+
11
+ - **Argument recovery** inherits mcp-ts-core 0.13.9's safe-integer-to-string repair, field-path hints, and rejected-call key-rewrite details.
12
+ - **HTTP transport** inherits MCP SDK 2.1.0 through framework 0.13.9: modern requests missing `MCP-Protocol-Version` return 400/-32020, batches over 100 messages return 400/-32600, and admitted-origin CORS preflights allow modern request headers.
13
+ - **Telemetry** adopts framework 0.13.7's OTLP base endpoint handling and 0.13.8's opt-in `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` and `LOG_TOOL_FAILURE_PAYLOADS`, documented with their endpoint and redaction constraints.
14
+ - **Framework errors** omit stack traces and cause chains since 0.13.7 and request context since 0.13.8; output-contract failures use -32603, while domain validation remains -32007.
15
+ - **Docker** installs telemetry peers within the framework's declared ranges under the existing release-age and Socket scanner guards, including OTLP log peers; removes the unused `MCP_FORCE_CONSOLE_LOGGING` setting.
16
+ - **Packaging and tooling** exclude built bundles from npm and scratch logs/design notes from MCPB, sync framework skills and maintenance scripts, and clarify tool contracts and existing session defaults in the documentation.
17
+
18
+ ## Fixed
19
+
20
+ - **Clean-checkout smoke tests** check for resource and prompt definitions without requiring empty directories that Git does not preserve ([#20](https://github.com/cyanheads/browser-compat-mcp-server/issues/20)).
21
+
22
+ ## Dependencies
23
+
24
+ - `@cyanheads/mcp-ts-core` ^0.13.6 → ^0.13.9.
25
+ - `@socketsecurity/bun-security-scanner` ^1.1.2 → ^1.1.3.
26
+ - `ignore` ^7.0.9 → ^7.0.10.
27
+ - **Bun** 1.4.0 → 1.4.2 in the package-manager pin, Docker base images, and README badge.
@@ -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
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. 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,s6CAAs6C;IACx6C,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 +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;AA4EjE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6MrC,CAAC"}