Basic information
About Defang MCP Server
Defang CLI. Develop Once, Deploy Anywhere. Take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes.
Defang is a MCP server in the Cloud & Infrastructure category listed in the AddMCP.net directory, published by DefangLabs. It exposes 15 tools, including create_aws_stack, create_azure_stack, create_gcp_stack, current_stack and more. Supported transport: stdio. Runtime: go. License: MIT. The repository has 165 GitHub stars. Source code is hosted on github.com. Related topics: aws, cloud, deployment, do, gcp.
Setup
{
"mcpServers": {
"defang": {
"command": "npx",
"args": [
"-y",
"defang@latest",
"mcp",
"serve"
]
}
}
}
{
"mcpServers": {
"defang": {
"command": "npx",
"args": [
"-y",
"defang@latest",
"mcp",
"serve"
]
}
}
}
{
"servers": {
"defang": {
"command": "npx",
"args": [
"-y",
"defang@latest",
"mcp",
"serve"
]
}
}
}
Defang MCP Server config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"defang": {
"command": "npx",
"args": [
"-y",
"defang@latest",
"mcp",
"serve"
]
}
}
}
Defang MCP Server tools
-
create_aws_stack
— Create a defang stack file to deploy to AWS
aws_profile:string*, compose_file_paths:array, project_name:string, recipe:string*, region:string*, stack:string*, working_directory:string* -
create_azure_stack
— Create a defang stack file to deploy to Azure
azure_subscription_id:string*, compose_file_paths:array, location:string*, project_name:string, recipe:string*, stack:string*, working_directory:string* -
create_gcp_stack
— Create a defang stack file to deploy to GCP
compose_file_paths:array, gcp_project_id:string*, project_name:string, recipe:string*, region:string*, stack:string*, working_directory:string* -
current_stack
— Get the currently selected stack
(no parameters) -
deploy
— Initiate deployment of the application stack defined in the docker-compose files in the current working directory
compose_file_paths:array, project_name:string, working_directory:string* -
destroy
— Destroy the deployed application in the selected stack, defined in the docker-compose files in the current working directory
compose_file_paths:array, project_name:string, working_directory:string* -
estimate
— Estimate the cost of deploying a Defang project to AWS or GCP
compose_file_paths:array, deployment_mode:string, project_name:string, provider:string*, region:string, working_directory:string* -
list_configs
— List config variables for the currently selected stack in the Defang project
compose_file_paths:array, project_name:string, working_directory:string* -
list_stacks
— List all the Defang stack(s) for the current project
compose_file_paths:array, project_name:string, working_directory:string* -
logs
— Fetch logs for the application in the selected stack, in pages of up to 100 lines. You can use the 'since' and 'until' parameters to page through logs by time.
compose_file_paths:array, deployment_id:string, project_name:string, since:string, until:string, working_directory:string* -
project_name
— Get the current project name
compose_file_paths:array, project_name:string, working_directory:string* -
remove_config
— Remove a config variable from the currently selected stack in the Defang project
compose_file_paths:array, name:string*, project_name:string, working_directory:string* -
select_stack
— Select the deployment stack for the Defang project
compose_file_paths:array, project_name:string, stack:string*, working_directory:string* -
services
— List deployed services for the selected project stack in the current working directory
compose_file_paths:array, project_name:string, working_directory:string* -
set_config
— Set a config variable for the currently selected stack in the Defang project
compose_file_paths:array, name:string*, project_name:string, random:boolean, value:string, working_directory:string*
Overview
What is Defang?
The Defang MCP Server is an MCP server equipped with Defang tools (deploy, services, destroy) to help users manage their services seamlessly using AI coding agents within supported IDEs.
How to use Defang?
Install the npm package manager, then run npx -y defang@latest mcp setup --client=<your-ide> to connect to your IDE. After setup, start the server with npx -y defang@latest mcp serve. You can then access the Defang MCP tools through the AI agent chat in your IDE.
Key features of Defang
- Offers three MCP tools: deploy, services, destroy.
- Deploy scans for Dockerfiles and compose.yaml files.
- Services displays deployed service details and status.
- Destroy terminates all deployed services for a project.
- Supports multiple IDEs: Cursor, Windsurf, Codex, VS Code, VS Code Insiders, and Claude Desktop.
- Setup and serve via simple npx commands.
Use cases of Defang
- Deploy services from a project directory using an AI coding agent.
- Monitor deployed services' status, public URLs, and IDs.
- Quickly tear down all services associated with a project.
- Integrate service management into an AI-assisted development workflow.
Frequently asked questions
1 What IDEs are supported?
Supported IDEs include Cursor, Windsurf, Codex, VS Code, VS Code Insiders, and Claude Desktop.
2 What does the `deploy` tool do?
The deploy tool scans your project directory for Dockerfiles and compose.yaml files, then deploys the detected service(s) using Defang. Deployment progress can be monitored in the Defang Portal.
3 How do I set up the Defang MCP Server?
Run npx -y defang@latest mcp setup --client=<your-ide> for your preferred IDE, then start the server with npx -y defang@latest mcp serve.
4 What information does the `services` tool provide?
The services tool shows Service Name, Deployment ID, Public URL, and Service Status for all currently deployed services.
5 What does the `destroy` tool require?
Given a project name or directory, the destroy tool identifies and terminates all services deployed with Defang.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In