withPayments() and the SDK handles authentication, charging, and error handling automatically.
Installation
- npm
- pnpm
- yarn
Requirements
- Node.js 18+
- @modelcontextprotocol/sdk - The MCP SDK (peer dependency)
- Provider API key - From your Payo dashboard
Quick Example
Exports
The SDK exports the following:Main Function
Types
Utilities
TypeScript Support
The SDK is written in TypeScript with full type definitions:Architecture
The SDK:- Proxies your server to intercept handler registration
- Wraps tool handlers with payment logic
- Calls the Payo platform API for charges
- Executes your handler only after successful payment
Next Steps
withPayments()
Full API documentation
Configuration
All configuration options
Error Codes
Error types and handling
Examples
Complete code examples