webmcp-react AGENTS.md

A contributor guide for webmcp-react, a React library that implements the WebMCP standard for exposing web-app capabilities to AI agents. It covers the library’s structure, commands, API references, and design decisions.

In plain words
What is it for?
Use it when installing, building, testing, type-checking, linting, or contributing to webmcp-react. It also points contributors to the WebMCP specification and API documentation.
Why use it?
It gives coding agents the project context they need before changing the library, reducing the risk of treating intentional architecture or documentation as bugs.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/agentcathq/webmcp-react/agents-md
Clone the repo
git clone --depth 1 https://github.com/agentcathq/webmcp-react

Made for: Codex, OpenCode.

Per session 1,403 This file is loaded in full into every session.
When invoked 1,403 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01403 $0.01403
Opus 5 $0.00701 $0.00701
Sonnet 5 $0.00281 $0.00281
Haiku 4.5 $0.00140 $0.00140

Measured 2d ago against content hash c26e8abc6c4a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

webmcp-react AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

This file is for AI agents contributing to the webmcp-react library. For integrating webmcp-react into your app, see the skills/ directory.

Reference

Commands

Task Command
Install pnpm install
Build pnpm build
Test pnpm test
Test (watch) pnpm test:watch
Test (single file) pnpm test -- path/to/file.test.tsx
Type check pnpm typecheck
Lint pnpm lint
Lint + fix pnpm lint:fix
Full check before PR pnpm build && pnpm typecheck && pnpm lint && pnpm test

Project Structure

src/                    ← core library (your focus)
├── index.ts            ← public API exports
├── types.ts            ← all TypeScript types
├── context.tsx         ← WebMCPProvider + useWebMCPStatus hook
├── hooks/
│   └── useMcpTool.ts   ← main hook for tool registration
├── polyfill/           ← document.modelContext polyfill
│   ├── index.ts        ← installPolyfill / cleanupPolyfill + polyfill marker
│   ├── registry.ts     ← in-memory tool storage
│   ├── testing-shim.ts ← simulates MCP client calls
│   └── validation.ts   ← input validation against JSON Schema
└── utils/
    ├── schema.ts       ← Zod → JSON Schema conversion + schema fingerprinting
    └── warn.ts         ← dev-only fire-once warnings

Other directories (don't modify unless explicitly asked):

  • extension/ — Chrome extension that bridges web tools to desktop MCP clients
  • examples/playground/ — Wordle demo showcasing dynamic tool registration
  • examples/nextjs/ — Next.js integration example
  • skills/ — agent skills for consumers of the library
  • docs/api.md — full API reference

Architecture Decisions — Don't "Fix" These

These patterns look like they could be simplified but exist for specific reasons:

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 104 lines · 1,403 tokens per session scan A c26e8abc6c4a

Subscribe to this mod's changes

webmcp-react AGENTS.md is an instructions file published in the GitHub repository agentcathq/webmcp-react (46 stars, last pushed 9d ago), licensed MIT. It adds 1,403 tokens to every session, about $0.0070 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

xahau-mcp CLAUDE.md

Claude Code instructions for Hugegreencandle/xahau-mcp, covering xahau-mcp — agent guide, what it does, layout (src/), build / test / run and honesty rules (the product's credibility).

Hugegreencandle/xahau-mcp · 716 tokens

agentboard AGENTS.md

AGENTS.md instructions for Vladev0/agentboard, covering agentboard — conventions for agents, quick start for a new agent, 1. primary path — mcp tools, project memory — a graph of knowledge notes and protocol for long loop/cycle sessions.

Vladev0/agentboard · 4,236 tokens

harvey-design-system-mcp AGENTS.md

AGENTS.md instructions for thenpceo/harvey-design-system-mcp: Run the local server yourself and open the preview in the browser available to this environment. Do not give the user server-start instructions when you can run it.

thenpceo/harvey-design-system-mcp · 1,196 tokens

synapse CLAUDE.md

Instructions for NimbleBrainInc/synapse, covering @nimblebrain/synapse, verification, releasing, hard rules and where spec types are used.

NimbleBrainInc/synapse · 3,046 tokens

teadata-mcp AGENTS.md

AGENTS.md instructions for adpena/teadata-mcp, covering repository guidelines, project structure & module organization, build, test, and development commands, coding style & naming conventions and testing guidelines.

adpena/teadata-mcp · 598 tokens

teadata-mcp GEMINI.md

Gemini CLI instructions for adpena/teadata-mcp, covering project context: teadata-mcp, technology stack, backend, frontend and directory structure.

adpena/teadata-mcp · 943 tokens