Query WHATWG/W3C web specifications for AI agents and developers
Project description
webspec-index
Query WHATWG/W3C web specifications from the command line, Python code, or AI agents (MCP).
Features
- Full-text search across HTML, DOM, URL, and other specifications
- Cross-reference tracking (incoming/outgoing references between specs)
- Fast SQLite-based indexing with FTS5 for instant queries
- Three interfaces: CLI, Python library, and MCP server for AI agents
Installation
pip install webspec-index
Or run directly with uvx (no installation needed):
uvx webspec-index query HTML#navigate
If you install via pip, the webspec-index command is available globally.
With uvx, prefix every command with uvx webspec-index instead.
The examples below assume pip install.
Quick Start
Command Line
# Query a specific section
webspec-index query HTML#navigate
# Search across all specs
webspec-index search "tree order" --spec DOM
# Check if a section exists (exit code 0 = found, 1 = not found)
webspec-index exists HTML#navigate
# Find anchors by pattern
webspec-index anchors "*-tree" --spec DOM
# List all headings
webspec-index list HTML
# Get cross-references
webspec-index refs HTML#navigate --direction incoming
# Update to latest spec versions
webspec-index update --spec HTML
# Clear local database
webspec-index clear-db
Most commands support --format json (default) or --format markdown.
Python Library
import webspec_index
# Query a section
result = webspec_index.query("HTML#navigate")
print(result["title"]) # "navigate"
print(result["section_type"]) # "Algorithm"
# Search
results = webspec_index.search("tree order", spec="DOM", limit=5)
for r in results["results"]:
print(f"{r['spec']}#{r['anchor']}: {r['snippet']}")
# Check existence
if webspec_index.exists("HTML#navigate"):
print("Section found!")
MCP Server (AI Agents)
Start the MCP server for use with Claude Code or other AI agents:
claude mcp add webspec-index -- uvx webspec-index mcp
Available Specifications
This should support most specs from WHATWG, W3C and TC39.
How It Works
- Fetches spec HTML from WHATWG/W3C GitHub repositories
- Parses sections, algorithms, IDL definitions, and cross-references
- Indexes in SQLite with FTS5 for fast full-text search
- Tracks versions using git commit SHAs for reproducibility
Development
Built with:
- Rust for fast parsing and indexing (scraper, rusqlite, reqwest)
- PyO3 for zero-cost Python bindings
- Maturin for packaging
- Click for CLI
- MCP (Model Context Protocol) for AI agent integration
License
MIT
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webspec_index-0.4.1.tar.gz.
File metadata
- Download URL: webspec_index-0.4.1.tar.gz
- Upload date:
- Size: 137.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef0f912bcbcefa3c2799afd65a1d2abcd929d41e998a7b3056af8c0615aaa3cb
|
|
| MD5 |
0f0054213d1b00a7188a0bcc503ae459
|
|
| BLAKE2b-256 |
b217b6271ccce7f770ed0f17a3f0c02ec517e374d5fe1eee2f7f1a786fded3c3
|
File details
Details for the file webspec_index-0.4.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: webspec_index-0.4.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6435adc24397702e07c2cc5742fd1f5fbc1b8f1dc8703b44d7d75b7d8f8750a0
|
|
| MD5 |
c03ec4cc9ceeebdc8d0ce7656d0d1f3c
|
|
| BLAKE2b-256 |
6ade67afd179dd4ffab76bdbd45718ec31f4e6b28a74065ac1d869d79d627ddb
|
File details
Details for the file webspec_index-0.4.1-cp312-cp312-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: webspec_index-0.4.1-cp312-cp312-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.38+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61ca466bc42faa3beff5d171a8ef1a32b54c07649f1b9907f8ce9ef873bd3e7a
|
|
| MD5 |
5c5d0ae9d3f5b26576047a565a002505
|
|
| BLAKE2b-256 |
18aff805bb563b4b2ff5e9a39548e9fc4d921eb2a1bdb62bc815bf6760acf578
|
File details
Details for the file webspec_index-0.4.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: webspec_index-0.4.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f01ce9ffa850c2378a360e66ec503ea2eaaa98f361ba5296682860d36e8f202
|
|
| MD5 |
f4e6918dc8bb3b198c64c1414eb00ef1
|
|
| BLAKE2b-256 |
4f716ab3f55ea768b1a832aa64ee6fe543e3687f4ba800120223f2b9c119bbe2
|