Skip to content

Commit 7b3e492

Browse files
committed
edit readme
1 parent 526c9a6 commit 7b3e492

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

samples/mcp/README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22

33
[![1-click-deploy](https://defang.io/deploy-with-defang.png)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-<YOUR_SAMPLE_DIR#REMOVE_ME_AFTER_EDITING>-template%26template_owner%3DDefangSamples)
44

5-
This is a sample of an MCP (Model Context Protocol) chatbot application deployed using Defang. It uses Docker's [`mcp/time` image](https://hub.docker.com/r/mcp/time) as a base for the MCP server (MCP tools included), but it can be adapted to use any of Docker [MCP images](https://hub.docker.com/u/mcp). The MCP server communicates with an MCP client in a Quart app (i.e. ASGI Flask), as demonstrated in `mcp-server/main.py`. Requests sent from the browser are forwarded via UI to the MCP client. The response is created with calls to Anthropic (Claude) API and the appropriate MCP tools accessible by the server.
5+
This is a sample of an MCP (Model Context Protocol) chatbot application built with Next.js, Python, and Claude, deployed using Defang.
6+
7+
This example uses Docker's [`mcp/time`](https://hub.docker.com/r/mcp/time) image as a base for the MCP server (with MCP tools included), but it can be adapted to use any of Docker [MCP images](https://hub.docker.com/u/mcp).
8+
9+
### How It Works
10+
11+
The [MCP client](https://modelcontextprotocol.io/quickstart/client) is written in Python and ran in a `venv`. The MCP server is provided by the Docker `mcp/time` image. The MCP server communicates with the MCP client in a Quart app (i.e. ASGI version of Flask) through the `stdio` transport method, as seen in `mcp-server/main.py`. For more on MCP transport methods, see [here](https://modelcontextprotocol.io/docs/concepts/transports).
12+
13+
1. When a user submits a query to the chatbot, the browser sends a request to the Next.js UI.
14+
2. The UI will forward this request to the MCP client via a REST endpoint.
15+
3. The MCP client processes the request by interacting with Anthropic (Claude) API, and tools available through the MCP server.
16+
4. Once the response is generated, it is sent back to the UI and displayed to the user.
617

718
## Prerequisites
819

@@ -15,7 +26,7 @@ This is a sample of an MCP (Model Context Protocol) chatbot application deployed
1526
To run the application locally, you can use the following command:
1627

1728
```bash
18-
docker compose -f compose.dev.yaml up --build
29+
docker compose up --build
1930
```
2031

2132
## Configuration
@@ -41,22 +52,16 @@ Deploy your application to the Defang Playground by opening up your terminal and
4152
defang compose up
4253
```
4354

44-
### BYOC (AWS)
45-
46-
If you want to deploy to your own cloud account, you can use Defang BYOC:
55+
### BYOC
4756

48-
1. [Authenticate your AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html), and check that you have properly set your environment variables like `AWS_PROFILE`, `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`.
49-
2. Run in a terminal that has access to your AWS environment variables:
50-
```bash
51-
defang --provider=aws compose up
52-
```
57+
If you want to deploy to your own cloud account, you can [use Defang BYOC](https://docs.defang.io/docs/tutorials/deploy-to-your-cloud).
5358

5459
---
5560

56-
Title: Sample Title #REMOVE_ME_AFTER_EDITING
61+
Title: MCP
5762

58-
Short Description: A short sentence or two describing the sample. #REMOVE_ME_AFTER_EDITING
63+
Short Description: An MCP (Model Context Protocol) chatbot assistant built with Next.js, Python, and Claude.
5964

60-
Tags: Tags, That, Are, Not, Programming, Languages #REMOVE_ME_AFTER_EDITING
65+
Tags: MCP, Next.js, Python, Quart, Claude, AI, Anthropic, TypeScript, React, JavaScript
6166

62-
Languages: Programming, Languages, Used #REMOVE_ME_AFTER_EDITING
67+
Languages: nodejs

0 commit comments

Comments
 (0)