leanmcp-sdk
Production-ready TypeScript SDK for MCP servers: auth, multi-tenant, observability. Build enterprise AI agents fast.
claude mcp add --transport stdio leanmcp-leanmcp-sdk node dist/main.js \ --env PORT="8080" \ --env NODE_ENV="production"
How to use
LeanMCP SDK provides production-ready infrastructure for building MCP servers with authentication, multi-tenant isolation, request logging, observability, and deploy-ready tooling. This repository demonstrates a Node.js-based MCP server scaffold that you can customize by defining services, inputs, and outputs with the LeanMCP core decorators. To use it, install the project, install core dependencies, and start the server. The server exposes an HTTP endpoint at /mcp and a health check at /health, enabling you to register and invoke your MCP tools, validate inputs, and orchestrate multi-step tool interactions. You can leverage the included CLI patterns (via @leanmcp/cli) to scaffold new servers, define services, and generate properly structured MCP endpoints for your domain.
How to install
Prerequisites:
- Node.js (16+ recommended) and npm/yarn installed
- Basic familiarity with TypeScript projects
- Install CLI tools globally (optional but recommended):
npm install -g @leanmcp/cli
- Create a new MCP server project (example):
npx @leanmcp/cli create my-mcp-server
cd my-mcp-server
npm install
- Install core MCP packages in your project (if not already present):
npm install @leanmcp/core
- Start the server:
npm start
- Verify runtime locally:
- HTTP endpoint: http://localhost:8080/mcp
- Health: http://localhost:8080/health
Additional notes
Tips:
- Port and environment can be overridden with environment variables (e.g., PORT, NODE_ENV).
- Define your services under the mcp/ directory following the examples in the Quick Start to ensure proper schema validation and tool registration.
- Use the LeanMCP decorators (Tool, Optional, SchemaConstraint) to describe inputs/outputs for your tools clearly.
- Ensure your deployment environment exposes the required ports and that observability/monitoring tooling is configured for production deployments.
Related MCP Servers
mcp-use
The fullstack MCP framework to develop MCP Apps for ChatGPT / Claude & MCP Servers for AI Agents.
inspector
Test & Debug MCP servers, ChatGPT apps, and MCP Apps (ext-apps)
Wax
Sub-Millisecond RAG on Apple Silicon. No Server. No API. One File. Pure Swift
mq
jq-like command-line tool for markdown processing
mcp-agent-graph
MCP Agent Graph is a Multi-Agent System built on the principles of Context Engineering
mcp-auth-proxy
MCP Auth Proxy is a secure OAuth 2.1 authentication proxy for Model Context Protocol (MCP) servers