LeanMCP SDK

v1.0.0Developer Toolsstable

Production-ready TypeScript SDK for MCP servers: auth, multi-tenant, observability. Build enterprise AI agents fast.

agentic-frameworkai-sdkauthenticationchatgpt-apps-sdkchatgpt-apps-sdk-ui
Share:
28
Stars
0
Downloads
0
Weekly
0/5

What is LeanMCP SDK?

LeanMCP SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to production-ready typescript sdk for mcp servers: auth, multi-tenant, observability. build enterprise ai agents fast.

Production-ready TypeScript SDK for MCP servers: auth, multi-tenant, observability. Build enterprise AI agents fast.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Production-ready TypeScript SDK for MCP servers: auth, multi

Use Cases

Build MCP servers fast
Multi-tenant support
Enterprise observability
LeanMCP

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedApr 17, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx leanmcp-sdk

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use LeanMCP SDK

LeanMCP SDK is a production-ready TypeScript framework for building MCP servers with built-in support for authentication, multi-tenant secret management, observability, and structured user input. It uses a decorator-based approach (@Tool, @Prompt, @Resource) to define MCP capabilities as TypeScript classes, and provides a CLI to scaffold new projects with HTTP transport, health endpoints, and JWT-based auth out of the box. Teams building enterprise AI agents or internal MCP infrastructure can use it to skip boilerplate and ship production-ready MCP servers quickly.

Prerequisites

  • Node.js (LTS version recommended) with npm
  • TypeScript knowledge (the SDK uses decorators and class-based schemas)
  • An MCP-compatible client to test the running server
  • A public domain or reverse proxy if deploying the HTTP server externally
1

Install the LeanMCP CLI globally

Install the @leanmcp/cli package globally to get access to the project scaffolding command.

npm install -g @leanmcp/cli
2

Create a new MCP server project

Use the CLI to scaffold a new project. This generates a TypeScript project with main.ts, tsconfig.json, .env, and example tool definitions.

npx @leanmcp/cli create my-mcp-server
cd my-mcp-server
npm install
3

Define tools using decorators

Add your business logic as TypeScript classes decorated with @Tool. Each decorated method becomes an MCP-callable function with automatic schema validation.

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' })
  async analyzeSentiment(args: AnalyzeSentimentInput) {
    return { sentiment: 'positive', score: 0.8 };
  }
}
4

Start the server

Run the development server. By default it listens on port 8080 and exposes the MCP endpoint at /mcp and a health check at /health.

npm start
# Server runs at http://localhost:8080
# MCP endpoint: http://localhost:8080/mcp
# Health check: http://localhost:8080/health
5

Add optional packages as needed

Install optional LeanMCP packages for authentication, multi-tenant env injection, elicitation (structured user input), or interactive UI components.

npm install @leanmcp/auth          # Authentication and access control
npm install @leanmcp/env-injection  # Multi-tenant secret management
npm install @leanmcp/elicitation    # Structured user input handling
npm install @leanmcp/ui             # Interactive UI components

LeanMCP SDK Examples

Client configuration

Connect an MCP client to a running LeanMCP HTTP server. Replace localhost:8080 with your server's address.

{
  "mcpServers": {
    "leanmcp-server": {
      "command": "npx",
      "args": ["leanmcp-sdk"],
      "env": {}
    }
  }
}

Prompts to try

Example prompts to use after connecting to a LeanMCP-built server with custom tools.

- "List all available tools on this MCP server"
- "Call the analyzeSentiment tool with the text: 'I love building with LeanMCP'"
- "Check the server health status"
- "What resources are available on this server?"
- "Use the MCP server to process this data and return a structured response"

Troubleshooting LeanMCP SDK

Decorator metadata errors at runtime (e.g., 'Reflect.metadata is not a function')

Ensure 'experimentalDecorators' and 'emitDecoratorMetadata' are set to true in your tsconfig.json, and that 'reflect-metadata' is imported at the top of your main entry file before any decorator-using imports.

Port 8080 is already in use

Set the PORT environment variable in your .env file to an available port, e.g. PORT=3001. The server reads PORT from the environment at startup.

MCP client cannot connect to the HTTP server

Verify the server is running and accessible at http://localhost:8080/health. If behind a firewall or on a remote host, ensure the port is open and PUBLIC_URL is set correctly in your .env for OAuth callback routing.

Frequently Asked Questions about LeanMCP SDK

What is LeanMCP SDK?

LeanMCP SDK is a Model Context Protocol (MCP) server that production-ready typescript sdk for mcp servers: auth, multi-tenant, observability. build enterprise ai agents fast. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install LeanMCP SDK?

Follow the installation instructions on the LeanMCP SDK GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with LeanMCP SDK?

LeanMCP SDK works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is LeanMCP SDK free to use?

Yes, LeanMCP SDK is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "leanmcp-sdk": { "command": "npx", "args": ["-y", "leanmcp-sdk"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use LeanMCP SDK?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides