Skip to main content
LeanMCP Logo

LeanMCP SDK

Production-Ready Infrastructure for MCP Servers Build and deploy scalable MCP servers with full backend capabilities. LeanMCP provides everything you need to create production-grade Model Context Protocol servers with authentication, multi-tenant isolation, observability, and more.

Production-Grade Support

Authentication

Built-in auth support with AWS Cognito, Auth0, Clerk, and custom providers

Multi-Tenant Isolation

Request-scoped secrets and environment injection for secure multi-tenancy

Request Logging

Comprehensive request and response logging for debugging and monitoring

Observability

Built-in monitoring and tracing at https://app.leanmcp.com

Private Cloud

Deploy to your own infrastructure with enterprise support

Type-Safe Schema

Class-based schema validation with TypeScript decorators

Ideal For

Agent Platforms

Build intelligent agent systems with structured tool calling

Customer-Facing AI

Deploy AI-powered workflows directly to customers

Multi-Tenant SaaS

Create secure, isolated AI systems for multiple tenants

Why LeanMCP?

LeanMCP is a TypeScript SDK that extends the Model Context Protocol with production-ready features. Unlike basic MCP implementations, LeanMCP provides:
  • Type-Safe Development - TypeScript decorators with full IntelliSense support
  • Class-Based Schemas - Define input/output validation using TypeScript classes
  • Auto-Discovery - Automatically register services from your project structure
  • Production Features - Authentication, logging, monitoring out of the box
  • Easy Deployment - Built-in CLI for scaffolding and deployment

Quick Example

import { Tool, SchemaConstraint } from "@leanmcp/core";

class AnalyzeSentimentInput {
  @SchemaConstraint({
    description: 'Text to analyze',
    minLength: 1
  })
  text!: string;
}

export class SentimentService {
  @Tool({ 
    description: 'Analyze sentiment of text',
    inputClass: AnalyzeSentimentInput
  })
  async analyzeSentiment(args: AnalyzeSentimentInput) {
    // Your implementation here
    return {
      sentiment: 'positive',
      score: 0.8,
      confidence: 0.9
    };
  }
}

Get Started

Quick Start

Create your first MCP server in minutes

Installation

Detailed installation and setup guide

Core Concepts

Learn about tools, prompts, and resources

Examples

Explore example implementations
LeanMCP is built on the Model Context Protocol (MCP) specification, ensuring compatibility with MCP-compatible clients and tools.

Build docs developers (and LLMs) love