Logo ESP32 CYD MCP Server

ESP32 CYD MCP Server

Cộng đồng
OfryL

Control esp cyd with mcp

Nhà phát hànhOfryL
Kho mãesp-cyd-mcp
Ngôn ngữC++
Bản fork
3
Sao
11
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    ESP32 CYD MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    11 sao và 3 bản fork từ kho mã được liên kết.

ESP32 CYD MCP Server

A comprehensive Model Context Protocol (MCP) server implementation for the ESP32 CYD (Cheap Yellow Display) board. This project provides extensive remote control capabilities for the ESP32-2432S028R board through a WebSocket-based MCP interface.

Features

MCP Server Core

  • WebSocket-based MCP protocol implementation
  • JSON-RPC 2.0 compliant
  • Real-time bidirectional communication
  • Multiple client support
  • Event notifications

Tool Categories

Display Tools (20+ tools)

  • display.clear - Clear screen with color
  • display.text - Draw text with positioning and styling
  • display.line - Draw lines with thickness
  • display.rectangle - Draw rectangle outlines
  • display.fillRectangle - Draw filled rectangles
  • display.circle - Draw circle outlines
  • display.fillCircle - Draw filled circles
  • display.pixel - Draw individual pixels
  • display.backlight - Control backlight on/off
  • display.brightness - Set display brightness (0-255)
  • display.rotation - Set display rotation (0-3)
  • display.progressBar - Draw progress bars
  • display.info - Get display information

Touch Tools (10+ tools)

  • touch.getState - Get current touch state
  • touch.enable - Enable/disable touch input
  • touch.calibrate - Calibrate touch screen
  • touch.getHistory - Get recent touch events
  • touch.simulate - Simulate touch events
  • touch.getCalibration - Get calibration values
  • touch.saveCalibration - Save calibration to file
  • Gesture detection (swipe support)

GPIO Tools (15+ tools)

  • gpio.pinMode - Set pin mode (input/output/PWM)
  • gpio.digitalWrite - Write digital value
  • gpio.digitalRead - Read digital value
  • gpio.analogWrite - PWM output
  • gpio.analogRead - Read analog value
  • gpio.attachInterrupt - Attach interrupts
  • gpio.setPWM - Configure PWM with frequency
  • gpio.tone - Generate tones
  • gpio.pulseIn - Measure pulse duration

Sensor Tools (10+ tools)

  • sensor.readTemperature - Read temperature sensor
  • sensor.readLight - Read light sensor
  • sensor.readInternalTemp - ESP32 internal temperature
  • sensor.readHallSensor - Built-in hall sensor
  • sensor.readBatteryVoltage - Power supply voltage
  • sensor.readAll - Read all sensors at once
  • sensor.calibrate - Calibrate sensors
  • sensor.getEnvironment - Environmental summary

Network Tools (15+ tools)

  • network.status - Get network status
  • network.connect - Connect to WiFi
  • network.scan - Scan for networks
  • network.startAP - Start access point
  • network.httpRequest - Make HTTP requests
  • network.ping - Ping hosts
  • network.getTime - Get NTP time
  • network.setMDNS - Configure mDNS

System Tools (20+ tools)

  • system.info - Comprehensive system information
  • system.restart - Restart ESP32
  • system.sleep - Deep/light sleep modes
  • system.memory - Memory statistics
  • system.tasks - FreeRTOS task info
  • system.setCPUFrequency - CPU speed control
  • system.performanceMode - Performance optimization
  • system.factoryReset - Factory reset

File Tools (15+ tools)

  • file.list - List files/directories
  • file.read - Read file contents
  • file.write - Write to file
  • file.delete - Delete files
  • file.mkdir - Create directories
  • file.copy - Copy files
  • file.storage - Storage statistics
  • Support for SPIFFS and SD card

Audio Tools (15+ tools)

  • audio.tone - Play single tone
  • audio.playMelody - Play melodies
  • audio.beep - Simple beep sounds
  • audio.playPattern - Custom tone patterns
  • audio.notification - Notification sounds
  • audio.alarm - Alarm patterns
  • audio.setVolume - Volume control
  • Predefined melodies (Mario, Star Wars, etc.)

Hardware Requirements

  • ESP32-2432S028R (CYD) board
  • 2.8" ILI9341 TFT display (240x320)
  • XPT2046 resistive touch controller
  • Optional: SD card for file storage
  • Optional: External sensors (temperature, light)

Installation

  1. Install PlatformIO or Arduino IDE
  2. Clone this repository
  3. Open the project in PlatformIO
  4. Build and upload to your ESP32 CYD board
bash
git clone https://github.com/yourusername/esp32-cyd-mcp
cd esp32-cyd-mcp
pio run -t upload

Configuration

Edit include/config.h to customize:

  • WiFi credentials
  • Pin assignments
  • Server ports
  • Display settings
  • Sensor calibration

Usage

Connecting to the MCP Server

  1. Power on the ESP32 CYD board
  2. Connect to WiFi or use the AP mode
  3. Find the device IP address on the display
  4. Connect via WebSocket to ws://[IP]:3001

Example MCP Request

json
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tools/invoke",
  "params": {
    "name": "display.text",
    "arguments": {
      "text": "Hello MCP!",
      "x": 50,
      "y": 100,
      "color": "white",
      "size": 2
    }
  }
}

Using with Claude Desktop

Add to your Claude Desktop configuration:

json
{
  "mcpServers": {
    "esp32-cyd": {
      "command": "websocat",
      "args": ["ws://192.168.1.100:3001"]
    }
  }
}

API Documentation

Tool Invocation

All tools are invoked using the standard MCP tools/invoke method:

json
{
  "method": "tools/invoke",
  "params": {
    "name": "tool.name",
    "arguments": { ... }
  }
}

Event Notifications

The server sends notifications for various events:

  • touch.event - Touch input events
  • sensor.update - Periodic sensor updates
  • network.event - Network state changes
  • gpio.interrupt - GPIO interrupt events

Development

Adding New Tools

  1. Create header file in include/tools/
  2. Implement in src/tools/
  3. Register tools in the registerTools() method
  4. Add initialization in main.cpp

Project Structure

esp32-cyd-mcp/
├── include/
│   ├── config.h           # Configuration
│   ├── mcp_server.h       # MCP server core
│   └── tools/            # Tool headers
├── src/
│   ├── main.cpp          # Main application
│   ├── mcp_server.cpp    # MCP implementation
│   └── tools/           # Tool implementations
├── platformio.ini        # PlatformIO config
└── README.md

Troubleshooting

  • WiFi Connection Issues: Check credentials in config.h
  • Touch Not Working: Run touch calibration tool
  • Display Issues: Verify display rotation setting
  • Memory Issues: Monitor free heap, reduce tool usage

License

This project is open source and available under the MIT License.

Contributing

Contributions are welcome! Please submit pull requests or open issues for bugs and feature requests.

Acknowledgments

  • ESP32 community for hardware support
  • TFT_eSPI library for display drivers
  • MCP specification for protocol design

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "ofryl-esp-cyd-mcp": {
      "command": "",
      "args": []
    }
  }
}

Dùng MCP ESP32 CYD MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối ESP32 CYD MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm ESP32 CYD MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của ESP32 CYD MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "ofryl-esp-cyd-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "esp-cyd-mcp"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của ESP32 CYD MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của ESP32 CYD MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng ESP32 CYD MCP Server giúp tôi làm việc này không?
ESP32 CYD MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng ESP32 CYD MCP Server.

Câu hỏi thường gặp

Máy chủ MCP ESP32 CYD MCP Server dùng để làm gì?

ESP32 CYD MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP ESP32 CYD MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng ESP32 CYD MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP ESP32 CYD MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối ESP32 CYD MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP ESP32 CYD MCP Server với TypingMind?

ESP32 CYD MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP ESP32 CYD MCP Server cung cấp những công cụ nào trong TypingMind?

ESP32 CYD MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP ESP32 CYD MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu ESP32 CYD MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇