- Authentication — connecting with Clerk, Auth0, Cognito, Firebase
- Elicitation — collecting user input during tool execution
- MCP UI & Apps — rendering components in clients
- Remote deployment — running your MCP on a server
What LeanMCP Does
LeanMCP abstracts the hard parts. Instead of writing 600-700 lines of code just to set up authentication, you write 20-30 lines and run a few CLI commands. That’s it. We integrate with the auth providers you already use — Clerk, Auth0, AWS Cognito, Firebase, Google Cloud. We handle the JWT validation, JWKS fetching, token extraction, scope checking. You just add a decorator. And it’s entirely open source, just like the official MCP SDK. MIT license. Fork it, extend it, contribute to it.Deployment: LeanMCP + LeanMCP Platform
Think of it like Next.js + Vercel. You can deploy Next.js anywhere — AWS, GCP, your own servers. But Vercel gives you optimized deployment, edge functions, and observability out of the box. Same with LeanMCP. You can deploy to any platform you want — AWS, GCP, Railway, Render — you’re not locked in. But if you want optimized deployment with built-in observability, monitoring, and zero-config setup, LeanMCP’s platform handles that for you withleanmcp deploy.
Why Opinionated Matters
MCP is a developing protocol. People don’t realize the places where they can go wrong. One example: developers often use elicitation to collect authentication tokens. Seems reasonable, right? But it’s a security vulnerability. When you use elicitation, the data passes through the MCP client — both the client and server see the token in plain text. If the client is compromised, the token is stolen. The correct approach is using the protocol’s_meta.authorization.token field, which is handled by the client and never visible in tool responses.
Without guidance, you’d never know this. LeanMCP enforces these best practices by design — so you don’t accidentally expose vulnerabilities.
The Relationship
LeanMCP is built on top of the official SDK. It doesn’t replace it — it extends it.Why Does This Matter?
Local Development is Easy Either Way
Building a basic MCP on your local machine is straightforward with either SDK:The Problem: Production Features
When you need real production features, the official SDK leaves you on your own:| Feature | Official MCP SDK | LeanMCP |
|---|---|---|
| Authentication | DIY (~600-700 lines) | @leanmcp/auth (~20-30 lines) |
| Elicitation | Manual implementation | @leanmcp/elicitation decorator |
| OAuth Providers | Build from scratch | Clerk, Auth0, Cognito, Firebase built-in |
| HTTP Transport | Basic | Production-ready with session management |
| Deployment | Manual | leanmcp deploy |
Code Comparison: Authentication
Official MCP SDK (~600-700 lines)
LeanMCP (~20-30 lines)
Built-in Provider Support
LeanMCP integrates with popular auth providers out of the box:| Provider | Setup |
|---|---|
| Clerk | new AuthProvider('clerk', { secretKey }) |
| Auth0 | new AuthProvider('auth0', { domain, audience }) |
| AWS Cognito | new AuthProvider('cognito', { userPoolId, region }) |
| Firebase | new AuthProvider('firebase', { projectId }) |
| Google Cloud | new AuthProvider('gcp', { projectId }) |
| Custom | new AuthProvider('custom', { jwksUri, issuer }) |
Opinionated Best Practices
The MCP protocol is evolving. Without guidance, developers make mistakes that create security vulnerabilities.Example: Auth Tokens in Elicitation
A common mistake is using elicitation to collect authentication tokens:- Elicitation passes data through the MCP client
- Client sees the token in plain text
- If client is malicious or compromised, token is stolen
_meta.authorization.token field — handled by the client, never visible in tool responses.
LeanMCP enforces this pattern automatically with @Authenticated.
Both Are Open Source
| Official MCP SDK | LeanMCP | |
|---|---|---|
| License | MIT | MIT |
| Source | github.com/modelcontextprotocol | github.com/Leanmcp-Community |
| Foundation | Protocol implementation | Framework on top |
When to Use Each
Use Official MCP SDK if:
- Building a simple, local-only MCP
- You want full control over everything
- You’re experimenting or learning the protocol
- You don’t need auth, elicitation, or deployment
Use LeanMCP if:
- Building for production
- You need authentication (Clerk, Auth0, Cognito, etc.)
- You want elicitation with proper validation
- You want to deploy remotely
- You prefer convention over configuration
- You want security best practices enforced
Summary
| Aspect | Official MCP SDK | LeanMCP |
|---|---|---|
| Philosophy | Minimal, DIY | Opinionated, batteries-included |
| Auth | Build yourself | Built-in providers |
| Elicitation | Manual | Decorators |
| Deployment | Manual | leanmcp deploy |
| Code for auth | ~600-700 lines | ~20-30 lines |
| Best practices | Your responsibility | Enforced by framework |