Skip to main content

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

Currently indexed:

  • HTML - WHATWG HTML Living Standard
  • DOM - WHATWG DOM Living Standard
  • URL - WHATWG URL Living Standard
  • INFRA - WHATWG Infra Living Standard

More specs (Fetch, Encoding, Streams, etc.) coming soon!

How It Works

  1. Fetches spec HTML from WHATWG/W3C GitHub repositories
  2. Parses sections, algorithms, IDL definitions, and cross-references
  3. Indexes in SQLite with FTS5 for fast full-text search
  4. 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

webspec_index-0.3.0.tar.gz (66.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

webspec_index-0.3.0-cp312-cp312-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.12Windows x86-64

webspec_index-0.3.0-cp312-cp312-manylinux_2_38_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.38+ x86-64

webspec_index-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file webspec_index-0.3.0.tar.gz.

File metadata

  • Download URL: webspec_index-0.3.0.tar.gz
  • Upload date:
  • Size: 66.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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

Hashes for webspec_index-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b7f320730cdbdd9ff01afe82b83e3d4d4dc83ad7a8404c6d6d30b04547ff91ea
MD5 58febdc8fa607695aaccc911ef60a7ea
BLAKE2b-256 708e51686c4a2991f8c10b5a7fafae7d6345a7b57c1fd7810bdcdd8f4839055e

See more details on using hashes here.

File details

Details for the file webspec_index-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: webspec_index-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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

Hashes for webspec_index-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7427bc1b99f0e4e6770660c778d4031fd16be908a7ae4b1bc8d5382faeca64b4
MD5 cba37185edf70d2513af351b82de3b6d
BLAKE2b-256 f8756c98869741d776fff4091b2ff93a2d6ebf061cd287615e52ce3b524bc0ab

See more details on using hashes here.

File details

Details for the file webspec_index-0.3.0-cp312-cp312-manylinux_2_38_x86_64.whl.

File metadata

  • Download URL: webspec_index-0.3.0-cp312-cp312-manylinux_2_38_x86_64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.12, manylinux: glibc 2.38+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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

Hashes for webspec_index-0.3.0-cp312-cp312-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 b26fc8863a66a84f17c3db0aa75a27c863d16fa40db61947987e64e1d30c50b7
MD5 88488aa8dc7b7ce960f40f109cf35526
BLAKE2b-256 b99799b075db56f2452ad8c2f0c3d81220f794edb4f2cf351b009cd19dc3ca53

See more details on using hashes here.

File details

Details for the file webspec_index-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: webspec_index-0.3.0-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.0 {"installer":{"name":"uv","version":"0.10.0","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

Hashes for webspec_index-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df07503ec082ecad22448571ae21438a76aed7086defdae9f3816c0ef2b85938
MD5 43e9bae225fe2fb27e0cc6c90e1f72b7
BLAKE2b-256 c9cc8dc46ff62461d0239717ef1f83143470f8cedc376fec732b20372f66e9f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page