KW

keli-wen/mcp_chatbot

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

252 stars 54 forks 품질 66 트렌드 18MIT

keli-wen/mcp_chatbot는 [[T0]에서 가져온 MCP 서버 후보입니다.

개요

keli-wen/mcp_chatbot는 [[T0]에서 가져온 MCP 서버 후보입니다.

개요(AI 번역)

이 프로젝트는 모델 컨텍스트 프로토콜(MCP)을 맞춤형 LLM(예: Qwen)과 통합하는 방법을 시연하여, MCP 서버를 통해 다양한 도구와 상호작용할 수 있는 강력한 챗봇을 만듭니다. 이 구현은 LLM이 외부 도구를 원활하게 사용할 수 있도록 함으로써 MCP의 유연성을 보여줍니다.

[! 팁] 중국어 버전은 README_ZH.md.를 참고해 주세요.

개요

챗봇 스트림릿 예시

워크플로우 추적기 예시

  • 🚩 업데이트 (2025-04-11):
  • 챗봇 스트림릿 예시 추가.
  • 🚩 업데이트 (2025-04-10):
  • 더 복잡한 LLM 응답 파싱, 다중 MCP 도구 호출 및 다중 채팅 반복 지원.
  • 일반 모드와 스트리밍 모드 모두를 지원하는 단일 프롬프트 예제 추가.
  • 인터랙티브 터미널 챗봇 예시 추가.

이 프로젝트에는 다음이 포함됩니다:

  • 단순/복잡 CLI 챗봇 인터페이스
  • 일부 내장된 MCP 서버(예: 마크다운 처리 도구)와의 통합
  • 맞춤형 LLM(예: Qwen) 및 Ollama 지원
  • 일반 및 스트리밍 모드 모두에서 단일 프롬프트 처리용 스크립트 예시
  • 정규 및 스트리밍 응답 모드를 갖춘 인터랙티브 터미널 챗봇

요구 사항

  • 파이썬 3.10+
  • 의존성 (요구사항을 통해 자동으로 설치됨):

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

MCPChatbot Example

This project demonstrates how to integrate the Model Context Protocol (MCP) with customized LLM (e.g. Qwen), creating a powerful chatbot that can interact with various tools through MCP servers. The implementation showcases the flexibility of MCP by enabling LLMs to use external tools seamlessly.

[!TIP] For Chinese version, please refer to README_ZH.md.

Overview

Chatbot Streamlit Example

Workflow Tracer Example

  • 🚩 Update (2025-04-11):
    • Added chatbot streamlit example.
  • 🚩 Update (2025-04-10):
    • More complex LLM response parsing, supporting multiple MCP tool calls and multiple chat iterations.
    • Added single prompt examples with both regular and streaming modes.
    • Added interactive terminal chatbot examples.

This project includes:

  • Simple/Complex CLI chatbot interface
  • Integration with some builtin MCP Server like (Markdown processing tools)
  • Support for customized LLM (e.g. Qwen) and Ollama
  • Example scripts for single prompt processing in both regular and streaming modes
  • Interactive terminal chatbot with regular and streaming response modes

Requirements

  • Python 3.10+
  • Dependencies (automatically installed via requirements):
    • python-dotenv
    • mcp[cli]
    • openai
    • colorama

Installation

  1. Clone the repository:

    git clone [email protected]:keli-wen/mcp_chatbot.git
    cd mcp_chatbot
    
  2. Set up a virtual environment (recommended):

    cd folder
    
    # Install uv if you don't have it already
    pip install uv
    
    # Create a virtual environment and install dependencies
    uv venv .venv --python=3.10
    
    # Activate the virtual environment
    # For macOS/Linux
    source .venv/bin/activate
    # For Windows
    .venv\Scripts\activate
    
    # Deactivate the virtual environment
    deactivate
    
  3. Install dependencies:

    pip install -r requirements.txt
    # or use uv for faster installation
    uv pip install -r requirements.txt
    
  4. Configure your environment:

    • Copy the .env.example file to .env:

      cp .env.example .env
      
    • Edit the .env file to add your Qwen API key (just for demo, you can use any LLM API key, remember to set the base_url and api_key in the .env file) and set the paths:

      LLM_MODEL_NAME=your_llm_model_name_here
      LLM_BASE_URL=your_llm_base_url_here
      LLM_API_KEY=your_llm_api_key_here
      OLLAMA_MODEL_NAME=your_ollama_model_name_here
      OLLAMA_BASE_URL=your_ollama_base_url_here
      MARKDOWN_FOLDER_PATH=/path/to/your/markdown/folder
      RESULT_FOLDER_PATH=/path/to/your/result/folder
      

Important Configuration Notes ⚠️

Before running the application, you need to modify the following:

  1. MCP Server Configuration:
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "markdown_processor": { "command": "/path/to/your/uv", "args": [ "--directory", "/path/to/your/project/mcp_servers", "run", "markdown_processor.py" ] } } }