Browser agents are a second user of every web app now: Chrome’s WebMCP
preview exposes navigator.modelContext, computer-use models drive pages
through the accessibility tree, and in-page copilots call whatever a page lets
them. Today they all guess what a widget does.
tekivex-ui/webmcp lets your components declare what they do — and runs
every agent call through the same security kernel as the rest of the library.
navigator.modelContext.registerTool() when the browser has it, plus a
frozen window.__tekivex_agent_tools__ snapshot and an inert
<script type="application/tekivex-agent-tools+json"> manifest in
<head> — so agents that only see a DOM dump still find the catalog.
Validation + sanitisation
Required keys, enums, bounds and patterns enforced; unknown keys rejected;
__proto__ stripped; control, bidi and zero-width characters removed from
every string before your handler sees it.
Confirmation gates
requiresConfirmation: true tools refuse to run until a human approves
in TkxAgentConfirm. No confirm UI mounted → the tool refuses. Fail closed.
Rate limit + audit
Per-tool token bucket (30 calls / min by default). Every registration,
call and refusal lands in the SHA-256 hash-chained audit log.
Names are namespace.verb_noun; descriptions must be at least 20 characters
because agents choose tools by reading them. The latest handler is always
used, so no useCallback is needed. Unmount unregisters.