Skip to main content

MCP server for IoT Cloud

Project description

commands

uv init --package iot-mcp-server cd iot-mcp-server uv add "mcp[cli]" uv add pyjwt uv add requests

uv run mcp install server.py # install to Claude Desktop uv run mcp dev server.py # debug uv run mcp run server.py # run uv run main.py # test main.py without mcp

uv run mcp install server.py --with requests --with pyjwt --env-var BASE_URL=https://iot-api.quectelcn.com --env-var ACCESS_KEY=24b9zq36CtkVFHSiBW9aMeLF --env-var ACCESS_SECRET=6AUSH6PmD22dYjMLonHuiKEp5S83GkQ83epBbDqG

sample prompt

List product from IoTCloud. 请列出我在IoTCloud上的所有产品。

Get the full product definition of the Light1 product. 找到产品Light1的productKey并据此获取它的完整定义。

Get the productKey of product Light1 and use it to list devices of the product.

sample config.json

{ "globalShortcut": "", "mcpServers": { "iot-mcp-server": { "command": "C:\Users\gatem\.local\bin\uv.EXE", "args": [ "run", "--with", "mcp[cli]", "--with", "pyjwt", "--with", "requests", "mcp", "run", "C:\Users\gatem\app\mcp-server-demowin\server.py" ], "env": { "BASE_URL": "https://iot-api.quectelcn.com", "ACCESS_KEY": "24b9zq36CtkVFHSiBW9aMeLF", "ACCESS_SECRET": "6AUSH6PmD22dYjMLonHuiKEp5S83GkQ83epBbDqG" } } } }

{ "globalShortcut": "", "mcpServers": { "iot-mcp-server": { "command": "C:\Users\gatem\.local\bin\uvx.EXE", "args": [ "iot-mcp-server" ], "env": { "BASE_URL": "https://iot-api.quectelcn.com", "ACCESS_KEY": "24b9zq36CtkVFHSiBW9aMeLF", "ACCESS_SECRET": "6AUSH6PmD22dYjMLonHuiKEp5S83GkQ83epBbDqG" } } } }

curl -X 'POST'
'https://iot-gateway.quectel.com/v2/deviceshadow/r3/openapi/dm/writeData'
-H 'accept: /'
-H 'Authorization: QJWT eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMzc0MDMxNTA5MTAyNDczIiwiaWF0IjoxNzQ3ODk0NjE5LCJqdGkiOiI1MzY3MmU2Mi0yNjdkLTRmYmEtODAxMi03YWJhMmZjNDRkYzAiLCJ1dHkiOiJtZW0iLCJleHAiOjE3NDc5ODEwMTksImFtIjoiQWNjZXNzS2V5In0.XCvtCiB3oxLD0CxNU_N8L2H-aNQIot85jG_U3AI2kPA'
-H 'Content-Type: application/json'
-d '{ "data": "[{"switch":"true"}]", "devices": [ "VDU4198" ], "productKey": "p11u3h" }'

curl -X 'POST'
'https://iot-api.quectelcn.com/v2/deviceshadow/r3/openapi/dm/writeData'
-H 'accept: /'
-H 'Authorization: QJWT eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMzc0MDMxNTA5MTAyNDczIiwiaWF0IjoxNzQ3ODk0NjE5LCJqdGkiOiI1MzY3MmU2Mi0yNjdkLTRmYmEtODAxMi03YWJhMmZjNDRkYzAiLCJ1dHkiOiJtZW0iLCJleHAiOjE3NDc5ODEwMTksImFtIjoiQWNjZXNzS2V5In0.XCvtCiB3oxLD0CxNU_N8L2H-aNQIot85jG_U3AI2kPA'
-H 'Content-Type: application/json'
-d '{ "data": "[{"switch":"true"}]", "devices": [ "VDU4198" ], "productKey": "p11u3h" }'

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

iot_mcp_server-0.3.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

iot_mcp_server-0.3.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file iot_mcp_server-0.3.0.tar.gz.

File metadata

  • Download URL: iot_mcp_server-0.3.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for iot_mcp_server-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b77289768634a01fc34d0da0446a1ad7373109232306efd7fcb28ed3b427c970
MD5 5c43e0ad7b667b5c2b213400a45f5cc0
BLAKE2b-256 407607ee2e762c2d2e3a641fb771d489b1ddf692c8f45a836c2a8701a08b2d8e

See more details on using hashes here.

File details

Details for the file iot_mcp_server-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iot_mcp_server-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c83bce568f0a2283d95d73b7aea33d27af1ad57c40a358f12f8e1d2a1d7bdda9
MD5 2898169848f579566b3a25cf49e26658
BLAKE2b-256 2e0087f727dcbe037492c7328018d42e39e25e004090006feceda78a78f85494

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