mcpField
D
Defang

Defang

Local
defang.ioCloud & Infra167Updated today

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

  1. 01deploy tool scans Dockerfiles and compose.yaml files
  2. 02services tool shows status and public URLs
  3. 03destroy tool terminates services for a project
  4. 04Setup for Cursor, Windsurf, Codex, VS Code and Claude Desktop

Use cases

  1. 01Deploying a local project to the cloud from IDE chat
  2. 02Checking the status and URLs of running services
  3. 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.

mcp.json · Universal config
{
"mcpServers": {
"defanglabs": {
"command": "npx",
"args": [
"-y",
"defang"
]
}
}
}
Run commandnpx -y defang

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmdefang

Tools

15

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
aws_profilestringYesThe AWS profile to use when creating the stack.
compose_file_pathsarrayNoOptional: Paths to the compose files to use for the project. If not provided
project_namestringNoOptional: The name of the project. Useful when working with projects that are not in the current directory.
recipeenumYesThe deployment mode/recipe for the stack.affordable | balanced | high_availability
regionstringYesThe AWS region to create the stack in.
stackstringYesThe name of the stack to use for all tool calls.
working_directorystringYesThe working directory containing the compose files. Usually the current directory.

Details

From the project README

Defang

Defang 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

Markdown supported

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.