@cyanheads/browser-compat-mcp-server 0.1.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 (82) hide show
  1. package/AGENTS.md +451 -0
  2. package/CLAUDE.md +451 -0
  3. package/Dockerfile +140 -0
  4. package/LICENSE +201 -0
  5. package/README.md +306 -0
  6. package/THIRD_PARTY_NOTICES.md +279 -0
  7. package/changelog/0.1.x/0.1.1.md +20 -0
  8. package/changelog/template.md +151 -0
  9. package/dist/data/browserslist-bcd-map.d.ts +40 -0
  10. package/dist/data/browserslist-bcd-map.d.ts.map +1 -0
  11. package/dist/data/browserslist-bcd-map.js +42 -0
  12. package/dist/data/browserslist-bcd-map.js.map +1 -0
  13. package/dist/index.d.ts +7 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +51 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.d.ts +79 -0
  18. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.d.ts.map +1 -0
  19. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.js +213 -0
  20. package/dist/mcp-server/tools/definitions/browsercompat-check-baseline.tool.js.map +1 -0
  21. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.d.ts +103 -0
  22. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.d.ts.map +1 -0
  23. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.js +320 -0
  24. package/dist/mcp-server/tools/definitions/browsercompat-compare-support.tool.js.map +1 -0
  25. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.d.ts +110 -0
  26. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.d.ts.map +1 -0
  27. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.js +229 -0
  28. package/dist/mcp-server/tools/definitions/browsercompat-get-feature.tool.js.map +1 -0
  29. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.d.ts +40 -0
  30. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.d.ts.map +1 -0
  31. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.js +237 -0
  32. package/dist/mcp-server/tools/definitions/browsercompat-list-reference.tool.js.map +1 -0
  33. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.d.ts +79 -0
  34. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.d.ts.map +1 -0
  35. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.js +208 -0
  36. package/dist/mcp-server/tools/definitions/browsercompat-search-features.tool.js.map +1 -0
  37. package/dist/mcp-server/tools/definitions/compat-shapes.d.ts +96 -0
  38. package/dist/mcp-server/tools/definitions/compat-shapes.d.ts.map +1 -0
  39. package/dist/mcp-server/tools/definitions/compat-shapes.js +164 -0
  40. package/dist/mcp-server/tools/definitions/compat-shapes.js.map +1 -0
  41. package/dist/services/baseline/baseline-service.d.ts +45 -0
  42. package/dist/services/baseline/baseline-service.d.ts.map +1 -0
  43. package/dist/services/baseline/baseline-service.js +119 -0
  44. package/dist/services/baseline/baseline-service.js.map +1 -0
  45. package/dist/services/baseline/feature-resolver.d.ts +21 -0
  46. package/dist/services/baseline/feature-resolver.d.ts.map +1 -0
  47. package/dist/services/baseline/feature-resolver.js +85 -0
  48. package/dist/services/baseline/feature-resolver.js.map +1 -0
  49. package/dist/services/baseline/types.d.ts +83 -0
  50. package/dist/services/baseline/types.d.ts.map +1 -0
  51. package/dist/services/baseline/types.js +8 -0
  52. package/dist/services/baseline/types.js.map +1 -0
  53. package/dist/services/bcd/bcd-service.d.ts +89 -0
  54. package/dist/services/bcd/bcd-service.d.ts.map +1 -0
  55. package/dist/services/bcd/bcd-service.js +420 -0
  56. package/dist/services/bcd/bcd-service.js.map +1 -0
  57. package/dist/services/bcd/types.d.ts +54 -0
  58. package/dist/services/bcd/types.d.ts.map +1 -0
  59. package/dist/services/bcd/types.js +7 -0
  60. package/dist/services/bcd/types.js.map +1 -0
  61. package/dist/services/data-version/data-version-service.d.ts +21 -0
  62. package/dist/services/data-version/data-version-service.d.ts.map +1 -0
  63. package/dist/services/data-version/data-version-service.js +60 -0
  64. package/dist/services/data-version/data-version-service.js.map +1 -0
  65. package/dist/services/search/search-service.d.ts +37 -0
  66. package/dist/services/search/search-service.d.ts.map +1 -0
  67. package/dist/services/search/search-service.js +264 -0
  68. package/dist/services/search/search-service.js.map +1 -0
  69. package/dist/services/search/types.d.ts +37 -0
  70. package/dist/services/search/types.d.ts.map +1 -0
  71. package/dist/services/search/types.js +7 -0
  72. package/dist/services/search/types.js.map +1 -0
  73. package/dist/services/targets/targets-service.d.ts +58 -0
  74. package/dist/services/targets/targets-service.d.ts.map +1 -0
  75. package/dist/services/targets/targets-service.js +176 -0
  76. package/dist/services/targets/targets-service.js.map +1 -0
  77. package/dist/services/targets/types.d.ts +28 -0
  78. package/dist/services/targets/types.d.ts.map +1 -0
  79. package/dist/services/targets/types.js +7 -0
  80. package/dist/services/targets/types.js.map +1 -0
  81. package/package.json +118 -0
  82. package/server.json +99 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Casey Hand @cyanheads
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,306 @@
1
+ <div align="center">
2
+ <h1>@cyanheads/browser-compat-mcp-server</h1>
3
+ <p><b>Browser compatibility and Baseline status for any web feature — offline, from MDN's browser-compat-data, web-features, and caniuse. STDIO or Streamable HTTP.</b>
4
+ <div>5 Tools</div>
5
+ </p>
6
+ </div>
7
+
8
+ <div align="center">
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/)
11
+
12
+ </div>
13
+
14
+ <div align="center">
15
+
16
+ [![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/browser-compat-mcp-server/releases/latest/download/browser-compat-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=browser-compat-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvYnJvd3Nlci1jb21wYXQtbWNwLXNlcnZlciJdfQ==) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22browser-compat-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fbrowser-compat-mcp-server%22%5D%7D)
17
+
18
+ [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
19
+
20
+ </div>
21
+
22
+ ---
23
+
24
+ ## Overview
25
+
26
+ Web platform compatibility for frontend work: per-browser support from MDN's `@mdn/browser-compat-data`, Baseline state and dates from `web-features`, and browserslist target resolution weighted by `caniuse-lite` usage figures. Every dataset ships inside the package, so there are no runtime network calls, no API key, no rate limit, and no upstream to be down — the same answers come back air-gapped. Runs as a stdio process or a local Streamable HTTP server.
27
+
28
+ ### Tools
29
+
30
+ | Tool | Description |
31
+ |:---|:---|
32
+ | `browsercompat_list_reference` | Enumerate the reference vocabulary the other tools expect — BCD namespaces and browser ids, browserslist agents, Baseline states, groups, and ECMAScript snapshots. |
33
+ | `browsercompat_get_feature` | Full compatibility record for one feature: Baseline state, standards status, per-browser versions with flags and prefixes, MDN and specification links. |
34
+ | `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. |
35
+ | `browsercompat_search_features` | Find features by plain name or keyword when the canonical key is unknown, ranked with the field that matched. |
36
+ | `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. |
37
+
38
+ ---
39
+
40
+ ## Capability reference
41
+
42
+ ### `browsercompat_list_reference` <sub>tool</sub>
43
+
44
+ - One required `topic`: `bcd_namespaces` (12), `bcd_browsers` (17), `browserslist_agents` (19), `baseline_states` (4), `groups` (103), `snapshots` (11)
45
+ - Entries carry `id`, `label`, and `detail`, plus `count`, `reported`, `bcd_browser`, `usage_percent`, `maps_from`, or `spec_url` where the topic has them
46
+ - `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`
47
+
48
+ ---
49
+
50
+ ### `browsercompat_get_feature` <sub>tool</sub>
51
+
52
+ - 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
53
+ - `resolve: true` accepts the search index's single unambiguous top hit; off by default, so a typo returns a miss rather than a confident answer about the wrong feature
54
+ - `include_runtimes: true` adds `bun`, `deno`, `nodejs`, and `oculus` rows to the 13 reported desktop and mobile browsers
55
+ - `outcome` is `found` | `no_compat_data` | `miss` — a miss is `found: false` with `guidance`, never an error
56
+ - 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
57
+ - Typed failure: `invalid_feature_input` (whitespace-only `feature`)
58
+
59
+ ---
60
+
61
+ ### `browsercompat_check_baseline` <sub>tool</sub>
62
+
63
+ - Up to 20 BCD keys or web-features ids per call, 1–200 characters each; one result per entry, in input order
64
+ - 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
65
+ - `usage_percent_excluded` is absent — never zero — when the feature reaches no caniuse id
66
+ - `all_widely_available` answers the Baseline question alone: every entry resolved at `widely`, one miss forces it false, and deprecation does not enter it
67
+ - Typed failure: `invalid_feature_input` (a whitespace-only entry)
68
+
69
+ ---
70
+
71
+ ### `browsercompat_search_features` <sub>tool</sub>
72
+
73
+ - `query` 1–100 characters, with optional `namespace` (one of the 12 BCD namespaces) and `baseline` (`widely` | `newly` | `limited` | `not_mapped`) filters; `limit` 1–50, default 10
74
+ - Every hit carries `matched_on`, the field that matched, so the six-tier ranking is inspectable rather than a score
75
+ - `support_summary` is one line across the seven Baseline core browsers, with `—` for unsupported and `?` for unknown
76
+ - Zero hits are a successful empty result plus a notice naming which filter to drop; `totalCount` and `truncated` report matches beyond `limit`
77
+ - Typed failure: `invalid_query` (a query that normalizes to zero tokens)
78
+
79
+ ---
80
+
81
+ ### `browsercompat_compare_support` <sub>tool</sub>
82
+
83
+ - 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
84
+ - `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`)
85
+ - `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
86
+ - `target_coverage_percent` and `unchecked_coverage_percent` give the caniuse-derived traffic share of the evaluated and unevaluated tokens
87
+ - Typed failures: `invalid_target_query`, `no_targets_resolved`, `invalid_feature_input`
88
+
89
+ ---
90
+
91
+ ## Data sources
92
+
93
+ | Package | Version | License | Supplies |
94
+ |:---|:---|:---|:---|
95
+ | [`@mdn/browser-compat-data`](https://github.com/mdn/browser-compat-data) | `^8.1.1` | CC0-1.0 | Per-browser support, standards status, MDN and specification links |
96
+ | [`web-features`](https://github.com/web-platform-dx/web-features) | `^3.38.0` | Apache-2.0 | Baseline state and dates, discouraged flags, groups, ECMAScript snapshots |
97
+ | [`caniuse-lite`](https://github.com/browserslist/caniuse-lite) | `^1.0.30001810` | CC-BY-4.0 | Usage weighting, plus feature titles for the search index |
98
+ | [`browserslist`](https://github.com/browserslist/browserslist) | `^4.29.0` | MIT | Target query resolution and coverage figures |
99
+
100
+ 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
+
102
+ ---
103
+
104
+ ## Features
105
+
106
+ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): stdio and Streamable HTTP transports, pluggable auth (`none` / `jwt` / `oauth`), swappable storage (`in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`), structured logging with optional OpenTelemetry tracing.
107
+
108
+ Browser-compat-specific:
109
+
110
+ - All four datasets are bundled and loaded in process — no runtime network calls, no API key, no rate limit, and nothing to configure
111
+ - Baseline is read per browser-compat-data key from `status.by_compat_key`, never rolled up from the feature level, because keys under one feature legitimately disagree
112
+ - One shared resolver behind every tool: exact BCD key, then web-features id, then a `moved` redirect, and only under `resolve: true` the search index's single unambiguous hit
113
+ - Target versions are ordered by browser-compat-data's release index rather than parsed version strings, with the caniuse spellings normalized both directions (`safari 16.0` ↔ `16`, `samsung 20` ↔ `20.0`)
114
+
115
+ Agent-friendly output:
116
+
117
+ - 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
118
+ - 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
+ - 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
120
+ - Usage figures state the population they are a share of, and carry the caniuse attribution on every response that reports one
121
+
122
+ ---
123
+
124
+ ## Getting started
125
+
126
+ Add the following to your MCP client configuration file:
127
+
128
+ ```json
129
+ {
130
+ "mcpServers": {
131
+ "browser-compat-mcp-server": {
132
+ "type": "stdio",
133
+ "command": "bunx",
134
+ "args": ["@cyanheads/browser-compat-mcp-server@latest"],
135
+ "env": {
136
+ "MCP_TRANSPORT_TYPE": "stdio",
137
+ "MCP_LOG_LEVEL": "info"
138
+ }
139
+ }
140
+ }
141
+ }
142
+ ```
143
+
144
+ Or with npx (no Bun required):
145
+
146
+ ```json
147
+ {
148
+ "mcpServers": {
149
+ "browser-compat-mcp-server": {
150
+ "type": "stdio",
151
+ "command": "npx",
152
+ "args": ["-y", "@cyanheads/browser-compat-mcp-server@latest"],
153
+ "env": {
154
+ "MCP_TRANSPORT_TYPE": "stdio",
155
+ "MCP_LOG_LEVEL": "info"
156
+ }
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
162
+ Or with Docker:
163
+
164
+ ```json
165
+ {
166
+ "mcpServers": {
167
+ "browser-compat-mcp-server": {
168
+ "type": "stdio",
169
+ "command": "docker",
170
+ "args": [
171
+ "run", "-i", "--rm",
172
+ "-e", "MCP_TRANSPORT_TYPE=stdio",
173
+ "ghcr.io/cyanheads/browser-compat-mcp-server:latest"
174
+ ]
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ For Streamable HTTP, set the transport and start the server:
181
+
182
+ ```sh
183
+ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
184
+ # Server listens at http://localhost:3010/mcp
185
+ ```
186
+
187
+ ### Prerequisites
188
+
189
+ - [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+).
190
+ - No API keys, accounts, or network access required — every dataset ships with the package.
191
+
192
+ ### Installation
193
+
194
+ 1. **Clone the repository:**
195
+
196
+ ```sh
197
+ git clone https://github.com/cyanheads/browser-compat-mcp-server.git
198
+ ```
199
+
200
+ 2. **Navigate into the directory:**
201
+
202
+ ```sh
203
+ cd browser-compat-mcp-server
204
+ ```
205
+
206
+ 3. **Install dependencies:**
207
+
208
+ ```sh
209
+ bun install
210
+ ```
211
+
212
+ 4. **Configure environment (optional):**
213
+
214
+ ```sh
215
+ cp .env.example .env
216
+ # edit .env if you want to override transport or logging defaults
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Configuration
222
+
223
+ 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.
224
+
225
+ | Variable | Description | Default |
226
+ |:---------|:------------|:--------|
227
+ | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
228
+ | `MCP_HTTP_PORT` | Port for the HTTP server. | `3010` |
229
+
230
+ See [`.env.example`](./.env.example) for the full list of optional framework overrides.
231
+
232
+ ---
233
+
234
+ ## Running the server
235
+
236
+ ### Local development
237
+
238
+ ```sh
239
+ # One-time build
240
+ bun run rebuild
241
+
242
+ # Run the built server
243
+ bun run start:stdio
244
+ # or
245
+ bun run start:http
246
+ ```
247
+
248
+ ```sh
249
+ bun run devcheck # Lint, format, typecheck, security
250
+ bun run test # Vitest test suite
251
+ bun run lint:mcp # Validate MCP definitions against spec
252
+ ```
253
+
254
+ ### Docker
255
+
256
+ ```sh
257
+ docker build -t browser-compat-mcp-server .
258
+ docker run --rm -p 3010:3010 browser-compat-mcp-server
259
+ ```
260
+
261
+ The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/browser-compat-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.
262
+
263
+ ---
264
+
265
+ ## Project structure
266
+
267
+ | Directory | Purpose |
268
+ |:----------|:--------|
269
+ | `src/index.ts` | `createApp()` entry point — registers the tools and warms the datasets. |
270
+ | `src/data/` | The browserslist agent to browser-compat-data browser map. |
271
+ | `src/mcp-server/tools/` | Tool definitions (`*.tool.ts`) and the output shapes they share. |
272
+ | `src/services/` | bcd, baseline, targets, search, and data-version services over the bundled datasets. |
273
+ | `src/types/` | Ambient module declaration for `caniuse-lite`, which ships no types. |
274
+ | `tests/` | Vitest suites mirroring `src/`. |
275
+ | `docs/` | `design.md` — the surface, the data shapes behind it, and the decisions log. |
276
+ | `changelog/` | Per-version changelog files. |
277
+
278
+ The generated file tree is [`docs/tree.md`](./docs/tree.md).
279
+
280
+ ---
281
+
282
+ ## Development guide
283
+
284
+ See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
285
+
286
+ - Handlers throw, framework catches — no `try/catch` in tool logic
287
+ - Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage
288
+ - Register new tools directly in `src/index.ts`
289
+ - Data integrity: read the bundled datasets as they are and preserve their uncertainty; never fabricate a support fact the data does not carry
290
+
291
+ ---
292
+
293
+ ## Contributing
294
+
295
+ Issues are welcome. Run checks and tests before submitting:
296
+
297
+ ```sh
298
+ bun run devcheck
299
+ bun run test
300
+ ```
301
+
302
+ ---
303
+
304
+ ## License
305
+
306
+ Apache-2.0 — see [LICENSE](LICENSE) for details.