# Example MCP Tool Calls
This document contains example JSON calls for all tools provided by the Coolify MCP Server.
## Setup
Before making any calls, ensure you have the following environment variables set:
```bash
COOLIFY_API_URL=https://your-coolify-instance.com
COOLIFY_API_TOKEN=your-api-token-here
COOLIFY_DEFAULT_TEAM_ID=optional-team-id
COOLIFY_MAX_APPS_PER_PROJECT=10
LOG_LEVEL=info
```
## Projects
### List Projects
```json
{
"tool": "coolify.list_projects",
"arguments": {
"teamId": "team-123" // Optional
}
}
```
### Create Project
```json
{
"tool": "coolify.create_project",
"arguments": {
"name": "My Production Apps",
"description": "Production applications for team X",
"teamId": "team-123" // Optional, uses default if not provided
}
}
```
## Applications
### List Applications
```json
{
"tool": "coolify.list_apps",
"arguments": {
"projectId": "proj-456"
}
}
```
### Get Application
```json
{
"tool": "coolify.get_app",
"arguments": {
"id": "app-789"
}
}
```
### Create Docker Image Application
```json
{
"tool": "coolify.create_app",
"arguments": {
"projectId": "proj-456",
"name": "nginx-server",
"description": "Nginx web server",
"type": "image",
"dockerImage": "nginx:latest",
"environment": {
"NGINX_PORT": "80"
},
"ports": [80]
}
}
```
### Create Git Repository Application
```json
{
"tool": "coolify.create_app",
"arguments": {
"projectId": "proj-456",
"name": "my-react-app",
"description": "React frontend application",
"type": "dockerfile",
"gitRepository": {
"url": "https://github.com/user/react-app.git",
"branch": "main"
},
"environment": {
"NODE_ENV": "production",
"API_URL": "https://api.example.com"
},
"ports": [3000]
}
}
```
### Create Docker Compose Application
```json
{
"tool": "coolify.create_app",
"arguments": {
"projectId": "proj-456",
"name": "wordpress-site",
"description": "WordPress with database",
"type": "compose",
"dockerCompose": "version: '3'\nservices:\n wordpress:\n image: wordpress:latest\n ports:\n - 8080:80\n environment:\n WORDPRESS_DB_HOST: db\n WORDPRESS_DB_PASSWORD: secret\n db:\n image: mysql:5.7\n environment:\n MYSQL_ROOT_PASSWORD: secret",
"ports": [8080]
}
}
```
### Update Application
```json
{
"tool": "coolify.update_app",
"arguments": {
"id": "app-789",
"name": "updated-name",
"description": "Updated description",
"environment": {
"NEW_VAR": "value",
"EXISTING_VAR": "new-value"
},
"ports": [80, 443]
}
}
```
### Delete Application
```json
{
"tool": "coolify.delete_app",
"arguments": {
"id": "app-789"
}
}
```
## Deployments
### Deploy Application
```json
{
"tool": "coolify.deploy_app",
"arguments": {
"id": "app-789",
"force": false
}
}
```
### Get Deployment Status
```json
{
"tool": "coolify.get_deployment_status",
"arguments": {
"deploymentId": "deploy-123"
}
}
```
### Get Deployment Logs
```json
{
"tool": "coolify.get_deployment_logs",
"arguments": {
"deploymentId": "deploy-123",
"lines": 200
}
}
```
## Templates
### Deploy Template
```json
{
"tool": "coolify.deploy_template",
"arguments": {
"templateName": "plausible",
"projectId": "proj-456",
"appName": "my-analytics",
"environment": {
"BASE_URL": "https://analytics.example.com",
"SECRET_KEY_BASE": "generated-secret-key-here",
"POSTGRES_URL": "postgresql://user:pass@postgres:5432/plausible"
}
}
}
```
### Deploy Template with Custom Git Repository
```json
{
"tool": "coolify.deploy_template",
"arguments": {
"templateName": "strapi",
"projectId": "proj-456",
"appName": "my-cms",
"environment": {
"NODE_ENV": "production",
"DATABASE_URL": "postgresql://user:pass@postgres:5432/strapi",
"JWT_SECRET": "your-jwt-secret"
},
"gitRepo": "https://github.com/myorg/custom-strapi.git",
"branch": "custom-branch"
}
}
```
### Deploy Template Overwrite
```json
{
"tool": "coolify.deploy_template",
"arguments": {
"templateName": "uptime-kuma",
"projectId": "proj-456",
"appName": "monitoring",
"environment": {},
"overwrite": true
}
}
```
### List Templates
```json
{
"tool": "coolify.list_templates",
"arguments": {} // or { "search": "analytics" }
}
```
### Search Templates
```json
{
"tool": "coolify.list_templates",
"arguments": {
"search": "database"
}
}
```
## Safety
### Check Quota
```json
{
"tool": "coolify.check_quota",
"arguments": {
"projectId": "proj-456"
}
}
```
### Check Name Conflicts
```json
{
"tool": "coolify.check_name_conflicts",
"arguments": {
"projectId": "proj-456",
"name": "my-app"
}
}
```
## Common Workflow Examples
### Deploy a New Application from Template with Safety Checks
1. Check quota first:
```json
{
"tool": "coolify.check_quota",
"arguments": {
"projectId": "proj-456"
}
}
```
2. Check if name is available:
```json
{
"tool": "coolify.check_name_conflicts",
"arguments": {
"projectId": "proj-456",
"name": "plausible-analytics"
}
}
```
3. Deploy template:
```json
{
"tool": "coolify.deploy_template",
"arguments": {
"templateName": "plausible",
"projectId": "proj-456",
"appName": "plausible-analytics",
"environment": {
"BASE_URL": "https://analytics.example.com",
"SECRET_KEY_BASE": "generated-secret",
"POSTGRES_URL": "postgresql://..."
}
}
}
```
### Deploy Custom Application and Monitor
1. Create application:
```json
{
"tool": "coolify.create_app",
"arguments": {
"projectId": "proj-456",
"name": "my-api",
"type": "dockerfile",
"gitRepository": {
"url": "https://github.com/user/my-api.git"
},
"environment": {
"PORT": "3000"
},
"ports": [3000]
}
}
```
2. Deploy:
```json
{
"tool": "coolify.deploy_app",
"arguments": {
"id": "app-123"
}
}
```
3. Monitor deployment:
```json
{
"tool": "coolify.get_deployment_status",
"arguments": {
"deploymentId": "deploy-456"
}
}
```
## Response Format
All tool responses follow this format:
```json
{
"success": true,
"...": "response data"
}
```
Or for errors:
```json
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human readable error message",
"details": {} // Optional additional details
}
}
```