{"_id":"@absolutejs/webmcp","_rev":"6-08b69cd7ba9bbd0be0d46b50f71d9ce6","name":"@absolutejs/webmcp","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@absolutejs/webmcp","version":"0.1.0","author":{"name":"Alex Kahn"},"license":"MIT","_id":"@absolutejs/webmcp@0.1.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/webmcp","bugs":{"url":"https://github.com/absolutejs/webmcp/issues"},"dist":{"shasum":"d8fb1068d918dcdf2f20f86127b7344b1bac4b95","tarball":"https://registry.npmjs.org/@absolutejs/webmcp/-/webmcp-0.1.0.tgz","fileCount":13,"integrity":"sha512-NS8j24XTmyWDLaweApcKL9KYJu+AlkC7vDBC5LHr6KoVS4RMxNK3EGQLADXdL0xlb9KbumaZ4F0v0mlVJJdmTg==","signatures":[{"sig":"MEQCIBDyDyzwO3aSk0VWfqKf7eaV9kWpKYpjpQNzyJYsnAUOAiANngq3F5cn0PAsq/yotJ13aei1Fb7N6E8ZiGt7E1eGBw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20221},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"gitHead":"b2fb42aeb98c8b8c5b1e20c2a6d4f9ade4ed5277","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=browser --external @absolutejs/manifest --external @sinclair/typebox && tsc -p tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md,yml}\"","typecheck":"tsc --noEmit","check:package":"bun run format && bun run typecheck && bun run test && bun run build"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"absolutejs":{"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/webmcp.git","type":"git"},"_npmVersion":"10.9.2","description":"Secure WebMCP registration, policy, audit, and test adapters for browser-native AI agent actions.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/webmcp_0.1.0_1784179253749_0.06722309300154383","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@absolutejs/webmcp","version":"0.1.1","author":{"name":"Alex Kahn"},"license":"MIT","_id":"@absolutejs/webmcp@0.1.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/webmcp","bugs":{"url":"https://github.com/absolutejs/webmcp/issues"},"dist":{"shasum":"c95b9fbc35c598316e3c39e788d4efe7e9c54f21","tarball":"https://registry.npmjs.org/@absolutejs/webmcp/-/webmcp-0.1.1.tgz","fileCount":13,"integrity":"sha512-Hs7+QcKCxunc78XBHsYbImcGcy0+YHowZ6CntHp5VnuoaK5p0J9LVKl8XQIZJW/e5Ip/T66LN0bHoz3Ge0LSLA==","signatures":[{"sig":"MEQCIFYmuv79f0zBorsNPI1t2KL8M6v128JsSu6Lmueh3ApmAiBEteRiMFSflbm9U5JqCvEskcVw+6dRVuulBtGhpvgewg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20915},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"gitHead":"9d3e767a75a635c4d3ef43cc88ccbba23aca8f11","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=browser --external @absolutejs/manifest --external @sinclair/typebox && tsc -p tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md,yml}\"","typecheck":"tsc --noEmit","check:package":"bun run format && bun run typecheck && bun run test && bun run build"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"absolutejs":{"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/webmcp.git","type":"git"},"_npmVersion":"10.9.2","description":"Secure WebMCP registration, policy, audit, and test adapters for browser-native AI agent actions.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/webmcp_0.1.1_1784396894465_0.10016921681440838","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@absolutejs/webmcp","version":"0.1.2","author":{"name":"Alex Kahn"},"license":"MIT","_id":"@absolutejs/webmcp@0.1.2","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/webmcp","bugs":{"url":"https://github.com/absolutejs/webmcp/issues"},"dist":{"shasum":"dbb7e19c1a3ba98f1960b761e1668d9edb89a406","tarball":"https://registry.npmjs.org/@absolutejs/webmcp/-/webmcp-0.1.2.tgz","fileCount":14,"integrity":"sha512-tyDyPv3guJdZBNTruAEm2KUf75T63EAQXzIMwT3j3G4UGvRmhSAuj2dOONYYHMFd4025BosahLH9TQdaIbdHuQ==","signatures":[{"sig":"MEUCIQD5mOKlgxZpS8pdKbQNp0mCXa5cq01no9QEQ3jS7n7JIAIgUYjXmGMIGMNBv71zf+whSJs4y3hDFzChTXVUp3ZzM2E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32659},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"gitHead":"696736c89e720f887729280dd2b0b48ea25842e8","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=browser --external @absolutejs/manifest --external @sinclair/typebox && tsc -p tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md,yml}\"","typecheck":"tsc --noEmit","check:package":"bun run format && bun run typecheck && bun run test && bun run build"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"absolutejs":{"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/webmcp.git","type":"git"},"_npmVersion":"10.9.2","description":"Secure WebMCP registration, policy, audit, and test adapters for browser-native AI agent actions.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/webmcp_0.1.2_1784500595495_0.9135950906637025","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@absolutejs/webmcp","version":"0.1.3","author":{"name":"Alex Kahn"},"license":"MIT","_id":"@absolutejs/webmcp@0.1.3","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/webmcp","bugs":{"url":"https://github.com/absolutejs/webmcp/issues"},"dist":{"shasum":"bab51c79701b7f2913b2dfff407c92d4239e8877","tarball":"https://registry.npmjs.org/@absolutejs/webmcp/-/webmcp-0.1.3.tgz","fileCount":14,"integrity":"sha512-Um5JrZRoBo07S1Vc9aEy3byrVR7xwVmIsHsMaxHSsbeIl+RP/9L3i38yFgqOB9qHWJPJsSlsjtkRKu+jFuCGWw==","signatures":[{"sig":"MEYCIQCT4MEQE0LF1a14Hwp1VI3t9avXyhpsm8Md9nfzCsjlegIhALJ+w+uETnPjAONIaKe7p1ODKH7jP4l1foX5kKoaQEzk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32731},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"gitHead":"21fbdd9f115537ac14ac9e5d445d89b0cd015edc","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=browser --external @absolutejs/manifest --external @sinclair/typebox && tsc -p tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md,yml}\"","typecheck":"tsc --noEmit","check:package":"bun run format && bun run typecheck && bun run test && bun run build"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"absolutejs":{"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/webmcp.git","type":"git"},"_npmVersion":"10.9.2","description":"Secure WebMCP registration, policy, audit, and test adapters for browser-native AI agent actions.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/webmcp_0.1.3_1784501038481_0.3741271990847186","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@absolutejs/webmcp","version":"0.1.4","author":{"name":"Alex Kahn"},"license":"MIT","_id":"@absolutejs/webmcp@0.1.4","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/webmcp","bugs":{"url":"https://github.com/absolutejs/webmcp/issues"},"dist":{"shasum":"0e0abeb12cd51f40f27b1b961613cc1dfbe31564","tarball":"https://registry.npmjs.org/@absolutejs/webmcp/-/webmcp-0.1.4.tgz","fileCount":14,"integrity":"sha512-w6B/Lqh8UiolRX+gKTzAh/+sXvY5dje/0SJZmlqUVaFAmhpTSG2FGqx644W1vQNpAuvtY0b3bsx5MmrmVFeByg==","signatures":[{"sig":"MEYCIQDqB1h5uBau2pADJPkmW/uGGLGGLnSyx94Rtq8jhU+iFAIhAM+raV6K+aWOtSfWLq1CrbSZfhYu1/knllCg6UCpzvR7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33949},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"gitHead":"8e783033448e96e12ca895750ffb8180fb2e919e","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=browser --external @absolutejs/manifest --external @sinclair/typebox && tsc -p tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md,yml}\"","typecheck":"tsc --noEmit","check:package":"bun run format && bun run typecheck && bun run test && bun run build"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"absolutejs":{"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/webmcp.git","type":"git"},"_npmVersion":"10.9.2","description":"Secure WebMCP registration, policy, audit, and test adapters for browser-native AI agent actions.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/webmcp_0.1.4_1784527243816_0.7637149423949658","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@absolutejs/webmcp","version":"0.1.5","description":"Secure WebMCP registration, policy, audit, and test adapters for browser-native AI agent actions.","type":"module","license":"MIT","author":"Alex Kahn","repository":{"type":"git","url":"git+https://github.com/absolutejs/webmcp.git"},"homepage":"https://github.com/absolutejs/webmcp","bugs":{"url":"https://github.com/absolutejs/webmcp/issues"},"publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"absolutejs":{"manifestContract":2},"scripts":{"format":"prettier --write \"./**/*.{ts,json,md,yml}\"","typecheck":"tsc --noEmit","test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=browser --external @absolutejs/manifest --external @sinclair/typebox && tsc -p tsconfig.build.json && absolute-manifest emit","check:package":"bun run format && bun run typecheck && bun run test && bun run build"},"dependencies":{"@absolutejs/manifest":"^0.7.3","@sinclair/typebox":"^0.34.0"},"devDependencies":{"@types/bun":"^1.3.14","prettier":"^3.8.3","typescript":"^6.0.3"},"_id":"@absolutejs/webmcp@0.1.5","_integrity":"sha512-1/H2f9Ft4PH5vZezgFiKl2iNBagSj+1uvxERUQ1thRgiY7TRxF9CygxPBv6bW9N6CAXhA1s7tp3fYRP4or6Tjg==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"f447131b6098d6565a993bb7004d4407efbab876","dist":{"integrity":"sha512-1/H2f9Ft4PH5vZezgFiKl2iNBagSj+1uvxERUQ1thRgiY7TRxF9CygxPBv6bW9N6CAXhA1s7tp3fYRP4or6Tjg==","shasum":"f447131b6098d6565a993bb7004d4407efbab876","tarball":"https://registry.npmjs.org/@absolutejs/webmcp/-/webmcp-0.1.5.tgz","fileCount":14,"unpackedSize":34759,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH82pruAvM5XMGk3OloYGkw9gTEMS0HIX8PlJKPwOHTEAiBvzvbU8Ie4Ll1qJFA74ySSbYdS/D3ADyVCZWZYO/Vv/A=="}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/webmcp_0.1.5_1785091303703_0.22601241402237737"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T05:20:53.244Z","modified":"2026-07-26T18:41:44.000Z","0.1.0":"2026-07-16T05:20:53.915Z","0.1.1":"2026-07-18T17:48:14.597Z","0.1.2":"2026-07-19T22:36:35.641Z","0.1.3":"2026-07-19T22:43:58.604Z","0.1.4":"2026-07-20T06:00:43.988Z","0.1.5":"2026-07-26T18:41:43.842Z"},"bugs":{"url":"https://github.com/absolutejs/webmcp/issues"},"author":"Alex Kahn","license":"MIT","homepage":"https://github.com/absolutejs/webmcp","repository":{"type":"git","url":"git+https://github.com/absolutejs/webmcp.git"},"description":"Secure WebMCP registration, policy, audit, and test adapters for browser-native AI agent actions.","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"readme":"# @absolutejs/webmcp\n\nSecure, typed integration with the current WebMCP draft for browser-native AI\nagent actions.\n\nWebMCP lets a page expose structured tools through\n`document.modelContext.registerTool()`. AbsoluteJS keeps that standard surface\nand adds the controls a production application needs: TypeBox input validation,\ndefault-deny authorization over the exact input, approval IDs, metadata\npoisoning checks, bounded payloads, privacy-preserving audit receipts, secure\ncross-origin exposure, abort-based cleanup, atomic batch registration, and a\nspec-shaped test context.\n\n```ts\nimport { createWebMcpRegistry } from \"@absolutejs/webmcp\";\nimport { Type } from \"@sinclair/typebox\";\n\nconst tools = createWebMcpRegistry({\n  authorize: ({ name, input, annotations }) =>\n    agencyDecisionFor({ name, input, annotations }),\n  onAudit: (receipt) => audit.write(receipt),\n});\n\nawait tools.register({\n  name: \"support.create\",\n  title: \"Create support ticket\",\n  description: \"Create a support ticket after the user confirms the request.\",\n  inputSchema: Type.Object({ subject: Type.String({ maxLength: 100 }) }),\n  annotations: { readOnlyHint: false, untrustedContentHint: true },\n  execute: ({ subject }) => createTicket(subject),\n});\n```\n\nFor progressive enhancement in browsers where WebMCP may not be available,\nuse the non-throwing constructor:\n\n```ts\nimport { tryCreateWebMcpRegistry } from \"@absolutejs/webmcp\";\n\nconst tools = tryCreateWebMcpRegistry({ authorize });\nif (tools) await tools.register(tool);\n```\n\n`isWebMcpAvailable()` is also available for feature-gated UI. Keep using\n`createWebMcpRegistry()` when unsupported WebMCP should be treated as a\nconfiguration error.\n\nThe wrapper targets the July 10, 2026 Community Group draft, including the\n`Document.modelContext` location, promise-returning registration, abort-signal\nunregistration, exact `exposedTo` origins, and the `readOnlyHint` and\n`untrustedContentHint` annotations. WebMCP is a draft Community Group Report,\nnot yet a W3C Standard; keeping browser access behind `WebMcpModelContext`\nisolates draft changes from application code.\n\nUse `createWebMcpTestContext()` for deterministic unit and conformance tests in\nBun or Node. It deliberately adds `getTools()` and `executeTool()` only to the\ntest adapter; those methods are not presented as browser-standard APIs.\n\n## Same-origin HTTP actions\n\n`createWebMcpHttpProjectionDocument()` and\n`bootstrapWebMcpHttpActions()` project an authenticated application's typed\nHTTP actions without duplicating its domain implementation in the browser. The\nbootstrap accepts only origin-relative endpoints on the current trustworthy\norigin, sends credentials only with same-origin requests, refuses redirects,\nbounds documents and responses before parsing, validates every tool, and rolls\nback the complete registration if any tool fails. It never uses `exposedTo`, so\ncross-origin frames receive no capability by default.\n\nThe HTTP server remains the authorization and audit boundary. The browser\nregistry validates structured input and metadata, but a successful tool call\nstill requires the server's current session, resource, and domain checks.\n\n```ts\nconst mounted = await bootstrapWebMcpHttpActions({\n  manifestPath: \"/api/owner/webmcp\",\n  actionBasePath: \"/api/owner/webmcp/actions/\",\n  formats: {\n    uuid: (value) => /^[0-9a-f-]{36}$/iu.test(value),\n  },\n});\n\n// Unregister every tool when the authenticated page unmounts or signs out.\nmounted.dispose();\n```\n\nSpecification: <https://webmachinelearning.github.io/webmcp/>\n\n## License\n\nMIT\n","readmeFilename":"README.md"}