Coreflux MCP Server

Coreflux MCP Server

site icon
2025.04.17 2
PythonMQTT 代理控制AI 助手集成开发效率
Coreflux MCP Server 是一个基于 Model Context Protocol (MCP) 的服务器,它连接到 Coreflux MQTT 代理,并将 Coreflux 操作作为工具提供给 Claude 和其他兼容 MCP 的 AI 助手。该服务器提供了多种工具来管理和控制 Coreflux 的命令,包括模型、操作、规则和路由等。
View on GitHub

Overview

基本能力

产品定位

Coreflux MCP Server 是一个用于连接 Coreflux MQTT 代理的 MCP 服务器,旨在为 AI 助手提供管理和控制 Coreflux 命令的工具。

核心功能

  • 连接到 Coreflux MQTT 代理
  • 提供所有 Coreflux 命令的工具(模型、操作、规则、路由)
  • 发现并列出可用的操作
  • 包含 LOT 语言文档作为资源
  • 使用官方 MCP SDK 构建,实现与 Claude 的无缝集成

适用场景

  • 通过 AI 助手管理和控制 Coreflux MQTT 代理
  • 自动化执行 Coreflux 命令
  • 开发和调试 Coreflux 相关应用

工具列表

  • add_rule: 添加新的权限规则
  • remove_rule: 移除权限规则
  • add_route: 添加新的路由连接
  • remove_route: 移除路由连接
  • add_model: 添加新的模型结构
  • remove_model: 移除模型结构
  • add_action: 添加新的操作事件/函数
  • remove_action: 移除操作事件/函数
  • run_action: 运行操作事件/函数
  • remove_all_models: 移除所有模型
  • remove_all_actions: 移除所有操作
  • remove_all_routes: 移除所有路由
  • list_discovered_actions: 列出所有发现的 Coreflux 操作
  • request_lot_code: 根据自然语言提示生成 LOT 代码

常见问题解答

  1. 验证 Claude 配置中的 MQTT 代理凭据
  2. 确保代理可访问
  3. 检查 Claude Desktop 日志
  4. 使用调试日志运行服务器

使用教程

使用依赖

  • Python 环境
  • Coreflux MQTT 代理

安装教程

  1. 创建或编辑配置文件 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS/Linux) 或 %USERPROFILE%\AppData\Roaming\Claude\claude_desktop_config.json (Windows)
  2. 添加以下配置(根据路径调整): json { "mcpServers": { "coreflux": { "command": "python", "args": [ "/PATH/TO/server.py", "--mqtt-host", "localhost", "--mqtt-port", "1883", "--mqtt-user", "root", "--mqtt-password", "coreflux", "--mqtt-client-id", "claude-coreflux-client" ], "description": "Coreflux MQTT Broker Control", "icon": "🔄", "env": {} } } }
  3. 重启 Claude Desktop

调试方式

  1. 检查 Claude 日志(macOS/Linux): bash tail -n 20 -f ~/Library/Logs/Claude/mcp*.log Windows PowerShell: bash Get-Content -Path "$env:USERPROFILE\AppData\Roaming\Claude\Logs\mcp*.log" -Tail 20 -Wait
  2. 使用调试日志运行服务器: bash python server.py --mqtt-host localhost --mqtt-port 1883 --debug

许可证

该项目遵循 Apache-2.0 开源许可条款,请参阅 Apache-2.0 了解完整条款。