Defang

MCP运维云端

提供方 DefangLabs · 包名 defang

运维云端 stdio · 本地进程 会话登录 社区 / 第三方 Claude DesktopClaudeCursorVS Code
查看接入方式

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 属于运维云端类 MCP 服务器,stdio · 本地进程,会话登录,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式stdio · 本地进程 鉴权会话登录 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

clouddeploymentaws

安装与配置

stdio · 本地进程 会话登录
客户端在本机拉起子进程,数据不出本机
npx -y defang@latest mcp setup --client=\x3Cyour-ide>

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 go,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好会话登录对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Defang当前 未标注 stdio · 本地进程 本地部署 有 未标注
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方DefangLabs上游标注的维护方 DefangLabs
分类运维云端本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式会话登录远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时defang · go本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

12.5 KB
来自项目仓库与上游目录的原文,未做删改

Develop Once, Deploy Anywhere.

Take your app from Compose to a secure and scalable deployment on your favorite cloud in minutes.

How It Works```mermaid

flowchart LR

subgraph local["Your Machine or CI/CD"]
compose["compose.yaml"] --> cli["Defang CLI"]
end

subgraph defang["Defang Backend"]
fabric["Fabric API (gRPC)"]
end

subgraph cloud["Your Cloud Account"]
secrets["Config & Secrets"]
cd["Defang CD Task"]
logs["Logs"]
runtime["Load Balancer, Containers, DB, Cache, LLM, DNS, Roles"]
end

%% control plane
cli <-.-> fabric

%% deploy
cli --> secrets
cli --> cd
cd --> runtime

%% observability
cli -.-> logs


1. **You write** a standard Docker **Compose** file
2. **Defang CLI** validates your Compose project and uploads the project to storage in your AWS/GCP account
3. **CD runs in your cloud** — a deployment task spins up in your AWS/GCP account
4. **Infrastructure is created** — containers, DNS, load balancing, and roles are provisioned
5. **Monitor** the deployment and tail or query runtime logs with the Defang CLI

Your code and secrets never leave your cloud account. Defang orchestrates the deployment, but everything runs in your infrastructure.

## Defang CLI

The Defang Command-Line Interface (CLI) is designed for developers who prefer to manage their workflows directly from the terminal. It offers full access to Defang’s capabilities, allowing you to build, test, and deploy applications efficiently to the cloud.

### Deploying with Defang

If you already have a Docker Compose file, create a new stack and then deploy it. For example:```shell
$ defang stack new
? Which cloud provider do you want to deploy to? AWS
? Which AWS region do you want to deploy to? us-west-2
? Which deployment mode do you want to use? AFFORDABLE
? What do you want to call this stack? awsuswest2
 * Created new stack configuration file: `.defang/awsuswest2`. Check this file into version control. You can now deploy this stack using `defang up --stack=awsuswest2`

$ defang up --stack=awsuswest2

Defang MCP Server

The Defang Model Context Protocol (MCP) Server is tailored for developers who work primarily within integrated development environments (IDEs). It enables seamless cloud deployment from supported editors such as Cursor, Windsurf, VS Code, VS Code Insiders and Claude delivering a fully integrated experience without leaving your development environment.

Claude Code Plugin

Install the Defang plugin for Claude Code to deploy directly from any Claude Code session — no CLI required upfront:```shell
/plugin marketplace add DefangLabs/defang
/plugin install defang@defang-skills


After installing, use `/defang:deploy` to guide you through deploying your project. The Defang MCP server activates automatically once the Defang CLI is installed.

## This repo includes:

- Public releases of the Defang CLI; click here for the latest version
- Built-in support for MCP Server — the Defang MCP Server makes cloud deployment as easy as a single prompt. Learn more
- Samples that show how to deploy an app using the Defang Pulumi Provider.

## Getting started

- Read our Getting Started page
- Follow the installation instructions from the Installing page
- Take a look at our Samples in Golang, Python, and Node.js that show how to accomplish various tasks and deploy them
- Try the AI integration by running `defang generate`
- Start your new service with `defang compose up`

## Installing

Install the Defang CLI from one of the following sources:

- Using the Homebrew package manager DefangLabs/defang tap:```
  brew install DefangLabs/defang/defang
  ```

- Using a shell script:```
  eval &quot;$(curl -fsSL s.defang.io/install)&quot;
  ```

- Using Go:```
  go install github.com/DefangLabs/defang/src/cmd/cli@latest
  ```

- Using the Nix package manager:
  - with Nix-Env:```
    nix-env -if https://github.com/DefangLabs/defang/archive/main.tar.gz
    ```
  - or with Flakes:```
    nix profile install github:DefangLabs/defang#defang-cli --refresh
    ```

  Released tags are available from our Cachix binary cache, so
  you can download the CLI instead of compiling it. If you have Cachix installed, run
  `cachix use defanglabs`; otherwise add these lines to `/etc/nix/nix.conf` (or
  `~/.config/nix/nix.conf` if you are a trusted user):```nix
  extra-substituters = https://defanglabs.cachix.org
  extra-trusted-public-keys = defanglabs.cachix.org-1:mTXLTfYprWDrIK50Kz34fhOTreeKlQRZFQcKL7HtHx0=
  ```

  Then install a tagged version, e.g. `nix profile install github:DefangLabs/defang/v3.14.1#defang-cli`.
  The cache holds `x86_64-linux` and `aarch64-darwin` builds. Other platforms, and
  builds from `main`, compile from source as before.

- Using winget:```
  winget install defang
  ```

- Using a PowerShell script:```
  iwr https://s.defang.io/defang_win_amd64.zip -OutFile defang.zip
  Expand-Archive defang.zip . -Force
  ```

- Using the official image from Docker Hub:```
  docker run -it defangio/defang-cli help
  ```

- Using NPX:```
  npx defang@latest help
  ```

- or download the latest binary of the Defang CLI.

## Support

- File any issues here

## Command completion

The Defang CLI supports command completion for Bash, Zsh, Fish, and Powershell. To get the shell script for command completion, run the following command:```
defang completion [bash|zsh|fish|powershell]

If you're using Bash, you can add the following to your ~/.bashrc file:```
source <(defang completion bash)


If you&#x27;re using Zsh, you can add the following to your `~/.zshrc` file:```
source &lt;(defang completion zsh)

or pipe the output to a file called _defang in the directory with the completions.

If you're using Fish, you can add the following to your ~/.config/fish/config.fish file:```
defang completion fish | source


If you&#x27;re using Powershell, you can add the following to your `$HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` file:```
Invoke-Expression -Command (defang completion powershell | Out-String)

Environment Variables

The Defang CLI recognizes the following environment variables:

  • COMPOSE_DISABLE_ENV_FILE - Whether to disable loading environment variables from a .env file in the current directory; defaults to false
  • COMPOSE_ENV_FILES - A comma-separated list of environment file(s) to use for interpolation instead of .env; overridden by the --env-file flag
  • COMPOSE_FILE - The Compose file(s) to use; defaults to compose.yaml, compose.yml, docker-compose.yaml, or docker-compose.yml in the current directory
  • COMPOSE_PATH_SEPARATOR - The path separator to use for COMPOSE_FILE; defaults to : on Unix/MacOS and ; on Windows
  • COMPOSE_PROJECT_NAME - The name of the project to use; overrides the name in the Compose file
  • DEFANG_ACCESS_TOKEN - The access token to use for authentication; if not specified, uses token from defang login
  • DEFANG_ALLOW_UPGRADE - If set to true, allows upgrading the CD image and Pulumi version to the latest available; defaults to false, ie. previously deployed versions will be used to avoid unexpected upgrades
  • DEFANG_AWS_APN_ID - The AWS APN ID to use for attribution, eg. use pc:123456789abcdefgh for AWS Marketplace products
  • DEFANG_BUILD_CONTEXT_LIMIT - The maximum size of the build context when building container images; defaults to 100MiB
  • DEFANG_CD_BUCKET - The S3 bucket to use for the BYOC CD pipeline; defaults to defang-cd-bucket-…
  • DEFANG_CD_IMAGE - The image to use for the Continuous Deployment (CD) pipeline; defaults to public.ecr.aws/defang-io/cd:public-beta
  • DEFANG_DEBUG - set this to 1 or true to enable debug logging
  • DEFANG_DISABLE_ANALYTICS - If set to true, disables sending analytics to Defang; defaults to false
  • DEFANG_EDITOR - The editor to launch after new project generation; defaults to code (VS Code)
  • DEFANG_FABRIC - The address of the Defang Fabric to use; defaults to fabric-prod1.defang.dev
  • DEFANG_JSON - If set to true, outputs JSON instead of human-readable output; defaults to false
  • DEFANG_HIDE_HINTS - If set to true, hides hints in the CLI output; defaults to false
  • DEFANG_HIDE_UPDATE - If set to true, hides the update notification; defaults to false
  • DEFANG_ISSUER - The OAuth2 issuer to use for authentication; defaults to https://auth.defang.io
  • DEFANG_MODEL_ID - The model ID of the LLM to use for the generate/debug AI integration (Pro users only)
  • DEFANG_NO_CACHE - If set to true, disables pull-through caching of container images; defaults to false
  • DEFANG_PREFIX - The prefix to use for all BYOC resources; defaults to Defang
  • DEFANG_PROVIDER - The name of the cloud provider to use, auto (default), aws, azure, digitalocean, gcp, or defang
  • DEFANG_PULUMI_BACKEND - The Pulumi backend URL or &quot;pulumi-cloud&quot;; defaults to a self-hosted backend
  • DEFANG_PULUMI_DEBUG - If set to true, enables debug logging for Pulumi operations; defaults to false
  • DEFANG_PULUMI_DIFF - If set to true, shows the Pulumi diff during deployments; defaults to false
  • DEFANG_PULUMI_DIR - Run Pulumi from this folder, instead of spawning a cloud task; requires --debug (BYOC only)
  • DEFANG_PULUMI_VERSION - Override the version of the Pulumi image to use (aws provider only)
  • DEFANG_RECIPE - The deployment mode / recipe to use; defaults to AFFORDABLE
  • DEFANG_STACK - The name of the stack to use
  • DEFANG_SUFFIX - The suffix to use for all BYOC resources; defaults to the stack name, or beta if unset.
  • DEFANG_WORKSPACE - The workspace (name or ID) to use; preferred way to select which workspace the CLI uses
  • GCP_PROJECT_ID - The Google Cloud project ID for the gcp provider; must be a real shell environment variable (e.g. export GCP_PROJECT_ID=my-project-id), not set via defang config set. Also recognized: GOOGLE_PROJECT, GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT, CLOUDSDK_CORE_PROJECT
  • NO_COLOR - If set to any value, disables color output; by default, color output is enabled depending on the terminal
  • PULUMI_ACCESS_TOKEN - The Pulumi access token to use for authentication to Pulumi Cloud; see DEFANG_PULUMI_BACKEND
  • PULUMI_CONFIG_PASSPHRASE - Passphrase used to generate a unique key for your stack, and configuration and encrypted state values
  • TZ - The timezone to use for log timestamps: an IANA TZ name like UTC or Europe/Amsterdam; defaults to Local
  • XDG_STATE_HOME - The directory to use for storing state; defaults to ~/.local/state

Environment variables will be loaded from a .defang file in the current directory, if it exists. This file follows
the same format as a .env file: KEY=VALUE pairs on each line, lines starting with # are treated as comments and ignored.

Compose interpolation

After selecting a stack, the CLI makes the resolved DEFANG_PROVIDER and DEFANG_STACK values available for Compose
interpolation. They are not injected into services automatically; reference them explicitly where needed:```yaml
services:
app:
environment:
PUBLISH_PROVIDER: "${DEFANG_PROVIDER}"
PUBLISH_STACK: "${DEFANG_STACK}"


The resolved values take precedence over values with the same names in Compose env files. Fields that Compose must decode
before stack selection should provide a default, such as `${DEFANG_PROVIDER:-auto}`.

## Development

At Defang we use the Nix package manager for our dev environment, in conjunction with DirEnv.

To get started quickly, install Nix and DirEnv, then create a `.envrc` file to automatically load the Defang developer environment:```sh
echo use flake &gt;&gt; .envrc
direnv allow

Adding cloud support

At a high-level, support for a specific cloud lives in three repositories:

  • In this CLI repository
  • an implementation of the client.Provider interface under the byoc package
  • low-level cloud helpers ("driver") under the clouds package
    • authenticate with the cloud
    • start a CD container (task/job)
    • monitor the CD container's status and logs
    • stream/query logs from deployed services
    • set/list config (secrets/parameters)
  • In the Defang Pulumi Provider repository
  • Pulumi component resources under the provider folder
    • Project component
    • Service component
    • Postgres component
    • Redis component
  • a Pulumi custom resource for Build
  • an implementation of the ConfigProvider interface to read config (secrets/parameters) at deploy time
  • In the Defang Docs repository
  • under the providers section, documentation for how to set up credentials and permissions for the cloud, and any cloud-specific features

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Defang 怎么安装?

在客户端按下面的安装命令接入:npx -y defang@latest mcp setup --client=\x3Cyour-ide>。对应的包名是 defang。装完在客户端配置里引用同一个包或端点。

Defang 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Defang 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Defang 需要 API Key 吗?

资料标注需要会话登录认证,使用前准备好对应凭据,并按最小权限配置。

Defang 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、VS Code、Windsurf、Codex;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Defang 能提供哪些能力?

资料显示能力标签包括 cloud、deployment、aws、gcp。具体工具清单以官方文档为准。

Defang 需要什么运行环境?

运行时为 go;属于本地进程,需要在本机装好运行环境。

Defang 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。