Skip to content

Commit 6d87d1f

Browse files
authored
Merge pull request #320 from DefangLabs/linda-generic-mcp-service-names
Rename MCP service names to generic names
2 parents 9d31641 + adb7f23 commit 6d87d1f

25 files changed

+18
-17
lines changed

samples/mcp/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
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-mcp-template%26template_owner%3DDefangSamples)
44

5-
This is a sample of an MCP (Model Context Protocol) chatbot application built with Next.js, Python, and Anthropic Claude, deployed using Defang.
5+
This is a sample of a Model Context Protocol (MCP) chatbot application built with Next.js, Python, and Anthropic Claude, deployed using Defang.
66

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 the Docker [MCP images](https://hub.docker.com/u/mcp).
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 the Docker [MCP images](https://hub.docker.com/u/mcp).
88

99
### How It Works
1010

11-
The [MCP client](https://modelcontextprotocol.io/quickstart/client) is written in Python and ran in a `venv` virtual environment. 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. Asynchronous Server Gateway Interface (ASGI) version of Flask) through the `stdio` transport method, as seen in `/mcp-service/main.py`. For more on MCP transport methods, see [here](https://modelcontextprotocol.io/docs/concepts/transports).
11+
#### Service 1 (Web Server with UI)
1212

13-
The UI (User Interface) and web server are built in Next.js (see `/ui/src/app`). The web server includes a forwarding action to connect to the MCP client.
13+
The web server and UI are built in Next.js (see `/service-1/src/app`). The web server includes a forwarding action to connect to the MCP Client.
1414

15-
Here's a breakdown of what happens when you interact with the UI:
15+
#### Service 2 (MCP Client and MCP Server)
16+
The [MCP Client](https://modelcontextprotocol.io/quickstart/client) is written in Python and ran in a `venv` virtual environment. 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. Asynchronous Server Gateway Interface (ASGI) version of Flask) through the `stdio` transport method, as seen in `/service-2/main.py`. For more on MCP transport methods, see [here](https://modelcontextprotocol.io/docs/concepts/transports).
17+
18+
Here's a breakdown of what happens when a user interacts with the UI:
1619
1. When a user submits a query to the chatbot, the browser sends a request to the Next.js web server.
17-
2. The Next.js web server will forward this request to the MCP client via a REST endpoint.
18-
3. The MCP client processes the request by interacting with the Anthropic (Claude) API and tools available through the MCP server.
20+
2. The Next.js web server will forward this request to the MCP Client via a REST endpoint.
21+
3. The MCP Client processes the request by interacting with the Anthropic (Claude) API and tools available through the MCP Server.
1922
4. Once the response is generated, it is sent back to the Next.js web server and displayed to the user in the UI.
2023

2124
## Prerequisites

samples/mcp/compose.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
services:
2-
ui:
3-
# uncomment to add your own domain
4-
# domainname: example.com
2+
service-1: # Web Server and UI
53
build:
6-
context: ./ui
4+
context: ./service-1
75
dockerfile: Dockerfile
86
ports:
97
- target: 3000
@@ -14,13 +12,13 @@ services:
1412
reservations:
1513
memory: 256M
1614
environment:
17-
- MCP_SERVICE_URL=http://mcp-service:8000
15+
- MCP_SERVICE_URL=http://service-2:8000
1816
healthcheck:
1917
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
2018

21-
mcp-service:
19+
service-2: # MCP Service (MCP Client and Server)
2220
build:
23-
context: ./mcp-service
21+
context: ./service-2
2422
dockerfile: Dockerfile
2523
ports:
2624
- target: 8000
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "ui",
2+
"name": "service-1",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {

0 commit comments

Comments
 (0)