mdn-mcp
v1.0.0
Published
MCP server for MDN Web Docs — search documentation, fetch pages, check browser compatibility, browse features, CSS definitions, and HTTP reference.
Maintainers
Readme
mdn-mcp
MCP server for MDN Web Docs — search documentation, fetch pages, and check browser compatibility right from your AI assistant.
Features
| Tool | Description | Data Source |
|------|-------------|-------------|
| mdn_search | Search MDN by keyword | MDN Search API (remote) |
| mdn_doc | Fetch full documentation for a page | MDN JSON API (remote) |
| mdn_compat | Browser compatibility check | @mdn/browser-compat-data (offline) |
| mdn_list | Browse & discover BCD features by namespace | @mdn/browser-compat-data (offline) |
| mdn_css | CSS property formal definitions | mdn-data (offline) |
| mdn_http | HTTP headers, status codes, methods reference | @mdn/browser-compat-data (offline) |
Setup
No installation needed — just configure your MCP client:
Add to .vscode/mcp.json:
{
"servers": {
"mdn": {
"command": "npx",
"args": ["-y", "mdn-mcp"]
}
}
}Add to .cursor/mcp.json:
{
"mcpServers": {
"mdn": {
"command": "npx",
"args": ["-y", "mdn-mcp"]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"mdn": {
"command": "npx",
"args": ["-y", "mdn-mcp"]
}
}
}Add to claude_desktop_config.json:
{
"mcpServers": {
"mdn": {
"command": "npx",
"args": ["-y", "mdn-mcp"]
}
}
}claude mcp add --transport stdio mdn -- npx -y mdn-mcpOr add to .mcp.json (shared with team):
{
"mcpServers": {
"mdn": {
"command": "npx",
"args": ["-y", "mdn-mcp"]
}
}
}Add to settings.json:
{
"context_servers": {
"mdn": {
"command": "npx",
"args": ["-y", "mdn-mcp"]
}
}
}Open Settings → Tools → AI Assistant → MCP, click +, and paste:
{
"mcpServers": {
"mdn": {
"command": "npx",
"args": ["-y", "mdn-mcp"]
}
}
}gemini mcp add mdn -- npx -y mdn-mcpOr add to ~/.gemini/settings.json:
{
"mcpServers": {
"mdn": {
"command": "npx",
"args": ["-y", "mdn-mcp"]
}
}
}Any MCP client that supports stdio transport can use this server. The command is:
npx -y mdn-mcpSee the full list of MCP clients.
Local development
git clone https://github.com/anvme/mdn-mcp.git
cd mdn-mcp
npm install
node index.jsTool Reference
mdn_search
Search MDN Web Docs by keyword.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| query | string | yes | — | Search query |
| limit | number | no | 5 | Max results (1–20) |
Example: { "query": "Array.map", "limit": 3 }
mdn_doc
Fetch full documentation for a specific MDN page. Supports pagination for large pages.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| path | string | yes | — | MDN doc path or full URL |
| sections | string[] | no | — | Filter sections: syntax, description, parameters, return_value, examples, see_also |
| max_length | number | no | 5000 | Max characters to return (500–50000) |
| start_index | number | no | 0 | Character offset for pagination |
Example: { "path": "Web/CSS/grid", "sections": ["syntax", "description"] }
mdn_compat
Check browser compatibility for a web feature. Works offline.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| feature | string | yes | BCD feature path, e.g. css.properties.grid, api.fetch, javascript.builtins.Array.map |
Example: { "feature": "javascript.builtins.Array.map" }
Returns a Markdown table with version support for Chrome, Edge, Firefox, Safari, Opera, iOS Safari, Chrome Android, Firefox Android, Node.js, Deno, and Bun.
mdn_list
Browse and discover BCD features by namespace. Filter by keyword or status.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| path | string | no | "" | BCD path to browse, e.g. css.properties, api, javascript.builtins |
| query | string | no | — | Filter features by keyword |
| deprecated | boolean | no | — | true = only deprecated, false = exclude deprecated |
| experimental | boolean | no | — | true = only experimental, false = exclude experimental |
| limit | number | no | 50 | Max features to return (1–200) |
Examples:
{ "path": "css.properties", "query": "grid" }— find CSS grid-related properties{ "path": "api", "deprecated": true, "limit": 20 }— list deprecated Web APIs{ "path": "" }— show all top-level BCD namespaces
mdn_css
Get CSS property formal definitions — syntax, initial value, inheritance, computed value, animation type, and more. Works offline.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| name | string | yes | CSS property, function, at-rule, selector, type, or unit name |
Examples:
{ "name": "grid" }— full grid shorthand definition{ "name": "display" }— display property formal syntax{ "name": ":hover" }— :hover selector info{ "name": "calc" }— calc() function info
mdn_http
Browse HTTP reference data — headers, status codes, methods, with browser compatibility.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| topic | string | no | "" | HTTP topic path, e.g. headers, headers.Content-Type, status.200 |
Examples:
{ "topic": "" }— list all HTTP categories{ "topic": "headers" }— list all HTTP headers{ "topic": "headers.Content-Type" }— browser compat for Content-Type{ "topic": "status" }— list all HTTP status codes
Prerequisites
- Node.js >= 18
License
MIT
