How it works
Server side
UseregisterAppTool() and registerAppResource() to register your tools and resources. These helper functions automatically generate platform-specific metadata, so you write the registration once and it works on both platforms.
Client side
CallApp.connect() without an explicit transport parameter. The SDK detects whether it’s running in Claude or ChatGPT and uses the appropriate transport automatically.
Platform differences
While the SDK handles most cross-platform concerns automatically, some behaviors vary between hosts.Domain handling
TheResource._meta.ui.domain field format and validation rules are determined by each host platform. For example, hosts may use hash-based subdomains, URL-derived patterns, or other formats.
For Claude, compute the Resource._meta.ui.domain value by running this command, replacing https://example.com/mcp with your server URL:
https://example.com/mcp: