Skip to content

Commit 3c6c111

Browse files
authored
docs: add Espressif Documentation MCP Server section to AGENTS.md
- Documents the two available MCP server options (official vs community) - Official mcp.espressif.com is latest-only; warns agents not to use it for WLED-MM firmware API lookups - Community esp-idf-docs-mcp (PyPI) supports ESP_IDF_VERSION=v4.4, which matches arduino-esp32 2.0.17 = ESP-IDF 4.4.8 - Clarifies that idf.py mcp-server build/flash tools are incompatible (requires IDF 6.0 + CMake project; WLED-MM uses PlatformIO/Arduino) - Adds version-pinning requirement and usage guidance
1 parent afd4108 commit 3c6c111

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,80 @@ Using AI-generated code can hide the source of the inspiration / knowledge / sou
254254
255255
- **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).
256256
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.
257+
258+
## Optional External Resources for AI Agents
259+
260+
### Espressif Documentation MCP Server
261+
262+
An MCP server can provide ESP-IDF API documentation to AI agents more efficiently
263+
than scraping web pages — returning precise, low-noise content directly from the
264+
official corpus.
265+
266+
**Use it only for documentation lookups — not for build or flash operations.**
267+
The `idf.py mcp-server` build/flash tooling introduced in ESP-IDF 6.0 is
268+
**incompatible** with WLED-MM: the project is built with PlatformIO and the
269+
Arduino framework, not a native ESP-IDF CMake project.
270+
271+
#### Which server to use
272+
273+
Two options exist. Choose based on which is available in your agent environment:
274+
275+
| Server | Version pinning | Recommended for WLED-MM |
276+
|---|---|---|
277+
| `mcp.espressif.com` (official) | ❌ Latest docs only — no version param | ⚠️ Avoid for firmware API questions |
278+
| `esp-idf-docs-mcp` (PyPI, community) | ✅ `ESP_IDF_VERSION=v4.4` | ✅ Preferred |
279+
280+
The **official server** (`mcp.espressif.com`) exposes a single tool,
281+
`search_espressif_sources(query, language)`, with no version selector. It always
282+
returns results from the latest ESP-IDF release (currently v5.x / v6.x). Do not
283+
use it to look up firmware APIs, as the answers will silently describe a different
284+
IDF version than what WLED-MM actually uses.
285+
286+
The **community package** (`pip install esp-idf-docs-mcp` /
287+
`uvx esp-idf-docs-mcp`) fetches content directly from the versioned Espressif
288+
documentation site. Configure it with:
289+
290+
```json
291+
{
292+
"mcpServers": {
293+
"esp-idf-docs": {
294+
"command": "uvx",
295+
"args": ["esp-idf-docs-mcp"],
296+
"env": {
297+
"ESP_IDF_VERSION": "v4.4",
298+
"ESP_IDF_CHIP_TARGET": "esp32"
299+
}
300+
}
301+
}
302+
}
303+
```
304+
305+
Available tools: `search_docs`, `read_doc`, `get_doc_structure`,
306+
`find_api_references`.
307+
308+
#### Version-pinning requirement
309+
310+
> **Always use `ESP_IDF_VERSION=v4.4`.** WLED-MM uses arduino-esp32 2.0.17,
311+
> which is based on ESP-IDF **4.4.8**. ESP-IDF 5.x / 6.x introduced breaking
312+
> changes to `esp_netif`, the timer API, `esp_wifi`, and other subsystems.
313+
> Using the wrong version produces plausible but incorrect answers.
314+
315+
Additionally:
316+
317+
- Cross-reference results with the arduino-esp32 2.0.x HAL source when the API
318+
is accessed through the Arduino layer — the Arduino wrapper may expose a
319+
different interface than the raw IDF call.
320+
- Do **not** assume ESP-IDF 5.x+ APIs are available in WLED-MM firmware code.
321+
322+
#### What it is useful for
323+
324+
- FreeRTOS primitives, peripheral register maps, partition table layouts, and
325+
other platform details that are stable across minor 4.x releases.
326+
- Answering "does this IDF 4.4 API exist / what are its parameters?" without
327+
manually navigating the archived documentation.
328+
329+
#### What it is not a substitute for
330+
331+
- Reading the arduino-esp32 2.0.x source for HAL-level behaviour.
332+
- Checking `platformio.ini` for board-specific `build_flags` and library
333+
overrides that differ from stock IDF defaults.

0 commit comments

Comments
 (0)