Skip to main content

MCP(Model Context Protocol) Hardware Abstract Layer

Project description

mcp4hal

Getting started

本项目实现了基于mqtt broker进行mcp协议转换,可以将mqtt client变成一个可以被llm agent调用的mcp server/tools。

架构图

如何使用

sdk&源码

example运行

  • 搭建一个mqtt broker,可以选择使用mosquitto

  • 选择一个mcu,比如esp32S3,也可以软件模拟(可以参考mcp4hal/tests/mqtt/mock_mqtt_mcu.py)。

  • 启动参考项目

     # server
     > cd $source_code_dir
     > mv .env.example .evn  # 编辑.env文件,正确配置相关参数
     > ./startup.sh  # 启动服务
    
     # client
     > # 连接好esp32设备
     > cd $source_code_dir/hardware/base/micropython/mcp4hal_mqtt
     > # 修改main.py文件头部的相关配置,包括wifi和mqtt配置
     > cd $source_code_dir/hardware/esp32/script
     > # 编辑flash.sh文件,配置好相关变量
     > ./flash.sh  # 将client代码刷到esp32上
     > # 重新启动esp32板子,可以看到日志输出,wifi连接以及mqtt连接
    
  • 调用测试:使用mcp inspector进行mcp调用测试

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp4hal-0.0.5.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp4hal-0.0.5-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp4hal-0.0.5.tar.gz.

File metadata

  • Download URL: mcp4hal-0.0.5.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for mcp4hal-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1b9e444f1d8a199ab32b89b804d1dd1edc370bc7f5aa4d37dd133b42ac617678
MD5 f55893520894060e8de49a60dffca4e8
BLAKE2b-256 14af3d9e1b246b33ff263cff1203fbe8865466c7a471cbfb53610b3b2345c082

See more details on using hashes here.

File details

Details for the file mcp4hal-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: mcp4hal-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for mcp4hal-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 befde5fa61caae5dc23a5f9519b9b8f1cbadaa5d39fa5569ae8d086dbf01b46c
MD5 7ab30f04aa86e9b3accadac2d536be3d
BLAKE2b-256 9ccf9840c54215cc9cc99f0c779005a3dfa708d39ef038baa83573b207b0f738

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page