ReadonlyclientPhantom type for client-side type inference.
This property has no runtime value - it exists only at the type level to enable automatic client type extraction.
ReadonlyexpressGet the underlying Express app for serverless deployments (e.g., Vercel). Use this for default exports in serverless environments.
ReadonlytoolsTyped tool definitions (for type inference)
Get the underlying MCP server instance
Get list of available version keys
For multi-version apps, returns array of version keys (e.g., ["v1", "v2"]). For single-version apps, returns empty array.
Array of version keys
Get Express middleware for custom server setup
Handle a single request (for serverless)
Optionalenv: unknownSubscribe to event
Handler called every time event is emitted until unsubscribed. Handlers execute in registration order. Errors in handlers are isolated (logged but don't affect other handlers).
Unsubscribe function
Subscribe to all events (wildcard listener)
Handler receives every event with event name and payload. Useful for logging, debugging, or analytics.
Handler function receiving all events
Unsubscribe function
Subscribe to event (one-time)
Handler called once, then automatically unsubscribed. Useful for initialization events or one-time setup.
Unsubscribe function (can call to cancel before event fires)
Start the built-in Express server
Optionaloptions: StartOptionsRegister middleware function
Middleware executes in registration order before tool handlers. Multiple middleware can be registered via multiple use() calls.
Middleware function
App instance returned by createApp()