MCP cover image
See in Github
2025-04-14

0

Github Watches

0

Github Forks

0

Github Stars

MCP

1-click-deploy

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:

  1. When a user submits a query to the chatbot, the browser sends a request to the Next.js web server.
  2. The Next.js web server will forward this request to the MCP Client via a REST endpoint.
  3. The MCP Client processes the request by interacting with the Anthropic (Claude) API and tools available through the MCP Server.
  4. Once the response is generated, it is sent back to the Next.js web server and displayed to the user in the UI.

Prerequisites

  1. Download Defang CLI
  2. (Optional) If you are using Defang BYOC authenticate with your cloud provider account
  3. (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

相关推荐

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

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

  • Convincible Ltd
  • 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!

  • John Rafferty
  • Text your favorite pet, after answering 10 questions about their everyday lives!

  • Ian O'Connell
  • Provide players' names or enter Quickstart to start the game!

  • analogchat.com
  • Efficient Spotify assistant for personalized music data.

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • langgenius
  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • alibaba
  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

  • caio-moliveira
  • 创建该项目是为了证明我们如何与不同的模型上下文协议(MCP)连接。

  • microsoft
  • Python tool for converting files and office documents to Markdown.

  • mindsdb
  • AI's query engine - Platform for building AI that can answer questions over large scale federated data. - The only MCP Server you'll ever need

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • AstrBotDevs
  • llm llm聊天机器人及开发框架平台支持QQ QQ QQ 频道、电报| mcp 服务器、 openai,deepseek,双子座、硅基流动、月之暗面、 ollama,

  • nbonamy
  • Witsy:桌面AI助手

    Reviews

    2.8 (6)
    Avatar
    user_eDi3EVvp
    2025-04-24

    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!

    Avatar
    user_EmGmsJA5
    2025-04-24

    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!

    Avatar
    user_7zYbYmhO
    2025-04-24

    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!

    Avatar
    user_6P72fzuN
    2025-04-24

    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!

    Avatar
    user_umQ3sXwE
    2025-04-24

    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!

    Avatar
    user_JWOKHYq1
    2025-04-24

    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.