This package defines Typescript types (.d.ts) for the WebMCP specification.
Use this package to augment the ambient "dom" type definitions with the new definitions for WebMCP.
See the TypeScript handbook.
- npm:
npm install --save-dev webmcp-types - yarn:
yarn add --dev webmcp-types - pnpm:
pnpm add -D webmcp-types
This package requires TypeScript 5.0 or newer.
Since this package is outside DefinitelyTyped, the dependency won't be picked up automatically. There are several ways to add a additional TypeScript type definition dependencies to your TypeScript project:
In tsconfig.json:
{
// ...
"compilerOptions": {
// ...
"types": ["webmcp-types"]
}
}Or you can use typeRoots:
{
// ...
"compilerOptions": {
// ...
"typeRoots": ["./node_modules/webmcp-types", "./node_modules/@types"]
}
}This may work better if your toolchain doesn't read tsconfig.json.
/// <reference types="webmcp-types" />If you use Webpack and the options above aren't sufficient (this has not been verified),
you may need the following in webpack.config.js:
"types": ["webmcp-types"]npm installnpm test
The tests in index.test-d.ts are statically checked with Vitest typecheck mode against tsconfig.json; they are never executed.
Release Please keeps a release pull request open with the next version and changelog, based on Conventional Commits on main. Merging it creates the GitHub release and publishes to npm through trusted publishing; no npm token or local publish step is needed.
