home / mcp / defang mcp server

Defang MCP Server

MCP server enabling IDE-integrated cloud deployment and cloud operations from your development environment.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "defanglabs-defang": {
      "command": "npx",
      "args": [
        "-y",
        "defang",
        "mcp",
        "serve",
        "--client",
        "vscode"
      ],
      "env": {
        "TZ": "UTC",
        "DEFANG_JSON": "false",
        "DEFANG_EDITOR": "code",
        "DEFANG_PROVIDER": "auto"
      }
    }
  }
}

The Defang MCP Server lets you run and manage cloud deployments directly from your IDE or editor, delivering a seamless, integrated experience. It enables you to start, configure, and deploy applications to the cloud without leaving your development environment, accelerating iteration and delivery.

How to use

You interact with the Defang MCP Server from your editor or terminal through the Defang MCP client. Start the MCP server from your IDE, then connect to it using your editor’s built-in MCP support. The server provides the cloud deployment capabilities you need as you code, test, and ship your application.

How to install

Prerequisites: ensure you have a supported editor installed (e.g., VS Code or VS Code Insiders) and a runtime environment compatible with Defang CLI. You also need network access to reach cloud providers if you plan to deploy.

Install the Defang CLI using one of the supported methods, then verify the installation by checking the help output.

Defang MCP Server configuration

The MCP server can be run through a standard CLI workflow that uses a local, editor-integrated command. The following configuration shows how to start the MCP server client-side from your editor, enabling you to serve the MCP endpoints directly within your development environment.

{
  "type": "stdio",
  "name": "defang_mcp",
  "command": "npx",
  "args": ["-y", "defang", "mcp", "serve", "--client", "vscode"]
}

Security and environment

Manage authentication and access tokens via the Defang CLI and your editor’s MCP client. Be mindful of sensitive information in environment variables and avoid exposing tokens in your source control.

Examples and notes

You can generate new project scaffolds and start the MCP service directly from your editor. Use the Defang CLI to generate code, then deploy or run the MCP server from the IDE for a streamlined workflow.

Available tools

generate

AI-assisted project generation and scaffolding via the Defang CLI to accelerate setup and development workflows.

serve_mcp

Start and manage the MCP server session from the editor, enabling IDE-integrated cloud deployment.