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
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