LeanMCP
LeanMCP is a framework for building production-ready MCP servers. It uses TypeScript decorators, service-based architecture, and schema validation to create AI-ready tool interfaces. Built on top of the official@modelcontextprotocol/sdk, LeanMCP uses Express for HTTP transport and implements the Streamable HTTP specification. It provides session management, tool registration, and schema validation out of the box.
Why LeanMCP?
A basic MCP connects tools to AI agents. But production means solving real problems:| Problem | LeanMCP Solution |
|---|---|
| Auth | Integrate with Auth0, Supabase, Cognito, Firebase, or custom |
| Multi-tenancy | Per-user API keys and permissions |
| Elicitation | Handle user input during tool execution |
| Audit | Logging, monitoring, production observability |
Core Principles
- Developer Experience first — decorators, auto-discovery
- Convention over configuration — sensible defaults
- Type-safe by default — TypeScript + schema validation
- Production-ready — HTTP transport, session management
Building MCPs is Easy. Production MCPs are Hard.
Building a basic MCP that connects tools to an AI agent is straightforward — define your tools, add descriptions, done. But the make-or-break features that separate a toy from production are much harder:- Authentication — OAuth integration, token validation, scope management
- Elicitation — User input collection with validation
- Payments — Stripe integration, subscription checks, usage-based billing
- MCP Apps & UI — Rendering UI components inside ChatGPT, Claude, and other clients
@leanmcp/auth, @leanmcp/elicitation, and built-in UI support.
Protocol Upgrades Without Pain
The MCP protocol evolves. When updates come — new capabilities, schema changes, security patches — you’d normally rewrite significant code. With LeanMCP, you update one dependency. Your tools, auth, and elicitation continue working.LeanMCP abstracts protocol complexity so you focus on your business logic, not MCP internals.
Installation
- One-Line Install (Mac/Linux)
- npm
- npx (no install)
Project Structure
Start the Server
Test with MCP Inspector
Deployment
Deploy anywhere Node.js runs. Or use LeanMCP’s deployment platform:Next Steps
Quick Start
Build your first MCP in 5 minutes
Tools
Create tools AI can execute
Resources
Expose data to AI agents
Prompts
Template prompts for AI
Auth
Secure your MCP server
CLI Reference
CLI commands and options
Support
LeanMCP is MIT-licensed open source.- GitHub: github.com/Leanmcp-Community
- npm: @leanmcp/core