Skip to content

Commit 8a38049

Browse files
authored
Merge pull request #263 from DefangLabs/kevin/updateMCP
2 parents 3012586 + e68ee0f commit 8a38049

File tree

3 files changed

+74
-10
lines changed

3 files changed

+74
-10
lines changed

docs/concepts/mcp.md

Lines changed: 74 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,39 @@ This page is a guide to the Defang MCP Server detailing its installation, tools,
2020

2121
## Installation
2222

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

25-
:::warning
26-
At this time, the Defang MCP Server can only be installed using `npx`. Other methods are not yet supported.
27-
:::
2825
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:
2926

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/)
29+
3030
```bash
31-
npx -y defang@latest mcp setup --client=<your-ide>
31+
defang mcp setup --client=<your-ide>
3232
```
3333

34+
:::
35+
3436
Once the command completes, you may need to restart your IDE for the changes to take effect.
3537

3638
Once the MCP Server is running, you can access the Defang MCP tools directly through the AI agent chat in your IDE.
3739

3840
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.
3941

42+
Note that `npx` installation is supported, but not recommended.
43+
44+
```bash
45+
npx -y defang@latest mcp setup --client=<your-ide>
46+
```
47+
4048
## Supported IDEs
4149

4250
### Cursor
4351

4452
Setup command:
4553

4654
```bash
47-
npx -y defang@latest mcp setup --client=cursor
55+
defang mcp setup --client=cursor
4856
```
4957

5058
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
5664
Setup command:
5765

5866
```bash
59-
npx -y defang@latest mcp setup --client=windsurf
67+
defang mcp setup --client=windsurf
6068
```
6169

6270
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
6876
Setup command:
6977

7078
```bash
71-
npx -y defang@latest mcp setup --client=vscode
79+
defang mcp setup --client=vscode
7280
```
7381

7482
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
8088
Setup command:
8189

8290
```bash
83-
npx -y defang@latest mcp setup --client=vscode-insiders
91+
defang mcp setup --client=vscode-insiders
8492
```
8593

8694
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:
8795

8896
![VS Code](/img/mcp-concept/vscode-insiders.png)
8997

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+
![Kiro](/img/mcp-concept/kiro.png)
109+
90110
### Claude Desktop
91111

92112
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.
93113

94114
Setup command:
95115

96116
```bash
97-
npx -y defang@latest mcp setup --client=claude
117+
defang mcp setup --client=claude
98118
```
99119

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

122142
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.
123143

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+
124160
## Example Prompts
125161

126162
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
149185
do I have a service called project1
150186
```
151187

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+
152216
Feel free to try any of these prompts or create your own!

static/img/mcp-concept/diagram.png

132 KB
Loading

static/img/mcp-concept/kiro.png

436 KB
Loading

0 commit comments

Comments
 (0)