Skip to content

docs: explain the clash with webmcp-types - #76

Merged
kashishhora merged 2 commits into
mainfrom
kashish/webmcp-types-coexistence
Oct 19, 2026
Merged

kashishhora merged 2 commits into
mainfrom
kashish/webmcp-types-coexistence

Conversation

@kashishhora

Copy link
Copy Markdown
Member

Summary

If an app installs Google's webmcp-types next to webmcp-react, the two global Document.modelContext declarations clash. Theirs is readonly with a different type. With skipLibCheck off you get TS2687/TS2717. With it on, TypeScript silently uses whichever declaration it reads first.

Fixing that properly means dropping our global, which breaks anyone typing document.modelContext through us. So for now this just documents it:

  • docs/api.md: new "TypeScript and webmcp-types" section covering what happens and the workaround (a .d.ts with the reference directive listed first in include)
  • README: short TypeScript note pointing there
  • CHANGELOG: deprecates the global and says it goes away in 2.0.0

Heads up: #74 also adds an ## Unreleased heading to the changelog, so whichever lands second needs a quick merge.

Test Plan

  • Checked each setup against webmcp-types 0.1.10 with tsc: skipLibCheck off errors, "types": ["webmcp-types"] gives ours, reference directive listed first in include gives theirs

@kashishhora
kashishhora merged commit 55a6c50 into main Oct 19, 2026
4 checks passed
@kashishhora
kashishhora deleted the kashish/webmcp-types-coexistence branch October 19, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants