Quick Start
Get your first MCP server up and running in just a few minutes. This guide will walk you through creating a sentiment analysis server.Create a new project
Use the LeanMCP CLI to scaffold a new project with interactive prompts:This generates a clean project structure:
The CLI will prompt you to auto-install dependencies and optionally start the dev server.
Install dependencies
If you didn’t auto-install during creation, install the dependencies now:This installs:
@leanmcp/core- Core MCP server runtime and decorators@modelcontextprotocol/sdk- Official MCP SDKexpress- HTTP server- TypeScript and other development tools
Explore the main entry point
The generated
main.ts file sets up your HTTP server:main.ts
The
autoDiscover feature automatically registers all services from the mcp/ directory.Explore the example service
The generated project includes an example sentiment analysis service in This service demonstrates:
mcp/example/index.ts:mcp/example/index.ts
- Class-based schemas - Type-safe input/output validation
- Schema constraints - Validation rules using decorators
- Tool decorator - Automatic tool registration
Start the server
Run your MCP server:Your server will start on
http://localhost:8080 with:- MCP endpoint:
http://localhost:8080/mcp - Health check:
http://localhost:8080/health
What’s Next?
Core Concepts
Learn about Tools, Prompts, and Resources
Add Authentication
Secure your MCP server with authentication
Deployment
Deploy your server to production
Examples
Explore more example implementations
Common Next Steps
Add a New Service
Use the CLI to add additional services to your project:mcp/weather/index.ts with boilerplate code and auto-registers it in your server.
Add Authentication
Install the auth package and protect your tools:Deploy to Production
Deploy your server using the LeanMCP CLI:Need help? Join our Discord community or check out the GitHub repository.