LeanMCP SDK
Production-ready TypeScript SDK for MCP servers: auth, multi-tenant, observability. Build enterprise AI agents fast.
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
Maintainer
Works with
Installation
Manual Installation
npx leanmcp-sdkConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
Install the LeanMCP CLI globally
Install the @leanmcp/cli package globally to get access to the project scaffolding command.
npm install -g @leanmcp/cliCreate 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 installDefine 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 };
}
}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/healthAdd 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 componentsLeanMCP 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.
LeanMCP SDK Alternatives — Similar Developer Tools Servers
Looking for alternatives to LeanMCP SDK? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up LeanMCP SDK in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.