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

This should support most specs from WHATWG, W3C and TC39.

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.4.0.tar.gz (137.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.4.0-cp312-cp312-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.12Windows x86-64

webspec_index-0.4.0-cp312-cp312-manylinux_2_38_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.38+ x86-64

webspec_index-0.4.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.4.0.tar.gz.

File metadata

  • Download URL: webspec_index-0.4.0.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

Hashes for webspec_index-0.4.0.tar.gz
Algorithm Hash digest
SHA256 84375d86803ae3b4d0b1ca6276f7dd23559dc2fcbf43ce8ef2b34484d6a8a85d
MD5 8785345053b2c7dba870baa9b03c7639
BLAKE2b-256 2c3dbeda2cce2de0a8ea926feae21f3f6e0acef89732aac145c325f3570067d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.4.0-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

Hashes for webspec_index-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 161ebed25030698c15b512be5727a286213ba78f2da07b633ae08ed02955567e
MD5 4950b433e7593d421c1436d3614b7574
BLAKE2b-256 6f4b5ee1195a67375cf27d106700c4585ee0229e0908f4b3496b4e72b5da7ed1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.4.0-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

Hashes for webspec_index-0.4.0-cp312-cp312-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 0f5c62b040bb964b87fed557454bcd72cd317bbc09a68458e5803d8fd9a7da28
MD5 ba27e7ecc25ca1f9d2192d7bcb24701b
BLAKE2b-256 7fc2c2c780b7b7c0453eb7d329198e7489618556c33653e61a3eb85efcdd057c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.4.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.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

Hashes for webspec_index-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1d7e6d5b3a3ba273fa375ea3dd8673198151a66267010cafdd97bb5753a42f7
MD5 bacb1a9ead9aa292752a629f6aa297b5
BLAKE2b-256 b6764a09d272c338c069ece08c8a948d8a1896c439f60ebbdca6b0ff3e340624

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