Skills

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
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

FeatureVanilla MCPLeanmcp SDK
Tool definitionManual schema@Tool decorator with auto-schema
Input validationManualAutomatic with @SchemaConstraint
Service discoveryManual registrationAuto-discovery from ./mcp directory
AuthenticationDIY@Authenticated decorator
User inputNot built-in@Elicitation decorator
SecretsDIY@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

Required package.json

Read the whole SKILL.md on GitHub

More in AI and agents