Advanced Examples
Advanced LeanMCP examples demonstrating authentication and user input collection.OAuth Authentication
Protect tools with JWT authentication
Elicitation Forms
Collect user input before tool execution
OAuth Authentication
Protect your MCP tools with JWT authentication using@leanmcp/auth.
Supported Providers
| Provider | Package | Best For |
|---|---|---|
| Clerk | @leanmcp/auth | Quick start, modern apps |
| AWS Cognito | @leanmcp/auth | AWS ecosystem |
| Auth0 | @leanmcp/auth | Enterprise apps |
Code Example
How It Works
View Full Example
OAuth Basic Example
Elicitation Forms
Collect structured user input before tool execution using@leanmcp/elicitation.
How Elicitation Works
Code Example
Field Types
| Type | Description |
|---|---|
text | Single line text |
textarea | Multi-line text |
email | Email with validation |
number | Numeric input |
boolean | Checkbox |
select | Dropdown |
multiselect | Multiple selection |
date | Date picker |
Multi-Step Forms
View Full Example
Elicitation Example