@less-ifc/mcp
v1.0.0
Published
A Model Context Protocol (MCP) server that provides tools for interacting with [Less](https://less.chuva.io) - an Infrastructure from Code tool that automates the creation and deployment of serverless REST APIs, WebSockets, Pub/Sub systems, CRON jobs, clo
Readme
Less MCP Server
A Model Context Protocol (MCP) server that provides tools for interacting with Less - an Infrastructure from Code tool that automates the creation and deployment of serverless REST APIs, WebSockets, Pub/Sub systems, CRON jobs, cloud functions, and more to AWS.
View the Less documentation to learn more.
About Less
Less is an Infrastructure from Code tool that inspects your file structure and automatically provisions and deploys your code and serverless AWS cloud infrastructure.
MCP Server Features
This MCP server provides comprehensive tools for:
Project Management
- Deploy projects to AWS
- Run cloud projects locally
- Manage projects
- View deployment logs and function logs
Resource Creation & Management
- REST APIs: Create HTTP routes with dynamic paths and middleware support
- WebSockets: Create real-time sockets with custom channels
- Topics/Subscribers: Build event-driven pub/sub systems with fault tolerance
- CRON Jobs: Schedule recurring tasks with CRON expressions
- Cloud Functions: Create serverless functions callable via SDK or REST API
Multi-Language Support
All resources support JavaScript, TypeScript, and Python, with more languages coming soon.
Installation for Users
VS Code with Claude Desktop
Install Claude Desktop from Anthropic's website
Install the MCP server from npm:
npm install -g @less-ifc/mcpConfigure Claude Desktop by editing the configuration file:
On macOS:
code ~/Library/Application\ Support/Claude/claude_desktop_config.jsonOn Windows:
code %APPDATA%\Claude\claude_desktop_config.jsonAdd the MCP server configuration:
{ "mcpServers": { "less": { "command": "less", "args": [] } } }Restart Claude Desktop for the changes to take effect
Verify installation by asking Claude: "What Less tools are available?"
Other IDEs
For other IDEs that support MCP (like Cursor, Zed, etc.), refer to their specific documentation for MCP server configuration. The general process involves:
- Installing the server:
npm install -g @less-ifc/mcp - Configuring the IDE to use the
lesscommand as an MCP server - Restarting the IDE
Example Workflows
Building a REST API with Pub/Sub
Ask Claude: "Create a user registration API with email notifications"
1. Claude will use create-route to create POST /users endpoint
2. Claude will use create-topic to create user_created topic
3. Claude will use create-subscribers to add email notification subscriber
4. Claude will use deploy-project to deploy everything to the cloudCreating a Real-time Chat Application
Ask Claude: "Build a WebSocket chat system with multiple rooms"
1. Claude will use create-socket to create chat WebSocket
2. Claude will add channels for join_room, leave_room, send_message
3. Claude will use create-route for REST API to manage chat history
4. Claude will use view-logs to help debug connection issuesSetting up Scheduled Data Processing
Ask Claude: "Create a daily report generator that processes user data"
1. Claude will use create-cron to create the scheduled job
2. Claude will use create-cloud-function for data processing logic
3. Claude will use create-route to expose report access API
4. Claude will help configure CRON schedule via environment variablesDevelopment
Prerequisites
- Node.js 18 or higher
- npm or yarn
- TypeScript knowledge
Setup
Clone the repository:
git clone <repository-url> cd less-mcpInstall dependencies:
npm install
Development Workflow
Building the Project
Build the TypeScript source code:
npm run buildThis will:
- Compile TypeScript files from
src/tobuild/ - Make the output executable
Development Mode
Run the compiler in watch mode for automatic rebuilds:
npm run devThis will watch for changes in the src/ directory and automatically recompile.
Running the Server
After building, you can run the server directly:
node build/index.jsOr use the binary:
./build/index.jsInspecting the Server
Use the MCP Inspector to test and debug your server:
npm run inspectThis will start the MCP Inspector, which provides a web interface for testing MCP tools and resources.
Testing with Claude Desktop
- Build the project:
npm run build - Update your Claude Desktop configuration to point to the local build:
{ "mcpServers": { "less": { "command": "node", "args": ["/path/to/less-mcp/build/index.js"] } } } - Restart Claude Desktop
- Test your changes
Understanding Less Project Structure
When you use the MCP tools to create Less resources, they follow a specific folder structure that Less uses to automatically provision infrastructure:
my-less-project/
├── less/
│ ├── apis/ # REST APIs
│ │ └── store/ # API name
│ │ ├── products/ # Route path
│ │ │ ├── get.js # GET /products
│ │ │ └── post.js # POST /products
│ │ └── orders/
│ │ └── {id}/ # Dynamic route parameter
│ │ └── get.js # GET /orders/{id}
│ │
│ ├── sockets/ # WebSockets
│ │ └── chat/ # Socket name
│ │ ├── connect/ # Connection handler
│ │ ├── disconnect/ # Disconnection handler
│ │ └── send_message/ # Custom channel
│ │
│ ├── topics/ # Pub/Sub Topics
│ │ └── user_created/ # Topic name
│ │ ├── send_email/ # Subscriber
│ │ └── update_analytics/ # Another subscriber
│ │
│ ├── crons/ # Scheduled jobs
│ │ └── daily_report/ # CRON job name
│ │
│ ├── functions/ # Cloud functions
│ │ └── calculate_tax/ # Function name
│ │
│ └── shared/ # Shared modules
│ └── database/ # Module name
│
├── less.config # Environment variables
└── package.jsonKey Concepts
- File-based routing: Your folder structure becomes your API routes
- Automatic provisioning: Less reads your structure and creates cloud resources
- Environment variables: Configure via
less.configand environment exports - Multi-language support: Mix JavaScript, TypeScript, and Python in the same project
- Built-in services: Every deployment gets KVS, file storage, and pub/sub automatically
Project Structure
less-mcp/
├── src/
│ └── index.ts # Main MCP server implementation
├── build/ # Compiled JavaScript output
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This fileAdding New Tools
To add a new tool to the MCP server:
Define the tool in
src/index.ts:server.tool( "tool-name", "Tool description", { // Zod schema for parameters param1: z.string().describe("Parameter description"), }, async (args) => { // Tool implementation return { content: [ { type: "text", text: "Tool response", }, ], }; } );Build and test your changes:
npm run build npm run inspect
Best Practices
Working with Claude and the MCP Server
Be Specific About Requirements
❌ "Create an API" ✅ "Create a REST API for user management with GET /users, POST /users, and PUT /users/{id} endpoints"Specify the Programming Language
❌ "Create a WebSocket for chat" ✅ "Create a WebSocket for chat using TypeScript with channels for join_room and send_message"Ask for Complete Workflows
✅ "Create a user registration system with email verification using pub/sub" - Claude will create the registration API endpoint - Set up email verification topic with subscribers - Deploy the entire systemUse Incremental Development
✅ Start simple: "Create a basic REST API for products" ✅ Then expand: "Add WebSocket notifications when products are updated" ✅ Then enhance: "Add a CRON job to update product prices daily"Leverage Built-in Features
- Always ask Claude to use Less's built-in KVS for simple data storage
- Use topics/subscribers instead of direct API calls for loose coupling
- Take advantage of automatic HTTPS, scaling, and CDN features
Publishing to npm
Prerequisites
- npm account
- Proper permissions for the
@less-ifcorganization
Publishing Steps
Ensure all changes are committed:
git status git add . git commit -m "Your commit message"Update version in
package.json:npm version patch # or minor, majorBuild the project:
npm run buildTest the build:
npm run inspectPublish to npm:
npm publishTag the release:
git push origin main --tags
Version Management
- Patch (
1.0.0→1.0.1): Bug fixes - Minor (
1.0.0→1.1.0): New features, backwards compatible - Major (
1.0.0→2.0.0): Breaking changes
Troubleshooting
Common Issues
"less command not found"
- Ensure the package is installed globally:
npm install -g @less-ifc/mcp - Check your PATH includes npm's global bin directory
- On macOS, you may need to restart your terminal after installation
- Ensure the package is installed globally:
"Less CLI not found" when using MCP tools
- Install the Less CLI:
npm install -g @chuva.io/less-cli - Verify installation:
npx @chuva.io/less-cli --version - Make sure you're authenticated:
npx @chuva.io/less-cli login
- Install the Less CLI:
Authentication errors with Less CLI
- Run
npx @chuva.io/less-cli loginto authenticate - Check your Less account status at less.chuva.io
- Verify you have permission to deploy to the specified organization
- Run
TypeScript compilation errors
- Check Node.js version (18+ required)
- Verify TypeScript is installed:
npm list typescript - Clear build cache:
rm -rf build && npm run build
MCP Inspector not working
- Ensure the project is built:
npm run build - Check that the server starts without errors:
node build/index.js - Try running the inspector with:
npx @modelcontextprotocol/inspector node ./build/index.js
- Ensure the project is built:
Claude Desktop not recognizing the server
- Verify the configuration file path:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Check JSON syntax in the configuration
- Restart Claude Desktop after making changes
- Test the command manually:
less(should start the MCP server)
- Verify the configuration file path:
Permission denied errors on deployment
- Check that you have access to the project/organization
- Verify your Less CLI authentication is current
- Try re-running the login:
npx @chuva.io/less-cli login
Getting Help
- Less Documentation: docs.less.chuva.io
- Less Community Discord: discord.gg/XcYDcjbDRS
- MCP Documentation: modelcontextprotocol.io
- Report Issues: File issues in the project repository
- Less Support: [email protected]
License
ISC
