Skip to main content

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:

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
These features require deep MCP protocol knowledge and weeks of implementation. LeanMCP handles them out of the box with @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

Then create your project:
The CLI provides an interactive setup that installs dependencies and starts the dev server automatically.

Project Structure

Start the Server

Test with MCP Inspector

Deployment

Deploy anywhere Node.js runs. Or use LeanMCP’s deployment platform:
You’re not locked in — deploy to AWS, GCP, Vercel, Railway, or any 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.