Create and Publish Business Websites in seconds. AI will gather all the details about your website and generate link to your website.

MCP
This is a sample of a Model Context Protocol (MCP) chatbot application built with Next.js, Python, and Anthropic Claude, deployed using Defang.
This example uses Docker's 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.
How It Works
Service 1 (Web Server with UI)
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.
Service 2 (MCP Client and MCP Server)
The MCP 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.
Here's a breakdown of what happens when a user interacts with the UI:
- When a user submits a query to the chatbot, the browser sends a request to the Next.js web server.
- The Next.js web server will forward this request to the MCP Client via a REST endpoint.
- The MCP Client processes the request by interacting with the Anthropic (Claude) API and tools available through the MCP Server.
- Once the response is generated, it is sent back to the Next.js web server and displayed to the user in the UI.
Prerequisites
- Download Defang CLI
- (Optional) If you are using Defang BYOC authenticate with your cloud provider account
- (Optional for local development) Docker CLI
Development
To run the application locally, you can use the following command:
docker compose up --build
Configuration
For this sample, you will need to provide the following configuration:
Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.
ANTHROPIC_API_KEY
An API key for accessing the Anthropic Claude API.
defang config set ANTHROPIC_API_KEY
Deployment
[!NOTE] Download Defang CLI
Defang Playground
Deploy your application to the Defang Playground by opening up your terminal and typing:
defang compose up
BYOC
If you want to deploy to your own cloud account, you can use Defang BYOC.
Title: Model Context Protocol (MCP) Chatbot
Short Description: An MCP (Model Context Protocol) chatbot assistant built with Next.js, Python, and Anthropic Claude.
Tags: MCP, Next.js, Python, Quart, Claude, AI, Anthropic, TypeScript, React, JavaScript
Languages: nodejs, python
相关推荐
Text your favorite pet, after answering 10 questions about their everyday lives!
Carbon footprint calculations breakdown and advices on how to reduce it
The most advanced API finder, available for over 2000 manually curated tasks. Chat with me to find the best AI tools for any use case.
Structured recipes for food and desserts – ingredient lists and step-by-step recipe instructions from any input. Become surprised, try something new or breathe life into grandma's old recipe notebook.
Best-in-class AI domain names scoring engine and availability checker. Brandability, domain worth, root keywords and more.
You're in a stone cell – can you get out? A classic choose-your-adventure interactive fiction game, based on a meticulously-crafted playbook. With a medieval fantasy setting, infinite choices and outcomes, and dice!
I suggest data science projects and give tips on request.
Evaluates language quality of texts, responds with a numerical score between 50-150.
🧑🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.
🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.
Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
This project was created to demonstrate how we can connect with different Model Context Protocols (MCPs).
an easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero
Reviews

user_eDi3EVvp
As a devoted user of defang-mcp, I must say this application has significantly enhanced my productivity. Joseph-Mulenga28 has done an exceptional job in crafting a user-friendly and efficient tool. Whether for professional or personal use, defang-mcp's intuitive interface and robust features make it an indispensable asset in my daily routine. Highly recommend giving it a try!

user_EmGmsJA5
Defang-mcp is an outstanding application developed by Joseph-Mulenga28. Its user-friendly interface and efficient performance have significantly streamlined my workflow. Kudos to Joseph for creating such a useful tool. Highly recommend it to anyone looking to enhance their productivity!

user_7zYbYmhO
As a dedicated user of defang-mcp, I must say this tool by Joseph-Mulenga28 has been a game-changer. The functionality and ease of use are simply outstanding, making complex processes remarkably streamlined. Highly recommend for anyone looking for efficient performance and reliable results. Great job by the developer!

user_6P72fzuN
As a dedicated user of defang-mcp by Joseph-Mulenga28, I must say that this application has exceeded my expectations. Its functionality and ease of use are outstanding. The user interface is intuitive, and the features are well-integrated, making my tasks easier to manage. This app is a must-have for anyone looking to streamline their processes effectively! Highly recommended!

user_umQ3sXwE
Defang-mcp is a fantastic tool by Joseph-Mulenga28 that has significantly improved my daily workflow. It's intuitive, reliable, and offers excellent features that cater to both beginners and advanced users. Highly recommend trying it out if you're looking for a robust solution!

user_JWOKHYq1
Defang-mcp is an exceptional application for all my MCP needs. Created by Joseph-Mulenga28, it optimizes my workflow seamlessly. The intuitive design and user-friendly interface make it a joy to use, and the welcome information provided is always helpful. Highly recommended for anyone looking for a reliable MCP solution.