# Copilot Instructions for Coolify MCP Server
<!-- Use this file to provide workspace-specific custom instructions to Copilot. For more details, visit https://code.visualstudio.com/docs/copilot/copilot-customization#_use-a-githubcopilotinstructionsmd-file -->
## Project Overview
This is a **Model Context Protocol (MCP) Server** project that provides integration with **Coolify Self-hosted** deployment platform. The MCP server enables AI assistants to interact with Coolify instances for application deployment, management, and monitoring.
## Key Context
### Project Type
- **MCP Server** using TypeScript
- **Target Platform**: Coolify Self-hosted (not Coolify Cloud)
- **Scope**: Universal/Generic implementation
- **Use Case**: Enable AI assistants to deploy and manage applications on any Coolify instance
### Core Functionality
- Application deployment automation
- Environment variable management
- Domain and SSL certificate configuration
- Deployment status monitoring
- Log retrieval and analysis
- Resource management
- Service health checks
### Technical Stack
- **Language**: TypeScript
- **Runtime**: Node.js
- **MCP SDK**: @modelcontextprotocol/sdk
- **API Client**: Coolify REST API integration
- **Validation**: Zod schemas
- **Authentication**: API key/token based
## Development Guidelines
### MCP Server Best Practices
- Follow MCP protocol specifications strictly
- Implement proper error handling and validation
- Use Zod schemas for input/output validation
- Provide clear tool descriptions and parameter documentation
- Implement proper logging and debugging support
### Coolify Integration Guidelines
- **MANDATORY**: Always reference Coolify documentation at https://coolify.io/docs/* before implementing any Coolify-related features
- Support multiple Coolify instances (multi-tenancy)
- Implement robust API error handling
- Cache frequently accessed data when appropriate
- Follow Coolify API versioning and compatibility
- Support both HTTP and HTTPS Coolify endpoints
- Consult https://coolify.io/docs/api for API specifications
- Check https://coolify.io/docs/applications for deployment workflows
- Reference https://coolify.io/docs/knowledge-base for best practices
### Code Organization
- Separate concerns: tools, handlers, utilities, types
- Use TypeScript interfaces for type safety
- Implement proper configuration management
- Follow async/await patterns consistently
- Add comprehensive JSDoc comments
### Security Considerations
- Never hardcode API keys or sensitive data
- Validate all inputs from MCP protocol
- Implement proper authentication checks
- Use environment variables for configuration
- Follow principle of least privilege
## Reference Links
- **MCP Documentation**: https://modelcontextprotocol.io/llms-full.txt
- **MCP SDK Examples**: https://github.com/modelcontextprotocol/create-python-server
- **Coolify Documentation**: https://coolify.io/docs/ (MUST reference for all Coolify features)
- **Coolify API Documentation**: https://coolify.io/docs/api
- **Coolify Applications Guide**: https://coolify.io/docs/applications
- **Coolify Knowledge Base**: https://coolify.io/docs/knowledge-base
- **Coolify GitHub**: https://github.com/coollabsio/coolify
## Development Notes
When generating code:
1. Always validate API inputs with Zod schemas
2. Implement proper error messages for users
3. Include TypeScript types for all functions
4. Add JSDoc comments for all public methods
5. Use descriptive variable and function names
6. Follow the MCP server pattern with proper tool registration
7. Support configuration via environment variables
8. Include proper logging for debugging