About Defang
Defang is an MCP server built on the Defang CLI that lets AI coding agents deploy, inspect and destroy services from supported IDEs. It is aimed at developers who want to take a Docker Compose project to a cloud deployment from within their editor.
Key features
- 01deploy tool scans Dockerfiles and compose.yaml files
- 02services tool shows status and public URLs
- 03destroy tool terminates services for a project
- 04Setup for Cursor, Windsurf, Codex, VS Code and Claude Desktop
Use cases
- 01Deploying a local project to the cloud from IDE chat
- 02Checking the status and URLs of running services
- 03Removing deployments that are no longer needed
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
15Saved tool list · updated 3w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| aws_profile | string | Yes | The AWS profile to use when creating the stack. |
| compose_file_paths | array | No | Optional: Paths to the compose files to use for the project. If not provided |
| project_name | string | No | Optional: The name of the project. Useful when working with projects that are not in the current directory. |
| recipe | enum | Yes | The deployment mode/recipe for the stack.affordable | balanced | high_availability |
| region | string | Yes | The AWS region to create the stack in. |
| stack | string | Yes | The name of the stack to use for all tool calls. |
| working_directory | string | Yes | The working directory containing the compose files. Usually the current directory. |
Details
From the project READMEDefang MCP Server
This directory hosts the Model Context Protocol (MCP) Server, equipped with Defang tools (deploy, services, destroy) to help users manage their services seamlessly using AI coding agents within supported IDEs.
Follow the guide below to get started.
Installation
Make sure you have the npm package manager installed, as npx commands are required for setup.
To connect the MCP Server to your IDE, execute the following command in your
npx -y defang@latest mcp setup --client=<your-ide>
Replace <your-ide> with the name of your preferred IDE.
After setup, you can start the MCP Server with the command:
npx -y defang@latest mcp serve
Once the server is running, you can access the Defang MCP tools directly through the AI agent chat in your IDE.
Supported IDEs
Cursor
npx -y defang@latest mcp setup --client=cursor
Windsurf
npx -y defang@latest mcp setup --client=windsurf
Codex
npx -y defang@latest mcp setup --client=codex
VS Code
npx -y defang@latest mcp setup --client=vscode
VS Code Insiders
npx -y defang@latest mcp setup --client=vscode-insiders
Claude Desktop
While this is not an IDE in the traditional sense, it can support MCP servers.
npx -y defang@latest mcp setup --client=claude
MCP Tools
Below are the tools available in the Defang MCP Server.
deploy
The deploy tool scans your project directory for Dockerfiles and compose.yaml files, then deploys the detected service(s) using Defang. You can monitor the deployment process in the Defang Portal.
services
The services tool displays the details of all your services that are currently deployed with Defang. It shows the Service Name, Deployment ID, Public URL and Service Status. If there are no services found, it will display an appropriate message.
destroy
Given a project name or directory, the destroy tool identifies any services deployed with Defang and terminates them. If no services are found, it will display an appropriate message.
Additional Information
For more details about the Defang MCP Server, please see our official documentation.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.
