MCP ExplorerExplorer

Xiaozhiai Mcp Client

@Baozhi888on 21 days ago
1 MIT
FreeCommunity
AI Systems
# XiaoZhi MCP Client for Gmail Email Sending and Receiving, Local and Remote Server Management

Overview

What is Xiaozhiai Mcp Client

xiaozhiAI_mcp_client is a multi-functional control platform based on the MCP protocol, designed for Gmail mail automation, PDF/Markdown generation, and server/container/log management. It leverages AI capabilities for smart office solutions, remote operations, and automated email processing.

Use cases

Use cases include automating email responses, generating reports in PDF/Markdown format, managing server processes and logs, and orchestrating Docker containers for application deployment.

How to use

To use xiaozhiAI_mcp_client, first install the dependencies using ‘pip install -r requirements.txt’. Configure environment variables for Gmail credentials and log levels, then start all services with ‘bash manage_mcp.sh’. You can also run individual services for Gmail or server management using the provided Python scripts.

Key features

Key features include Gmail mail sending and receiving, PDF/Markdown generation, server management (processes, packages, security, etc.), Docker container management, log monitoring, and customizable security policies for command execution.

Where to use

xiaozhiAI_mcp_client can be used in various fields such as smart office automation, remote maintenance, automated email handling, and server management.

Content

MCP 多功能控制平台(邮件与服务器管理)

MCP Multi-functional Control Platform (Mail & Server Management)


项目简介 | Project Overview

本项目是一个基于小智AI的MCP协议的多功能控制平台,集成了Gmail邮件自动化PDF/Markdown生成服务器/容器/日志管理等能力,支持小智AI对话自动调用,适用于智能办公、远程运维、自动化邮件处理等场景。

This project is a multi-functional control platform based on the MCP protocol, integrating Gmail mail automation, PDF/Markdown generation, server/container/log management, and more. It is designed for AI-driven smart office, remote O&M, and automated email processing.


主要功能 | Main Features

  • 📧 Gmail 邮件收发、附件(PDF/Markdown/JSON)生成与发送、内容分析与回复建议
  • 📝 支持中文PDF/Markdown生成,自动注册字体,兼容Windows/Linux
  • 🖥️ 服务器管理:服务/进程/包/网络/安全/计划任务/备份/文件/磁盘/端口等一站式操作
  • 🐳 容器管理:支持Docker容器与Compose编排的启动、停止、重启、日志、inspect等
  • 📑 日志管理:tail、grep、实时监控、统计、日志安全检查
  • 🔒 灵活安全策略:可自定义命令执行限制,兼顾安全与自动化
  • 🧩 结构化接口,LLM友好,便于AI自动调用和解析

目录结构 | Project Structure

.
├── gmail_mcp.py         # Gmail邮件自动化主模块
├── server_mcp.py        # 服务器与容器管理主模块
├── docker_mcp.py        # Docker相关操作(可选)
├── mcp_pipe.py          # MCP通信主管道
├── calculator.py        # 计算器MCP工具示例
├── manage_mcp.sh        # 一键启动脚本
├── configs/             # 配置文件(如日志配置)
├── logs/                # 日志文件目录
├── test/                # 测试用例
├── requirements.txt     # 依赖包列表
├── .gitignore           # Git忽略规则
└── README.md            # 项目说明文档

快速开始 | Quick Start

  1. 安装依赖 | Install dependencies

    pip install -r requirements.txt
    
  2. 环境变量配置 | Set up environment variables

    • 可通过.env文件或系统环境变量配置Gmail凭据、日志等级等
    • 例如:
      LOG_LEVEL=INFO
      GMAIL_API_CREDENTIALS_FILE=gmail_credentials.json
      TOKEN_PATH=token.json
      
  3. 一键启动所有服务 | One-click Start All Services

    bash manage_mcp.sh
    
  4. 单独运行Gmail邮件MCP服务 | Run Gmail MCP Service

    python gmail_mcp.py
    
  5. 单独运行服务器管理MCP服务 | Run Server MCP Service

    sudo python server_mcp.py
    
  6. 测试 | Run Tests

    pytest test/
    

典型用法 | Typical Usage

  • 发送带PDF/Markdown/JSON附件的邮件
  • 自动分析邮件内容,生成回复建议
  • 一键获取服务器状态、服务/进程/日志/网络信息
  • 远程执行命令、管理容器、备份与恢复
  • 日志tail/grep/统计/实时监控

依赖环境 | Requirements

  • Python 3.7+
  • 详见 requirements.txt,主要依赖:
    • google-api-python-client, google-auth, google-auth-oauthlib
    • websockets, python-dotenv, mcp, pydantic, psutil, paramiko, cryptography
    • reportlab, PyPDF2, markdown, markdown-it-py, python-markdown-math 等

安全与隐私 | Security & Privacy

  • 谷歌邮箱token.jsongmail_credentials.json 已加入 .gitignore,请勿上传敏感凭据到远程仓库。
  • 支持自定义命令/路径/服务名的安全限制,生产环境建议开启严格模式。

开发人员 | Developers


贡献与反馈 | Contributing

欢迎提交PR、Issue,或提出改进建议!

Contributions and suggestions are welcome!


致谢与引用 | Acknowledgments & References

  • 本项目部分设计和实现参考自 mcp-calculator
  • 服务端与AI物联网生态 xiaozhi-esp32
  • 感谢虾哥提供的优秀项目,本项目将不断完善,欢迎PR

License

MIT License

Tools

No tools

Comments