Skip to main content

ESP-IDF Documentation Explorer MCP Server

Project description

ESP-IDF Documentation Explorer MCP Server

A Model Context Protocol (MCP) server for exploring ESP-IDF documentation online. This server fetches content directly from the official ESP-IDF documentation website, ensuring you always have access to the latest information. This implementation is inspired by the AWS Documentation MCP Server.

Features

  • Online Search: Search ESP-IDF documentation directly from the official website
  • Real-time Content: Always access the latest documentation without local setup
  • Multi-version Support: Choose ESP-IDF version (latest or specific versions)
  • API Reference Search: Find API references for ESP-IDF components
  • Smart Caching: Intelligent caching for improved performance

Installation and Usage

From PyPI (Recommended)

# Install and run directly
uvx esp-idf-docs-mcp

# Or install globally
pip install esp-idf-docs-mcp

From Source

# Run directly from GitHub
uvx --from git+https://github.com/raihalea/esp-idf-docs.git esp-idf-docs-mcp

Development Installation

# Clone and install for development
git clone https://github.com/raihalea/esp-idf-docs.git
cd esp-idf-docs

# Install dependencies only
uv sync

# Install with development dependencies
uv sync --dev

Usage in MCP Clients

Add the following to your MCP client configuration (e.g., Claude Desktop):

{
  "mcpServers": {
    "esp-idf-docs": {
      "command": "uvx",
      "args": ["esp-idf-docs-mcp"],
      "env": {
        "ESP_IDF_VERSION": "latest"
      }
    }
  }
}

Alternative configurations:

// Using pip installed package
{
  "mcpServers": {
    "esp-idf-docs": {
      "command": "esp-idf-docs-mcp",
      "env": {
        "ESP_IDF_VERSION": "latest"
      }
    }
  }
}

// Using source from GitHub
{
  "mcpServers": {
    "esp-idf-docs": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/raihalea/esp-idf-docs.git",
        "esp-idf-docs-mcp"
      ],
      "env": {
        "ESP_IDF_VERSION": "latest"
      }
    }
  }
}

Usage from DevContainers

See Simple Usage Guide for detailed instructions on using this MCP server from other DevContainer projects.

Available Tools

search_docs

Search ESP-IDF documentation for keywords (case-insensitive).

Parameters:

  • query (string): Search query

get_doc_structure

Get the directory structure of ESP-IDF documentation.

Parameters: None

read_doc

Read the contents of a specific documentation file.

Parameters:

  • file_path (string): Relative path to the documentation file

find_api_references

Find API references for a specific ESP-IDF component.

Parameters:

  • component (string): Component or API name to search for

Environment Variables

ESP_IDF_VERSION

ESP-IDF documentation version to use (defaults to "latest").

Available versions:

  • latest - Latest stable version
  • v5.1 - ESP-IDF v5.1
  • v5.0 - ESP-IDF v5.0
  • v4.4 - ESP-IDF v4.4
  • etc.

Setting the environment variable:

# Linux/macOS
export ESP_IDF_VERSION="v5.1"

# Windows Command Prompt
set ESP_IDF_VERSION=v5.1

# Windows PowerShell
$env:ESP_IDF_VERSION="v5.1"

ESP_IDF_BASE_URL

Base URL for ESP-IDF documentation (defaults to official site).

export ESP_IDF_BASE_URL="https://docs.espressif.com/projects/esp-idf"

Usage examples:

# Run with specific version (PyPI)
ESP_IDF_VERSION="v5.1" uvx esp-idf-docs-mcp

# Run with latest (default)
uvx esp-idf-docs-mcp

# Run from source with specific version
ESP_IDF_VERSION="v5.1" uvx --from git+https://github.com/raihalea/esp-idf-docs.git esp-idf-docs-mcp

Testing

Run the test suite:

# Install development dependencies
uv sync --dev

# Run all tests
uv run pytest

# Run tests with verbose output
uv run pytest -v

# Run specific test file
uv run pytest tests/test_minimal.py -v

# Run tests with coverage (if coverage is installed)
uv run pytest --cov=src/esp_idf_docs_mcp

Test Categories

  • Basic Tests (test_minimal.py): Core functionality and imports
  • Implementation Tests (test_fixed.py): Actual implementation validation
  • Comprehensive Tests (test_comprehensive.py): Error handling, security, performance, and robustness
  • Integration Tests (test_explorer_integration.py): End-to-end ESPIDFDocsExplorer testing

Development

Code Quality

This project uses ruff for linting and formatting:

# Install development dependencies
uv sync --dev

# Run linter
uv run ruff check src/ tests/

# Auto-fix linting issues
uv run ruff check src/ tests/ --fix

# Format code
uv run ruff format src/ tests/

# Check formatting
uv run ruff format --check src/ tests/

Development Workflow

Common development commands:

# Setup development environment
uv sync --dev

# Run all quality checks
uv run ruff check src/ tests/ && uv run ruff format src/ tests/ && uv run pytest && uv run mypy src/ --ignore-missing-imports

# Run individual checks
uv run ruff check src/ tests/              # Linting
uv run ruff check src/ tests/ --fix        # Auto-fix linting
uv run ruff format src/ tests/             # Format code
uv run pytest                              # Run tests
uv run mypy src/ --ignore-missing-imports  # Type checking

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

esp_idf_docs_mcp-0.1.3.tar.gz (52.2 kB view details)

Uploaded Source

Built Distribution

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

esp_idf_docs_mcp-0.1.3-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file esp_idf_docs_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: esp_idf_docs_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 52.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for esp_idf_docs_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d9b24f45ce8aa5a70ec86ae85248a91ca11f6e49d6dcc233942db783a1999366
MD5 e57240b81ecbc70cfc3444ab2cb48ab0
BLAKE2b-256 7a2ef7c10f60e5a27818be1edace1685fa408e1e7ea34bb46e8118ea96955828

See more details on using hashes here.

Provenance

The following attestation bundles were made for esp_idf_docs_mcp-0.1.3.tar.gz:

Publisher: publish.yml on raihalea/esp-idf-docs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file esp_idf_docs_mcp-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for esp_idf_docs_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 99d952b65c8318f7f1ba8c50e24185beb6a0a4c88bb5619b558ffcbc6a2656a0
MD5 4d7827e55eebf8de8ee0fb6d7a2826ea
BLAKE2b-256 4f2dcdd1294b7295f46b3d00b09269f1266b479f781e73b62f62827a66ea63dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for esp_idf_docs_mcp-0.1.3-py3-none-any.whl:

Publisher: publish.yml on raihalea/esp-idf-docs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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