w3c-mcp

w3c-mcp

MCP Server for accessing W3C/WHATWG/IETF web specifications. Provides AI assistants with access to official web standards data including specifications, WebIDL definitions, CSS properties, and HTML elements.

Category
访问服务器

README

W3C MCP Server

npm version License: MIT Node.js MCP Built with Claude Code

MCP Server for accessing W3C/WHATWG/IETF web specifications. Provides AI assistants with access to official web standards data including specifications, WebIDL definitions, CSS properties, and HTML elements.

Installation

npm install -g @shuji-bonji/w3c-mcp

Or use directly with npx:

npx @shuji-bonji/w3c-mcp

Configuration

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "w3c": {
      "command": "npx",
      "args": ["-y", "@shuji-bonji/w3c-mcp"]
    }
  }
}

Cursor

Add to your Cursor MCP settings (.cursor/mcp.json in your project or global settings):

{
  "mcpServers": {
    "w3c": {
      "command": "npx",
      "args": ["-y", "@shuji-bonji/w3c-mcp"]
    }
  }
}

Available Tools

Specification Discovery

list_w3c_specs

List W3C/WHATWG/IETF web specifications with optional filtering.

Parameters:

  • organization (optional): Filter by organization - "W3C", "WHATWG", "IETF", or "all"
  • keyword (optional): Filter by keyword in title or shortname
  • category (optional): Filter by category
  • limit (optional): Maximum number of results (default: 50)

get_w3c_spec

Get detailed information about a specific web specification.

Parameters:

  • shortname (required): Specification shortname (e.g., "service-workers", "appmanifest", "fetch")

search_w3c_specs

Search web specifications by query string.

Parameters:

  • query (required): Search query (e.g., "service worker", "manifest", "storage")
  • limit (optional): Maximum number of results (default: 20)

WebIDL

get_webidl

Get WebIDL interface definitions for a specification. WebIDL defines the JavaScript APIs.

Parameters:

  • shortname (required): Specification shortname (e.g., "service-workers", "fetch", "dom")

list_webidl_specs

List all specifications that have WebIDL definitions available.

CSS

get_css_properties

Get CSS property definitions from a specific spec or all specs.

Parameters:

  • spec (optional): Specification shortname (e.g., "css-grid-1", "css-flexbox-1")
  • property (optional): Search for a specific CSS property by name

list_css_specs

List all CSS specifications that have property definitions available.

HTML Elements

get_html_elements

Get HTML element definitions from a specific spec or all specs.

Parameters:

  • spec (optional): Specification shortname (e.g., "html", "svg")
  • element (optional): Search for a specific element by name (e.g., "video", "canvas")

list_element_specs

List all specifications that have HTML element definitions available.

PWA

get_pwa_specs

Get all Progressive Web App (PWA) related specifications.

Parameters:

  • coreOnly (optional): If true, return only the core PWA specs (Service Worker, Manifest, Push, Notifications)

get_spec_dependencies

Get dependency information for a specification.

Parameters:

  • shortname (required): Specification shortname

Usage Examples

Find Service Worker APIs

Use the get_webidl tool with shortname "service-workers" to see the ServiceWorker interface definitions.

Explore PWA Technologies

Use get_pwa_specs to see all PWA-related specifications, then use get_w3c_spec for details on each one.

Look up CSS Grid Properties

Use get_css_properties with spec "css-grid-1" to see all CSS Grid layout properties.

Search for Storage APIs

Use search_w3c_specs with query "storage" to find all storage-related specifications.

Data Sources

This MCP server uses the following W3C/webref data packages:

Package Description
web-specs Metadata for all web specifications
@webref/idl WebIDL interface definitions
@webref/css CSS properties and values
@webref/elements HTML element definitions

These packages are maintained by the W3C and provide machine-readable data extracted from official specifications.

GitHub Repositories:

  • https://github.com/w3c/browser-specs
  • https://github.com/w3c/webref

Debug Mode

Enable debug logging with environment variables:

# Enable debug logging
W3C_MCP_DEBUG=true npx @shuji-bonji/w3c-mcp

# Enable performance logging only
W3C_MCP_PERF=true npx @shuji-bonji/w3c-mcp

Debug output includes:

  • Tool call arguments
  • Execution timing
  • Data loading performance

Architecture

src/
├── index.ts          # MCP server entry point
├── data/
│   └── loader.ts     # Data loading with caching
├── tools/            # Tool implementations
│   ├── list-specs.ts
│   ├── get-spec.ts
│   ├── search-specs.ts
│   ├── get-webidl.ts
│   ├── get-css.ts
│   ├── get-elements.ts
│   └── get-pwa-specs.ts
├── schemas/
│   └── index.ts      # Zod validation schemas
├── errors/
│   └── index.ts      # Custom error classes
├── utils/
│   └── logger.ts     # Debug logging utilities
└── types/
    └── index.ts      # TypeScript type definitions

tests/
├── setup.ts          # Test setup
├── data/             # Data loader tests
├── tools/            # Tool tests
└── integration/      # MCP server integration tests

Performance

  • Startup: ~70ms parallel preloading of all data
  • Spec Lookup: O(1) using Map-based index
  • Search: Optimized with early termination on exact matches

Development

# Clone the repository
git clone https://github.com/shuji-bonji/w3c-mcp.git
cd w3c-mcp

# Install dependencies
npm install

# Build
npm run build

# Run in development mode
npm run dev

# Run with debug logging
W3C_MCP_DEBUG=true npm start

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Lint code
npm run lint

# Format code
npm run format

# Lint + format (auto-fix)
npm run check

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选