What are Plugins?
xmcp plugins are middleware providers that add functionality to your MCP server. They:- Integrate with external services (Auth0, Clerk, WorkOS, Polar, etc.)
- Handle authentication and authorization
- Enable monetization and payment flows
- Provide type-safe context to your tools
- Expose OAuth metadata endpoints for MCP clients
Available Plugins
Authentication Plugins
Authentication plugins add user identity and access control to your MCP server:Auth0
Enterprise authentication with OAuth 2.0, scopes, and permissions
Clerk
Modern authentication with organizations and role-based access
Better Auth
Self-hosted authentication with email/password and OAuth providers
WorkOS
Enterprise-ready authentication with AuthKit and SSO
Monetization Plugins
Monetization plugins enable payment and licensing models:Polar
License key validation and usage-based billing with meter credits
x402
Pay-per-use pricing with cryptocurrency payments (USDC)
Plugin Architecture
All authentication plugins follow a consistent pattern:1. Provider Setup
Create amiddleware.ts file in your xmcp app:
2. OAuth Metadata
Authentication plugins automatically expose:GET /.well-known/oauth-protected-resource- Resource metadataGET /.well-known/oauth-authorization-server- Authorization server metadata
3. Context Access
Access authenticated user data in your tools:Choosing a Plugin
Authentication
Use Auth0 when you need:- Enterprise-grade authentication
- Fine-grained permissions system
- M2M (machine-to-machine) authentication
- Resource Server scopes
- Quick setup with minimal configuration
- Organizations with roles and permissions
- Beautiful pre-built UI components
- Modern developer experience
- Self-hosted authentication
- Full control over your data
- PostgreSQL-based session management
- Custom authentication flows
- Enterprise SSO (SAML, OIDC)
- Directory sync (SCIM)
- Magic link authentication
- Multi-tenant applications
Monetization
Use Polar when you need:- License key management
- Usage-based billing with meters
- Subscription models
- Checkout integration
- Pay-per-call pricing
- Cryptocurrency payments (USDC)
- Instant settlement
- No subscription management