You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -89,4 +88,3 @@ DEFANG_PROVIDER=<provider> defang compose up
89
88
```
90
89
91
90
Want more? File an [issue](https://github.com/DefangLabs/samples/issues) to request a sample—we'll do everything we can to help you deploy better and faster!
Copy file name to clipboardExpand all lines: blog/2025-08-22-agentic-apps.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,7 @@ Defang works seamlessly with leading agentic frameworks. Try them out with our r
45
45
-[LangGraph](https://github.com/DefangLabs/samples/tree/main/samples/agentic-langgraph) - workflow sample that defines and controls multi-step agentic graphs with LangChain.
46
46
-[Agentic Strands](https://github.com/DefangSamples/sample-agentic-strands-template/tree/main) - A Strands Agent application.
Copy file name to clipboardExpand all lines: docs/concepts/authentication.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ To do pretty much anything with Defang, you'll need to authenticate with the sys
12
12
defang login
13
13
```
14
14
15
-
This will prompt you to open a browser and log in to your [Defang account](/docs/concepts/accounts). For now, the only way to log in is with GitHub, though we will offer other providers to authenticate in the future. Once you've logged in, you can close the browser and return to the terminal. You should see a message that you've successfully logged in.
15
+
This will prompt you to open a browser and log in to your [Defang account](/docs/concepts/accounts). You can log in using [GitHub](https://github.com/) or [GitLab](https://gitlab.com/). We will offer other authentication providers in the future. Once you've logged in, you can close the browser and return to the terminal. You will see a message that you've successfully logged in.
16
16
17
17
:::tip
18
18
Keep in mind that your Defang account is separate from your [cloud provider account](/docs/concepts/defang-byoc). You will need to authenticate with your cloud provider account separately to deploy services to your own cloud account.
| Databases | Defang will provision resources optimized for burstable memory | (like `high_availability`) | Defang will provision resources optimized for production |
22
-
| Deployment | Previous deployments will be spun down before new deployments are spun up. | (like `high_availability`) | Rolling updates will be used to deploy new versions. Defang will gradually replace services while maintaining at least [the original number of replicas](/docs/tutorials/scaling-your-services). |
23
-
|Logging| Logs retained for 1 day to save costs. || Logs retained for 30 days for compliance. |
22
+
| Deployment | Previous deployments will be spun down before new deployments are spun up. Stopped tasks will not restart. | (like `high_availability`) | Rolling updates will be used to deploy new versions. Defang will gradually replace services while maintaining at least [the original number of replicas](/docs/tutorials/scaling-your-services). |
23
+
|Logs| Logs retained for 1 day to save costs. | Logs retained for 7 days to balance cost and access.| Logs retained for 30 days for compliance. |
24
24
| Networking || (like `high_availability`) | Defang will provision a NAT gateway. |
25
25
| Load Balancing | HTTP redirect to HTTPS using `302 Found`|| Termination Protection will be enabled; logs are retained on "down" |
26
26
| DNS | Defang will provision shorter TTLs; zones will be forcefully destroyed || Defang will provision longer TTLs; records can be overwritten for ZDT |
27
-
| Managed storage | Operations that cause downtime are allowed || Encryption at rest; Final snapshot created on "down" |
28
-
| Logs | 1 day retention | 7 days retention | 30 days retention |
27
+
| Managed Storage | Operations that cause downtime are allowed || Encryption at rest; Final snapshot created on "down" |
Here is an example of the output you would see if you estimated the cost deploying the [django-postgres](https://github.com/DefangLabs/samples/tree/main/samples/django-postgres) sample using the `balanced`[deployment mode](/docs/concepts/deployment-modes).
22
+
Here is an example of the output you would see if you estimated the cost deploying the [django-postgres](https://github.com/DefangLabs/samples/tree/main/samples/django-postgres)to AWS sample using the `balanced`[deployment mode](/docs/concepts/deployment-modes).
Copy file name to clipboardExpand all lines: docs/concepts/managed-storage/managed-mongodb.md
+30-4Lines changed: 30 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ sidebar_position: 3000
7
7
# Managed MongoDB
8
8
9
9
:::info
10
-
This feature was introduced in Defang v1.2.0 released on June 3, 2025. [Upgrade to the latest version](/docs/cli/defang_upgrade)
10
+
This feature was introduced in Defang v1.2.0 released on June 3, 2025 for AWS. [Upgrade to the latest version](/docs/cli/defang_upgrade)
11
11
:::
12
12
13
13
Managed MongoDB is a service that allows you to store and retrieve large amounts of data in a document-oriented format. MongoDB is ideal for storing unstructured data like JSON documents, making it a popular choice for modern applications.
@@ -19,15 +19,33 @@ Managed MongoDB is a service that allows you to store and retrieve large amounts
To use managed MongoDB, in your `compose.yaml` file, use the `x-defang-mongodb` extension to define your MongoDB service. Adding the extension will tell Defang to provision a managed instance, rather than running MongoDB as a container.
27
27
28
28
### Required Configuration
29
29
30
-
When using managed MongoDB, you **must** set a username and password for the database. By default, these are read from the `MONGO_INITDB_ROOT_USERNAME` and `MONGO_INITDB_ROOT_PASSWORD` config variables, conform [the official MongoDB container image](https://hub.docker.com/_/mongo). These can be set using the `defang config set MONGO_INITDB_ROOT_USERNAME` and `defang config set MONGO_INITDB_ROOT_PASSWORD` commands. If you do not provide these values, the deployment will fail.
30
+
### AWS
31
+
When using managed MongoDB on AWS, you **must** set a username and password for the database. By default, these are read from the `MONGO_INITDB_ROOT_USERNAME` and `MONGO_INITDB_ROOT_PASSWORD` config variables, following [the official MongoDB container image](https://hub.docker.com/_/mongo) convention.
32
+
33
+
You can set these using the following commands:
34
+
35
+
```bash
36
+
defang config set MONGO_INITDB_ROOT_USERNAME <your-username>
37
+
defang config set MONGO_INITDB_ROOT_PASSWORD <your-password>
38
+
```
39
+
40
+
If you do not provide these values, the deployment will fail.
41
+
42
+
### GCP
43
+
44
+
When using managed MongoDB on GCP, you **must** set a `MONGO_INITDB_DATABASE` environment variable with the name of the database to create.
45
+
46
+
Defang will automatically create a config variable named `<SERVICE_NAME>_URL` that contains the connection string for your MongoDB database. For example, if your service is named `db`, the config variable will be `DB_URL`.
47
+
48
+
**Important:** GCP will ignore `MONGO_INITDB_ROOT_USERNAME` and `MONGO_INITDB_ROOT_PASSWORD` credentials since they are not needed. GCP automatically handles authentication and grants your service access to the MongoDB database.
:::warning[Deleting a GCP Firestore MongoDB Database]
69
+
Please be aware that GCP Firestore does not allow deletion of your database when you bring down your project using `defang compose down`. You must go to the [GCP Cloud Console for Firestore](https://console.cloud.google.com/firestore/databases/) to delete it manually.
70
+
:::
71
+
48
72
:::warning[Version]
49
73
AWS DocumentDB is compatible with MongoDB 3.6, 4.0, and 5.0. The `mongo:5` image is compatible with DocumentDB 5.0, so we recommend using this version for your MongoDB service. Deployment will fail for versions higher than 5.
74
+
75
+
GCP Firestore does not have a configurable version.
Copy file name to clipboardExpand all lines: docs/concepts/managed-storage/managed-storage.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,4 +6,4 @@ sidebar_position: 000
6
6
7
7
# Managed Storage
8
8
9
-
Defang helps you provision the infrastructure you need to run your services. That infrastructure is designed to scale in and out without persistent storage, so you can build highly scalable services. But Defang can also help you provision managed services to store and persist your data, like [caches](./managed-redis.md), [databases](./managed-postgres.mdx), and [object storage](./managed-object-storage.md).
9
+
Defang helps you provision the infrastructure you need to run your services. That infrastructure is designed to scale in and out without persistent storage, so you can build highly scalable services. Defang can also help you provision managed services to store and persist your data, like [caches](./managed-redis.md), [sql databases](./managed-postgres.mdx), [nosql databases](./managed-mongodb.md), and [object storage](./managed-object-storage.md).
Copy file name to clipboardExpand all lines: docs/concepts/mcp.md
+74-10Lines changed: 74 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,31 +20,39 @@ This page is a guide to the Defang MCP Server detailing its installation, tools,
20
20
21
21
## Installation
22
22
23
-
Ensure that you have the [npm package manager](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) installed, as `npx` commands are required for setup.
23
+
Ensure that you have the [Defang CLI](/docs/getting-started.mdx#install-the-defang-cli) installed.
24
24
25
-
:::warning
26
-
At this time, the Defang MCP Server can only be installed using `npx`. Other methods are not yet supported.
27
-
:::
28
25
Run the setup command in your terminal for your IDE of choice from the [Supported IDEs](#supported-ides) section. This will connect the Defang MCP Server to your IDE. The general format of the command is as follows:
29
26
27
+
:::tip[Recommended Installation]
28
+
Install the [Defang CLI](/docs/getting-started.mdx#install-the-defang-cli) using [Curl](https://curl.se/) or [Homebrew](https://brew.sh/)
Once the command completes, you may need to restart your IDE for the changes to take effect.
35
37
36
38
Once the MCP Server is running, you can access the Defang MCP tools directly through the AI agent chat in your IDE.
37
39
38
40
That's it! Feel free to explore our [Example Prompts](#example-prompts) to get ideas on how to interact with the AI agent and make the most of the Defang MCP Server.
39
41
42
+
Note that `npx` installation is supported, but not recommended.
Once setup is complete, you can interact with the AI coding agent using Defang-related actions like `check defang services` or [other prompts](#example-prompts). Here's an example of what it could look like:
@@ -56,7 +64,7 @@ Once setup is complete, you can interact with the AI coding agent using Defang-r
56
64
Setup command:
57
65
58
66
```bash
59
-
npx -y defang@latest mcp setup --client=windsurf
67
+
defang mcp setup --client=windsurf
60
68
```
61
69
62
70
Once setup is complete, you can interact with the AI coding agent using Defang-related actions like `check defang services` or [other prompts](#example-prompts). Here's an example of what it could look like:
@@ -68,7 +76,7 @@ Once setup is complete, you can interact with the AI coding agent using Defang-r
68
76
Setup command:
69
77
70
78
```bash
71
-
npx -y defang@latest mcp setup --client=vscode
79
+
defang mcp setup --client=vscode
72
80
```
73
81
74
82
Once setup is complete, you can interact with the AI coding agent using Defang-related actions like `check defang services` or [other prompts](#example-prompts). Here's an example of what it could look like:
@@ -80,21 +88,33 @@ Once setup is complete, you can interact with the AI coding agent using Defang-r
Once setup is complete, you can interact with the AI coding agent using Defang-related actions like `check defang services` or [other prompts](#example-prompts). Here's an example of what it could look like:
87
95
88
96

89
97
98
+
### Kiro
99
+
100
+
Setup command:
101
+
102
+
```bash
103
+
defang mcp setup --client=kiro
104
+
```
105
+
106
+
Once setup is complete, you can interact with the AI coding agent using Defang-related actions like `check defang services` or [other prompts](#example-prompts). Here's an example of what it could look like:
107
+
108
+

109
+
90
110
### Claude Desktop
91
111
92
112
While this is not an IDE in the traditional sense, it can support MCP servers. For a smoother experience, consider specifying a project name or directory when making chat prompts to this platform.
93
113
94
114
Setup command:
95
115
96
116
```bash
97
-
npx -y defang@latest mcp setup --client=claude
117
+
defang mcp setup --client=claude
98
118
```
99
119
100
120
Once setup is complete, you can interact with the AI coding agent using Defang-related actions like `check defang services` or [other prompts](#example-prompts). Here's an example of what it could look like:
@@ -121,6 +141,22 @@ The `services` tool displays the details of all your services that are currently
121
141
122
142
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.
123
143
144
+
### `estimate`
145
+
146
+
The `estimate` tool scan your project directory and considers your [deployment mode](/docs/concepts/deployment-modes.md) (which defaults to `AFFORDABLE`) to provide a [cost estimation](/docs/concepts/estimation.md) for your project. Currently, the tool supports two providers: `AWS` or `GCP`.
147
+
148
+
### `list_configs`
149
+
150
+
The `list_configs` tool will [list](/docs/cli/defang_config) all the Defang configs set for your project.
151
+
152
+
### `set_config`
153
+
154
+
The `set_config` tool will [set](/docs/tutorials/configure-environment-variables#step-2---set-the-actual-value-in-the-defang-cli) a specific Defang config for your project.
155
+
156
+
### `remove_config`
157
+
158
+
The `remove_config` tool will [remove](/docs/tutorials/configure-environment-variables#removing-a-config-value) a specific Defang config for your project.
159
+
124
160
## Example Prompts
125
161
126
162
After connecting the Defang MCP Server to your IDE using an installation method, you can type in prompts in your chat to invoke the AI agent to use any MCP tool(s).
@@ -149,4 +185,32 @@ deploy this with defang /Users/yourname/Documents/project1
149
185
do I have a service called project1
150
186
```
151
187
188
+
You can estimate the cost of a deployment to a supported cloud provider:
189
+
190
+
```
191
+
can you estimate balance mode on aws for this project?
192
+
```
193
+
194
+
```
195
+
can you estimate how much this project will cost on gcp?
196
+
```
197
+
198
+
You can list, set and remove Defang configs for a project:
199
+
200
+
```
201
+
what defang configs do I have set for this project?
202
+
```
203
+
204
+
```
205
+
list all the defang configs I have set for this project
206
+
```
207
+
208
+
```
209
+
set the defang config DATABASE_URL to example.com
210
+
```
211
+
212
+
```
213
+
remove the defang config DATABASE_URL
214
+
```
215
+
152
216
Feel free to try any of these prompts or create your own!
0 commit comments