Leanmcp Builder
Build MCP servers using the Leanmcp SDK with decorator-based TypeScript.
Install
npx skills add Leanmcp/gateway-skills --skill leanmcp-builder -g -a claude-code -y- Repository
- Leanmcp/gateway-skills2.1k
- Category
- AI and agents
- Updated
- 28d ago
- License
- MIT
- Context cost
- Mediumabout 2,940 tokens
- Runs scripts
- Yes, review before use
What it does
Build MCP servers using the Leanmcp SDK with decorator-based TypeScript. Use this skill when users ask for "leanmcp", "MCP with decorators", "MCP with authentication", "MCP with elicitation", "MCP with environment injection", or want a simpler, more elegant way to build MCP servers. Leanmcp provides automatic schema generation, dependency injection, authentication, and user input collection.
Leanmcp Builder Skill
This skill guides you in building MCP servers using the Leanmcp SDK - a decorator-based TypeScript framework for elegant MCP development.
When to Use This Skill
- User asks for "leanmcp server"
- User wants "MCP with decorators"
- User needs "authenticated MCP server"
- User wants "simpler MCP development"
- User mentions "@leanmcp/core"
- User needs "user input collection" or "elicitation"
- User wants "environment injection" for multi-tenant secrets
Leanmcp vs Vanilla MCP
| Feature | Vanilla MCP | Leanmcp SDK |
|---|---|---|
| Tool definition | Manual schema | @Tool decorator with auto-schema |
| Input validation | Manual | Automatic with @SchemaConstraint |
| Service discovery | Manual registration | Auto-discovery from ./mcp directory |
| Authentication | DIY | @Authenticated decorator |
| User input | Not built-in | @Elicitation decorator |
| Secrets | DIY | @RequireEnv + getEnv() |
Core Packages
# Minimal setup
npm install @leanmcp/core
# With authentication
npm install @leanmcp/auth
# With user input forms
npm install @leanmcp/elicitation
# With user secrets
npm install @leanmcp/env-injection
# CLI (global or dev)
npm install -g @leanmcp/cli
Project Structure
my-leanmcp-server/
├── main.ts # Entry point (minimal)
├── mcp/ # Auto-discovered services
│ ├── example/
│ │ └── index.ts # Exports ExampleService
│ └── myservice/
│ └── index.ts # Exports MyService
├── package.json
├── tsconfig.json
└── .env

