MCPInstall
xiaozhi-mcp-mobile logo

xiaozhi-mcp-mobile

by peterpanstechland 1 stars peterpanstechland/xiaozhi-mcp-mobile

A React Native app for managing MCP services with tools like maps and calculators.

READMEmain

小智MCP工具

React Native Expo HarmonyOS License

小智MCP工具是一个跨平台移动应用,用于管理和使用MCP(Model Control Protocol)服务。支持 Android、iOS、Web 和 HarmonyOS NEXT 多个平台。

此应用允许用户连接到MCP服务器,启用各种工具(如计算器、高德地图服务等),并监控脚本的运行状态。

📱 支持平台

平台技术栈目录
AndroidReact Native + Expo根目录
iOSReact Native + Expo根目录
WebReact Native Web + Expo根目录
HarmonyOS NEXTArkTS + ArkUIharmonyos/

🤖 什么是MCP?

MCP(Model Control Protocol)是一种用于AI模型与外部工具交互的协议。通过MCP,AI助手可以:

  • 调用计算器进行数学运算
  • 查询天气、地图等实时信息
  • 执行自定义脚本和工具
  • 与各种外部服务进行交互

本应用作为MCP客户端,让你能够在移动设备上管理和监控这些工具服务。

✨ 功能特点

  • 🔗 MCP服务器连接 - WebSocket实时通信,支持自动重连
  • 📜 脚本服务管理 - 启动/停止/监控脚本运行状态
  • 🔧 工具开关 - 灵活启用/禁用各种MCP工具
  • 🗺️ 高德地图集成 - 路线规划、天气查询、POI搜索
  • 🧮 计算器工具 - 支持复杂数学表达式计算
  • 💾 数据持久化 - 本地保存设置和状态

📁 项目结构

xiaozhi-mcp-mobile/
├── app/                        # Expo Router 页面 (Android/iOS/Web)
│   ├── (tabs)/                 # 底部标签页面
│   │   ├── index.tsx           # 主页
│   │   └── settings.tsx        # 设置页
│   ├── script.tsx              # 脚本详情页
│   └── _layout.tsx             # 根布局
├── src/                        # React Native 源代码
│   ├── components/             # 可复用UI组件
│   ├── context/                # React Context 状态管理
│   ├── screens/                # 屏幕组件 (传统导航备用)
│   └── services/               # 业务服务层
│       ├── mcpService.js       # MCP服务管理
│       ├── mcpClientService.js # MCP客户端实现
│       ├── calculatorService.js# 计算器服务
│       ├── gaodeService.js     # 高德地图服务
│       └── storageService.js   # 存储服务
├── components/                 # 通用UI组件
├── constants/                  # 常量定义
├── hooks/                      # 自定义Hooks
├── assets/                     # 静态资源
│   ├── fonts/                  # 字体文件
│   └── images/                 # 图片资源
├── harmonyos/                  # 🆕 HarmonyOS NEXT 版本
│   ├── AppScope/               # 应用级配置
│   ├── entry/                  # 主模块
│   │   └── src/main/ets/       # ArkTS 源代码
│   │       ├── pages/          # 页面组件
│   │       ├── services/       # 服务层
│   │       └── model/          # 数据模型
│   └── README.md               # 鸿蒙版本说明
├── App.js                      # 传统入口 (备用)
├── app.json                    # Expo 配置
├── package.json                # 依赖配置
└── README.md                   # 本文件

🚀 快速开始

React Native 版本 (Android/iOS/Web)

前提条件

  • Node.js 16.x 或更高版本
  • npm 或 yarn
  • Expo CLI
  • Android Studio (Android开发) / Xcode (iOS开发)

安装与运行

# 1. 安装依赖
npm install

# 2. 启动开发服务器
npx expo start

# 3. 运行到指定平台
# 按 a 在Android模拟器中运行
# 按 i 在iOS模拟器中运行
# 按 w 在浏览器中运行

构建APK

# 安装EAS CLI
npm install -g eas-cli

# 登录Expo账户
eas login

# 构建APK
eas build --platform android --profile apk

HarmonyOS NEXT 版本

详细说明请查看 harmonyos/README.md

前提条件

  • DevEco Studio 4.0+
  • HarmonyOS SDK (API 12+)

安装与运行

  1. 使用 DevEco Studio 打开 harmonyos/ 目录
  2. 等待项目同步完成
  3. 连接鸿蒙设备或启动模拟器
  4. 点击 Run 按钮运行

🔧 技术栈

React Native 版本

  • 框架: React Native 0.79 + Expo 53
  • 路由: Expo Router
  • UI库: React Native Paper
  • 存储: AsyncStorage
  • 网络: WebSocket

HarmonyOS 版本

  • 语言: ArkTS
  • UI框架: ArkUI 声明式UI
  • 存储: @ohos.data.preferences
  • 网络: @ohos.net.webSocket

🔌 连接MCP服务器

  1. 在应用主页选择"前往设置"
  2. 在"API配置"部分输入MCP服务器地址
    • 格式: wss://server-address:port/path
  3. (可选)配置高德地图API Key
  4. 返回主页,点击"连接"按钮
  5. 连接成功后,即可启用各种工具和脚本服务

📦 构建与发布

React Native

# Android APK
eas build --platform android --profile apk

# iOS (需要Apple开发者账号)
eas build --platform ios

# Web
npx expo export --platform web

HarmonyOS

# 在DevEco Studio中执行
# Build > Build Hap(s)/APP(s) > Build Hap(s)

🔄 自动构建

本项目使用 GitHub Actions 进行自动构建。推送版本标签时会自动触发:

git tag v1.0.0
git push origin v1.0.0

🤝 贡献代码

欢迎贡献代码!请阅读 CONTRIBUTING.md 获取更多信息。

📄 许可证

MIT

📸 截图预览

展开查看应用截图
主页设置脚本详情
连接状态、工具管理API配置、日志设置运行状态、日志查看

🗺️ 路线图

  • React Native 基础版本
  • HarmonyOS NEXT 适配
  • 更多MCP工具支持
  • 深色模式优化
  • 多语言支持 (i18n)
  • 推送通知

📞 联系方式


Made with ❤️ for MCP ecosystem

More Developer Tools MCP servers

Similar servers from the same category.

Sourcebot

sourcebot-dev

Enables code search across multiple repository hosts including GitHub, GitLab, Gitea, Gerrit, and Bitbucket with advanced filtering options for exploring large codebases through natural language queries.

searchgit

CodeAlive

codealive-ai

Provides a bridge to CodeAlive's platform for semantic code search, repository exploration, and context-aware chat completions that leverage deep understanding of entire codebases including documentation and dependencies.

search

Provides a secure, sandboxed environment for executing Python, Node.js, and shell commands in ephemeral containers with file management capabilities for code testing, visualization, and data analysis.

filesystemdatabase

NovaCV

lightbaby

Integrates with NovaCV API to generate, analyze, and convert resumes in various formats without dealing with complex document formatting

PDFSupport+5