LeanMCP SDK
A TypeScript SDK for building Model Context Protocol (MCP) servers with decorators, authentication, and production-ready features.Overview
LeanMCP SDK provides a modern, decorator-based approach to building MCP servers. It handles the complexity of the MCP protocol while letting you focus on building great tools.Key Features
Type-Safe Decorators
Use
@Tool, @Prompt, @Resource decorators with full TypeScript supportBuilt-in Authentication
Token-based auth with support for Firebase, Supabase, and custom providers
Input Validation
Automatic validation using JSON Schema and AJV
Production Ready
HTTP server, session management, error handling, and logging out of the box
Quick Example
Packages
The SDK is organized into several packages:- @leanmcp/core - Core decorators and server functionality
- @leanmcp/auth - Authentication decorators and providers
- @leanmcp/env-injection - Request-scoped user secrets injection
- @leanmcp/elicitation - Structured user input collection
- @leanmcp/ui - MCP-native React components and hooks for MCP Apps
- @leanmcp/cli - Command-line tool for project scaffolding
- @leanmcp/utils - Utility functions and helpers
Installation
Install the core package to get started:Next Steps
Core Package
Learn about decorators and schema definition
Authentication
Add authentication to your MCP server
CLI Tool
Scaffold projects with the CLI
Examples
View complete examples