-
-
Notifications
You must be signed in to change notification settings - Fork 134
docs: add Espressif Documentation MCP Server guidance to AGENTS.md #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mdev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -254,3 +254,80 @@ Using AI-generated code can hide the source of the inspiration / knowledge / sou | |
|
|
||
| - **For "is it worth doing?" debates** about proposed reliability, safety, or data-integrity mechanisms (CRC checks, backups, power-loss protection): suggest a software **FMEA** (Failure Mode and Effects Analysis). | ||
| Clarify the main feared events, enumerate failure modes, assess each mitigation's effectiveness per failure mode, note common-cause failures, and rate credibility for the typical WLED-MM use case. | ||
|
|
||
| ## Optional External Resources for AI Agents | ||
|
|
||
| ### Espressif Documentation MCP Server | ||
|
|
||
| An MCP server can provide ESP-IDF API documentation to AI agents more efficiently | ||
| than scraping web pages — returning precise, low-noise content directly from the | ||
| official corpus. | ||
|
|
||
| **Use it only for documentation lookups — not for build or flash operations.** | ||
| The `idf.py mcp-server` build/flash tooling introduced in ESP-IDF 6.0 is | ||
| **incompatible** with WLED-MM: the project is built with PlatformIO and the | ||
| Arduino framework, not a native ESP-IDF CMake project. | ||
|
|
||
| #### Which server to use | ||
|
|
||
| Two options exist. Choose based on which is available in your agent environment: | ||
|
|
||
| | Server | Version pinning | Recommended for WLED-MM | | ||
| |---|---|---| | ||
| | `mcp.espressif.com` (official) | ❌ Latest docs only — no version param | ⚠️ Avoid for firmware API questions | | ||
| | `esp-idf-docs-mcp` (PyPI, community) | ✅ `ESP_IDF_VERSION=v4.4` | ✅ Preferred | | ||
|
|
||
| The **official server** (`mcp.espressif.com`) exposes a single tool, | ||
| `search_espressif_sources(query, language)`, with no version selector. It always | ||
| returns results from the latest ESP-IDF release (currently v5.x / v6.x). Do not | ||
| use it to look up firmware APIs, as the answers will silently describe a different | ||
| IDF version than what WLED-MM actually uses. | ||
|
|
||
| The **community package** (`pip install esp-idf-docs-mcp` / | ||
| `uvx esp-idf-docs-mcp`) fetches content directly from the versioned Espressif | ||
| documentation site. Configure it with: | ||
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "esp-idf-docs": { | ||
| "command": "uvx", | ||
| "args": ["esp-idf-docs-mcp"], | ||
| "env": { | ||
| "ESP_IDF_VERSION": "v4.4", | ||
| "ESP_IDF_CHIP_TARGET": "esp32" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Available tools: `search_docs`, `read_doc`, `get_doc_structure`, | ||
| `find_api_references`. | ||
|
|
||
| #### Version-pinning requirement | ||
|
|
||
| > **Always use `ESP_IDF_VERSION=v4.4`.** WLED-MM uses arduino-esp32 2.0.17, | ||
| > which is based on ESP-IDF **4.4.8**. ESP-IDF 5.x / 6.x introduced breaking | ||
| > changes to `esp_netif`, the timer API, `esp_wifi`, and other subsystems. | ||
|
Comment on lines
+310
to
+312
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Check arduino-esp32 version in platformio.ini and verify ESP-IDF version mapping
# Find arduino-esp32 version specification in platformio.ini
echo "=== Checking arduino-esp32 version in platformio.ini ==="
rg -n "platform.*espressif32" platformio.ini
# Also check for any ESP-IDF version specifications
echo -e "\n=== Checking for ESP-IDF version references ==="
rg -n "ESP_IDF|esp-idf|ESP-IDF" platformio.iniRepository: MoonModules/WLED-MM Length of output: 3754 🌐 Web query:
💡 Result: Arduino-esp32 version 2.0.17 is based on ESP-IDF v4.4.7 [1][2]. This is documented in the official release notes for the 2.0.17 version on the Espressif GitHub repository [1]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Search for arduino-esp32 2.0.17 references in platformio.ini ==="
rg -n "arduino-esp32\s*2\.0\.17|2\.0\.17" platformio.ini || true
echo -e "\n=== Search for 4.4.8 references in platformio.ini ==="
rg -n "4\.4\.8" platformio.ini || true
echo -e "\n=== Search for framework-arduinoespressif32 pins around any 2.0.x ==="
rg -n "framework-arduinoespressif32\s*@|arduino-esp32 v2\.[0-9]+" platformio.ini | head -n 80Repository: MoonModules/WLED-MM Length of output: 1584 Fix incorrect arduino-esp32/ESP-IDF mapping in
Update the documentation to match the actual pinned core/version in 🤖 Prompt for AI Agents |
||
| > Using the wrong version produces plausible but incorrect answers. | ||
|
|
||
| Additionally: | ||
|
|
||
| - Cross-reference results with the arduino-esp32 2.0.x HAL source when the API | ||
| is accessed through the Arduino layer — the Arduino wrapper may expose a | ||
| different interface than the raw IDF call. | ||
| - Do **not** assume ESP-IDF 5.x+ APIs are available in WLED-MM firmware code. | ||
|
|
||
| #### What it is useful for | ||
|
|
||
| - FreeRTOS primitives, peripheral register maps, partition table layouts, and | ||
| other platform details that are stable across minor 4.x releases. | ||
| - Answering "does this IDF 4.4 API exist / what are its parameters?" without | ||
| manually navigating the archived documentation. | ||
|
|
||
| #### What it is not a substitute for | ||
|
|
||
| - Reading the arduino-esp32 2.0.x source for HAL-level behaviour. | ||
| - Checking `platformio.ini` for board-specific `build_flags` and library | ||
| overrides that differ from stock IDF defaults. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Does ESP-IDF 6.0 introduce an idf.py mcp-server command for MCP server functionality?💡 Result:
Yes. ESP-IDF v6.0 introduces an MCP server command in idf.py: the documentation explicitly states you can start the server with
idf.py mcp-server(optionallyidf.py -C <project> mcp-server) to enable ESP-IDF MCP server functionality.[1][2]Citations:
Fix the
idf.py mcp-serverwording in AGENTS.md (it exists in IDF v6.0)idf.py mcp-serveris accurate (docs show starting the MCP server viaidf.py mcp-server/idf.py -C <project> mcp-server).🤖 Prompt for AI Agents