酒店预订MCP助手

一个通过MCP服务器将Exely Distribution API与LLM集成的项目,允许通过Telegram机器人进行交互。

  • by Bdata0
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Bdata0/Exely_MCP

使用说明

Read this in other languages: Русский (Russian)

Exely酒店预订MCP助理

一个通过MCP服务器将Exely Distribution API与LLM集成的项目,允许通过Telegram机器人进行交互。

该项目使用Docker进行容器化,以便在任何服务器或VPS上的生产环境中轻松可靠地部署。

主要特点

  • 一键部署:使用 deploy.sh (适用于Linux)或 deploy.ps1 (适用于Windows)用于自动安装和设置的脚本。
  • 交互式设置:脚本将提示您输入必要的API密钥,并为您创建配置文件。
  • 灵活的:您可以将所有组件部署在一台机器上,也可以将MCP服务器和Telegram机器人拆分到不同的服务器上。
  • 生产准备就绪:使用多级Docker构建来创建轻量级和安全的映像。
  • 可靠的:容器配置为在发生故障时自动重启。

项目结构

exely_mcp_project/
├── app/                      # Application source code (FastAPI/MCP server)
│   ├── __init__.py
│   ├── config.py             # Application configuration (reads from .env files)
│   ├── main.py               # FastAPI entrypoint with the MCP server
│   ├── exely_client/         # Client for the Exely API
│   │   ├── __init__.py
│   │   ├── client.py         # The API client itself
│   │   └── schemas.py        # Pydantic models for the Exely API
│   ├── llm_client/           # Client for the Mistral LLM API
│   │   ├── __init__.py
│   │   └── llm_client.py
│   └── mcp_tools/            # MCP tools for the LLM
│       ├── __init__.py
│       ├── schemas_llm.py    # Pydantic models for tool parameters
│       ├── tools.py          # Tool implementation logic
│       └── prompt_utils.py   # Utilities for generating prompts
│
├── telegram_bot.py           # Telegram bot source code
├── pyproject.toml            # Project dependencies and metadata
│
├── README.md                 # Main documentation (English)
├── README.ru.md              # Optional documentation (Russian)
│
│   --- Deployment Files ---
├── deploy.sh                 # Deployment script for Linux/macOS
├── deploy.ps1                # Deployment script for Windows (PowerShell)
├── Dockerfile                # Instructions for building the Docker image
├── .dockerignore             # Specifies files to exclude from the image
├── docker-compose.yml        # Docker Compose for all-in-one deployment
├── docker-compose.server.yml # For deploying the server only
├── docker-compose.bot.yml    # For deploying the bot only
│
│   --- Environment Files (usually not in git) ---
├── .env.prod                 # (Generated) Production environment variables
├── .env.bot.prod             # (Generated) Env vars for a remote bot
└── .env.example              # Template for local development (without Docker)

部署(生产)

这是在VPS或任何其他服务器上运行项目的推荐方法。

先决条件

  • Git 克隆存储库。
  • Docker和Docker Compose:部署脚本将尝试在Ubuntu系统上自动安装它们。对于其他操作系统,请根据官方文档进行安装。

启动说明

  1. 将存储库克隆到您的服务器:

    git clone https://github.com/Bdata0/Exely_MCP.git
    cd ~/Exely_MCP
    
  2. 运行部署脚本: 脚本将检查Docker,提示您提供所有必需的API密钥和令牌,创建配置文件,并启动项目。

    • 对于Linux(Ubuntu、Debian等): 首先,使脚本可执行:

      chmod +x deploy.sh
      

      然后,运行它:

      ./deploy.sh
      
    • 对于Windows(使用PowerShell): 您可能需要允许当前会话执行脚本:

      Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
      

      然后,运行脚本:

      .\deploy.ps1
      
  3. 按照屏幕上的说明进行操作:

    • 脚本将要求您输入 EXELY_API_KEY, MISTRAL_API_KEY,以及 TELEGRAM_BOT_TOKEN。为了安全起见,输入将被隐藏。
    • 接下来,它将提示您选择一个部署场景:
      1. 一体化:在当前计算机上运行服务器和机器人(最常见的选择)。
      2. 仅限服务器:仅运行MCP服务器。
      3. 仅限机器人:只运行Telegram bot(需要服务器的IP地址)。

选择场景后,脚本会自动构建Docker镜像并在后台启动容器。

应用程序管理

  • 检查集装箱状态: docker compose ps
  • 查看实时日志: docker compose logs -f
  • 停止应用程序: docker compose down

您的机器人现在已完全配置并正在运行!