Skip to main content

MCP servers for electronics and embedded development: GPIO pin reference, capacitor calculator, and resistor color code decoder

Project description

Electronics MCP Servers ๐Ÿ”งโšก๐Ÿ“Œ

mcp-name: io.github.wedsamuel1230/electronic-mcp-server

Three production-ready MCP (Model Context Protocol) servers for electronics and embedded development, built with FastMCP and Python 3.11+.

Tests Python FastMCP License MCP Registry


๐Ÿ“‹ Table of Contents


๐ŸŽฏ Overview

This project provides three specialized MCP servers for electronics engineering tasks:

  • 103 comprehensive tests - All passing โœ…
  • 14 tools total - Covering resistors, capacitors, and GPIO pins
  • 3 board databases - ESP32, Arduino UNO, STM32 Blue Pill
  • Rich formatted output - With emojis, formulas, and ASCII diagrams

Perfect for hardware engineers, embedded developers, and electronics hobbyists working with Claude Desktop or other MCP-compatible AI assistants.


๐Ÿ› ๏ธ Servers

1. ๐ŸŽจ Resistor Color Code Decoder

Decode and encode resistor color bands, find standard E-series values.

Tools (3):

  • decode_resistor_color_bands - Decode 4-band or 5-band resistor colors to resistance value
  • encode_resistor_value - Convert resistance value to color band sequence
  • find_standard_resistor - Find nearest standard value (E12/E24/E96 series)

Test Coverage: 26 tests โœ…

2. โšก Capacitor Calculator

Calculate electrical properties for capacitor circuits with detailed formulas.

Tools (4):

  • calculate_capacitive_reactance - Calculate Xc = 1/(2ฯ€fC) with current
  • calculate_rc_time_constant - Calculate ฯ„ = RC with charging timeline
  • calculate_resonant_frequency - Calculate fโ‚€ = 1/(2ฯ€โˆšLC) with resonance check
  • suggest_capacitor_for_filter - Recommend E12 capacitor values with ASCII circuit diagrams

Test Coverage: 33 tests โœ…

3. ๐Ÿ“Œ GPIO Pin Reference

Query GPIO pin information for ESP32, Arduino UNO, and STM32 boards.

Tools (7):

  • get_pin_info - Detailed pin capabilities, functions, and usage warnings
  • find_pwm_pins - List all PWM-capable pins with timer information
  • find_adc_pins - List ADC pins with channel info and WiFi compatibility (ESP32)
  • find_i2c_pins - List I2C SDA/SCL pins with default configurations
  • find_spi_pins - List SPI pins (MOSI, MISO, SCK, SS/NSS)
  • check_pin_conflict - Detect conflicts (strapping, ADC2+WiFi, UART, SWD)
  • generate_pin_diagram_ascii - ASCII art pinout diagrams with warnings

Pin Databases:

  • ESP32 (23 pins) - Based on ESP32 Technical Reference Manual v4.8
  • Arduino UNO (20 pins) - Based on ATmega328P datasheet
  • STM32 Blue Pill (35 pins) - Based on STM32F103C8T6 reference manual

Test Coverage: 44 tests โœ…

4. ๐Ÿ”— Combined Server (Recommended for VS Code)

A unified server that combines all 14 tools from the three servers above into a single MCP endpoint.

Why use the combined server?

  • Single configuration entry instead of three
  • All tools available in one session
  • Simpler setup for VS Code Copilot integration
  • Lower resource overhead (one Python process)

File: servers/combined_server.py


๐Ÿ’ป Installation

Prerequisites

  • Python 3.11+
  • uv package manager (recommended) or pip
  • Claude Desktop (for AI integration) or VS Code with MCP support

Method 1: Using uv (Recommended)

# Clone the repository
git clone https://github.com/yourusername/electronics-mcp-servers.git
cd electronics-mcp-servers

# Install dependencies with uv
uv sync

# Verify installation
uv run pytest tests/ -v

Method 2: Using pip

# Clone the repository
git clone https://github.com/yourusername/electronics-mcp-servers.git
cd electronics-mcp-servers

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install package
pip install -e .

# Verify installation
pytest tests/ -v

Method 3: Direct Installation via MCP CLI

# Install via Claude Desktop (auto-configuration)
uv run mcp install servers/resistor_decoder.py --name resistor-decoder
uv run mcp install servers/capacitor_calculator.py --name capacitor-calc
uv run mcp install servers/gpio_reference.py --name gpio-reference

๐Ÿš€ Quick Start

Option 1: Claude Desktop (Recommended)

Step 1: Locate Configuration File

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Step 2: Add Server Configuration

{
  "mcpServers": {
    "resistor-decoder": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/electronics-mcp-servers",
        "run",
        "servers/resistor_decoder.py"
      ]
    },
    "capacitor-calc": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/electronics-mcp-servers",
        "run",
        "servers/capacitor_calculator.py"
      ]
    },
    "gpio-reference": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/electronics-mcp-servers",
        "run",
        "servers/gpio_reference.py"
      ]
    }
  }
}

๐Ÿ’ก Path examples:

  • Windows: "C:\\Users\\yourname\\electronics-mcp-servers"
  • macOS/Linux: "/home/yourname/electronics-mcp-servers"

Step 3: Restart Claude Desktop

  • Quit Claude Desktop completely
  • Relaunch the application
  • Look for MCP tool indicators (hammer icon ๐Ÿ”จ)

Step 4: Test Connection In Claude Desktop, ask:

"What's the color code for a 10kฮฉ resistor?"

Claude should use the encode_resistor_value tool to respond.

Option 2: VS Code with Copilot (Recommended)

VS Code uses a global MCP configuration file. The combined server provides all 14 tools in a single endpoint.

Step 1: Locate your VS Code MCP config file

  • Windows: %APPDATA%\Code\User\mcp.json
  • macOS: ~/Library/Application Support/Code/User/mcp.json
  • Linux: ~/.config/Code/User/mcp.json

Step 2: Add the electronics server configuration

Add this to the servers object in your mcp.json:

{
  "servers": {
    "electronics": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/electronics-mcp-servers",
        "run",
        "python",
        "servers/combined_server.py"
      ],
      "type": "stdio"
    }
  }
}

๐Ÿ’ก Path examples:

  • Windows: "C:\\Users\\yourname\\electronics-mcp-servers" (use \\ for backslashes)
  • macOS: "/Users/yourname/electronics-mcp-servers"
  • Linux: "/home/yourname/electronics-mcp-servers"

Step 3: Reload VS Code

  • Press Ctrl+Shift+P (or Cmd+Shift+P on macOS)
  • Type "Developer: Reload Window" and select it

Step 4: Test the tools

In VS Code Copilot chat, try:

  • "What's the color code for a 4.7kฮฉ resistor?"
  • "Which ESP32 pins can I use with WiFi for analog input?"
  • "Design a 1kHz low-pass filter with 10kฮฉ resistor"

Alternative: Workspace-level config (.vscode/mcp.json)

{
  "servers": {
    "electronics": {
      "command": "uv",
      "args": [
        "--directory",
        "${workspaceFolder}",
        "run",
        "python",
        "servers/combined_server.py"
      ],
      "type": "stdio"
    }
  }
}

Option 3: Direct Testing (Development)

# Test individual server in development mode
uv run fastmcp dev servers/resistor_decoder.py

# Or run directly
uv run python servers/gpio_reference.py

๐Ÿ“š Detailed Usage

๐ŸŽจ Resistor Decoder Tools

Tool 1: decode_resistor_color_bands

Decode 4-band or 5-band resistor color codes to resistance value.

Parameters:

  • bands (List[str]): Color names (e.g., ["Brown", "Black", "Red", "Gold"])
  • Supports 4-band and 5-band resistors

Example Queries:

"What's a Brown-Black-Red-Gold resistor?"
"Decode resistor colors: Yellow, Violet, Orange, Gold"
"What value is red-red-brown-gold?"

Sample Output:

๐ŸŽจ Resistor Color Code: Brown-Black-Red-Gold

๐Ÿ’ก Resistance: 1000ฮฉ (1.00kฮฉ)
๐Ÿ“Š Tolerance: ยฑ5%
๐Ÿ”ข Formula: (1 ร— 10 + 0) ร— 10ยฒ = 1000ฮฉ

Tool 2: encode_resistor_value

Convert resistance value to color band sequence.

Parameters:

  • resistance (float): Resistance in ohms (e.g., 4700)
  • tolerance (float): Tolerance percentage (default: 5)

Example Queries:

"What colors for 4.7kฮฉ resistor?"
"Color code for 100ฮฉ?"
"Give me the bands for 2.2Mฮฉ 1% tolerance"

Sample Output:

๐ŸŽจ Resistor Encoding: 4700ฮฉ (4.70kฮฉ)

๐ŸŒˆ 4-Band Code: Yellow-Violet-Red-Gold
๐Ÿ“Š Tolerance: ยฑ5%
๐Ÿ”ข Decoded: (4 ร— 10 + 7) ร— 10ยฒ = 4700ฮฉ

Tool 3: find_standard_resistor

Find nearest standard E12/E24/E96 resistor value.

Parameters:

  • target_value (float): Desired resistance in ohms
  • series (str): "E12", "E24", or "E96" (default: "E12")

Example Queries:

"Nearest standard resistor to 3300ฮฉ?"
"E24 value closest to 15kฮฉ?"
"What E96 resistor is near 4.7kฮฉ?"

Sample Output:

๐Ÿ“ Standard Resistor Finder

๐ŸŽฏ Target: 3300ฮฉ
๐Ÿ“ฆ Series: E12 (10% tolerance, 12 values per decade)
โœ… Nearest Standard: 3300ฮฉ (exact match!)
๐Ÿ“Š Error: 0.00%
๐ŸŒˆ Color Code: Orange-Orange-Red-Silver

โšก Capacitor Calculator Tools

Tool 1: calculate_capacitive_reactance

Calculate capacitive reactance Xc = 1/(2ฯ€fC) with current calculation.

Parameters:

  • capacitance (float): Capacitance in Farads
  • frequency (float): Frequency in Hz
  • voltage (float, optional): Voltage for current calculation

Example Queries:

"Reactance of 100nF at 1kHz?"
"What's Xc for 10ยตF capacitor at 60Hz?"
"Calculate impedance: 470ยตF at 50Hz with 12V"

Sample Output:

โšก Capacitive Reactance

๐Ÿ“Š Capacitance: 100nF (1.00 ร— 10โปโท F)
๐Ÿ”Š Frequency: 1000Hz
โšก Reactance (Xc): 1591.55ฮฉ
๐Ÿ”ข Formula: Xc = 1 / (2ฯ€ ร— f ร— C) = 1/(2ฯ€ ร— 1000 ร— 1.00ร—10โปโท)

๐Ÿ’ก Current: 7.54mA (at 12V)
๐Ÿ“ Formula: I = V / Xc = 12 / 1591.55

Tool 2: calculate_rc_time_constant

Calculate RC time constant ฯ„ = RC with charging curve timeline.

Parameters:

  • resistance (float): Resistance in Ohms
  • capacitance (float): Capacitance in Farads

Example Queries:

"RC time constant for 10kฮฉ and 100ยตF?"
"How long to charge 470ยตF with 1kฮฉ?"
"Time constant: 4.7kฮฉ, 22ยตF"

Sample Output:

โšก RC Time Constant

๐Ÿ”Œ Resistance: 10kฮฉ (1.00 ร— 10โด ฮฉ)
๐Ÿ”‹ Capacitance: 100ยตF (1.00 ร— 10โปโด F)
โฑ๏ธ  Time Constant (ฯ„): 1.00s
๐Ÿ”ข Formula: ฯ„ = R ร— C = 1.00ร—10โด ร— 1.00ร—10โปโด

๐Ÿ“ˆ Charging Timeline:
  โ€ข 1ฯ„ (1.00s): 63.2% charged
  โ€ข 2ฯ„ (2.00s): 86.5% charged
  โ€ข 3ฯ„ (3.00s): 95.0% charged
  โ€ข 4ฯ„ (4.00s): 98.2% charged
  โ€ข 5ฯ„ (5.00s): 99.3% charged (โ‰ˆ fully charged)

Tool 3: calculate_resonant_frequency

Calculate LC resonant frequency fโ‚€ = 1/(2ฯ€โˆšLC) with resonance check.

Parameters:

  • inductance (float): Inductance in Henries
  • capacitance (float): Capacitance in Farads

Example Queries:

"Resonant frequency for 10mH and 100nF?"
"LC tank circuit: 1ยตH, 10pF"
"What frequency resonates with 470ยตH and 47nF?"

Sample Output:

โšก LC Resonant Frequency

๐Ÿ”— Inductance: 10mH (1.00 ร— 10โปยฒ H)
๐Ÿ”‹ Capacitance: 100nF (1.00 ร— 10โปโท F)
๐Ÿ“ป Resonant Frequency (fโ‚€): 5.03kHz
๐Ÿ”ข Formula: fโ‚€ = 1 / (2ฯ€โˆšLC) = 1/(2ฯ€โˆš(1.00ร—10โปยฒ ร— 1.00ร—10โปโท))

โœ… This is within the audio frequency range (20Hz - 20kHz)

Tool 4: suggest_capacitor_for_filter

Recommend E12 capacitor value for RC low-pass filter with ASCII circuit diagram.

Parameters:

  • resistance (float): Resistance in Ohms
  • cutoff_frequency (float): Desired cutoff frequency in Hz

Example Queries:

"Capacitor for 1kHz low-pass filter with 10kฮฉ?"
"RC filter: 4.7kฮฉ resistor, 5kHz cutoff"
"Suggest cap for audio filter at 3.4kHz with 2.2kฮฉ"

Sample Output:

โšก RC Low-Pass Filter Design

๐Ÿ“Š Given:
  โ€ข Resistance: 10kฮฉ (1.00 ร— 10โด ฮฉ)
  โ€ข Target Cutoff: 1000Hz

๐Ÿ”ข Calculated Capacitance: 15.92nF
๐Ÿ”ง Recommended E12 Value: 15nF
โœ… Actual Cutoff: 1061Hz (6.1% error)

๐Ÿ“ ASCII Circuit Diagram:
  Input โ”€โ”€[ 10kฮฉ ]โ”€โ”€โ”ฌโ”€โ”€ Output
                    โ”‚
                  [15nF]
                    โ”‚
                   GND

๐Ÿ”ข Formula: C = 1 / (2ฯ€ ร— R ร— fc) = 1/(2ฯ€ ร— 1.00ร—10โด ร— 1000)

๐Ÿ“Œ GPIO Pin Reference Tools

Tool 1: get_pin_info

Get comprehensive information about a specific GPIO pin.

Parameters:

  • board (str): "ESP32", "Arduino UNO", or "STM32"
  • pin_number (int): Physical pin number or GPIO number

Example Queries:

"What can GPIO0 do on ESP32?"
"Tell me about pin D13 on Arduino UNO"
"STM32 pin PA13 capabilities?"

Sample Output:

๐Ÿ“Œ ESP32 Pin 0

**Name:** GPIO0
**Capabilities:** Input, Output, PWM, ADC
**Alternative Functions:**
  โ€ข ADC2_CH1 - ADC channel 1
  โ€ข TOUCH1 - Touch sensor
  โ€ข RTC_GPIO11 - RTC GPIO
  โ€ข CLK_OUT1 - Clock output
  โ€ข EMAC_TX_CLK - Ethernet clock

โš ๏ธ **Important Notes:**
  โ€ข Bootstrap pin - must be HIGH during boot for normal mode
  โ€ข Pull LOW during boot to enter UART download mode
  โ€ข ADC2 channels cannot be used when WiFi is active
  โ€ข Avoid using for regular I/O if WiFi is needed

๐Ÿ’ก **Common Uses:** General I/O, ADC input (no WiFi), capacitive touch sensor

Tool 2: find_pwm_pins

List all PWM-capable pins with timer information.

Parameters:

  • board (str): "ESP32", "Arduino UNO", or "STM32"

Example Queries:

"Which ESP32 pins support PWM?"
"List PWM pins on Arduino UNO"
"STM32 Blue Pill PWM capabilities?"

Sample Output:

๐Ÿ“Œ ESP32 PWM Pins

Found 23 PWM-capable pins:

1. **GPIO0** - PWM capable (Bootstrap pin - use with caution)
2. **GPIO2** - PWM capable (Bootstrap pin - use with caution)
3. **GPIO4** - PWM capable
4. **GPIO5** - PWM capable
...

๐Ÿ’ก **Notes:**
  โ€ข ESP32 supports up to 16 PWM channels
  โ€ข All GPIO pins can be configured for PWM using LEDC
  โ€ข PWM frequency range: 1 Hz to 40 MHz
  โ€ข Avoid GPIO6-11 (connected to SPI flash)

Tool 3: find_adc_pins

List ADC-capable pins with channel info and WiFi compatibility warnings.

Parameters:

  • board (str): "ESP32", "Arduino UNO", or "STM32"

Example Queries:

"Show me ADC pins on ESP32"
"Which Arduino pins can read analog?"
"STM32 analog input pins?"

Sample Output:

๐Ÿ“Œ ESP32 ADC Pins

**ADC1 Channels (WiFi-safe):**
1. **GPIO32** - ADC1_CH4 (12-bit, 0-3.3V)
2. **GPIO33** - ADC1_CH5 (12-bit, 0-3.3V)
3. **GPIO34** - ADC1_CH6 (12-bit, input only)
4. **GPIO35** - ADC1_CH7 (12-bit, input only)
5. **GPIO36 (VP)** - ADC1_CH0 (12-bit, input only)
6. **GPIO39 (VN)** - ADC1_CH3 (12-bit, input only)

**ADC2 Channels (โš ๏ธ Cannot be used with WiFi):**
7. **GPIO0** - ADC2_CH1
8. **GPIO2** - ADC2_CH2
9. **GPIO4** - ADC2_CH0
10. **GPIO12** - ADC2_CH5 (Bootstrap pin)
11. **GPIO13** - ADC2_CH4
12. **GPIO14** - ADC2_CH6
13. **GPIO15** - ADC2_CH3 (Bootstrap pin)
14. **GPIO25** - ADC2_CH8 (DAC1)
15. **GPIO26** - ADC2_CH9 (DAC2)
16. **GPIO27** - ADC2_CH7

โš ๏ธ **Important:** ADC2 is used by WiFi driver. When WiFi is active, ADC2 readings will fail. Use ADC1 channels (GPIO32-39) for WiFi-compatible projects.

Tool 4: find_i2c_pins

List I2C SDA/SCL pins with default configurations.

Parameters:

  • board (str): "ESP32", "Arduino UNO", or "STM32"

Example Queries:

"Which pins for I2C on ESP32?"
"Arduino UNO I2C pins?"
"STM32 I2C configuration?"

Sample Output:

๐Ÿ“Œ ESP32 I2C Pins

**Default I2C Configuration:**
  โ€ข **SDA:** GPIO21
  โ€ข **SCL:** GPIO22

๐Ÿ’ก **Notes:**
  โ€ข ESP32 supports hardware I2C on any GPIO pin (software remapping)
  โ€ข Default pins shown above (Wire.begin() with no arguments)
  โ€ข To use different pins: Wire.begin(SDA_PIN, SCL_PIN);
  โ€ข Supports multiple I2C buses: Wire, Wire1
  โ€ข Pull-up resistors required (typically 4.7kฮฉ for 100kHz, 2.2kฮฉ for 400kHz)

Tool 5: find_spi_pins

List SPI pins (MOSI, MISO, SCK, SS/NSS) with multiple bus support.

Parameters:

  • board (str): "ESP32", "Arduino UNO", or "STM32"

Example Queries:

"ESP32 SPI pin configuration?"
"Arduino SPI pins?"
"STM32 Blue Pill SPI buses?"

Sample Output:

๐Ÿ“Œ ESP32 SPI Pins

**VSPI (Default SPI Bus):**
  โ€ข **MOSI:** GPIO23
  โ€ข **MISO:** GPIO19
  โ€ข **SCK:** GPIO18
  โ€ข **SS:** GPIO5

**HSPI (Secondary SPI Bus):**
  โ€ข **MOSI:** GPIO13
  โ€ข **MISO:** GPIO12
  โ€ข **SCK:** GPIO14
  โ€ข **SS:** GPIO15 (Bootstrap pin - use with caution)

๐Ÿ’ก **Notes:**
  โ€ข ESP32 has 2 usable SPI buses: VSPI and HSPI
  โ€ข SPI0 and SPI1 are used internally for flash memory
  โ€ข Any GPIO can be remapped for SPI (software configuration)
  โ€ข CS/SS pins can be any available GPIO

Tool 6: check_pin_conflict

Detect potential conflicts for a set of pins (strapping, ADC2+WiFi, UART, SWD).

Parameters:

  • board (str): "ESP32", "Arduino UNO", or "STM32"
  • pin_numbers (List[int]): List of pins to check

Example Queries:

"Check if ESP32 pins 0, 2, 12, 15 conflict?"
"Verify Arduino pins 0, 1, 13 are safe to use?"
"STM32 pin conflict check: 13, 14, 20"

Sample Output:

๐Ÿ“Œ ESP32 Pin Conflict Check

Checking pins: [0, 2, 12, 15]

โš ๏ธ **Warnings Found:**

๐Ÿšจ **Strapping Pins Detected:**
Pins [0, 2, 12, 15] are bootstrap/strapping pins that affect boot behavior:
  โ€ข GPIO0: Boot mode selection (HIGH=normal, LOW=download)
  โ€ข GPIO2: Boot mode selection (must be LOW or floating)
  โ€ข GPIO12: Flash voltage selection (LOW=3.3V, HIGH=1.8V)
  โ€ข GPIO15: Timing/debug control (must be HIGH during boot)

๐Ÿ’ก **Recommendation:** Avoid using these pins for critical outputs. If you must use them, ensure they have correct states during boot or use pull-up/pull-down resistors.

โš ๏ธ **ADC2 + WiFi Conflict:**
Pins [0, 2, 12, 15] include ADC2 channels. ADC2 cannot be used when WiFi is active.
If you need analog input with WiFi, use ADC1 pins: 32, 33, 34, 35, 36, 39

โœ… **Safe Pins Available:**
Consider using these conflict-free GPIO pins instead: 4, 5, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33

Tool 7: generate_pin_diagram_ascii

Generate ASCII art pinout diagram with warnings.

Parameters:

  • board (str): "ESP32", "Arduino UNO", or "STM32"

Example Queries:

"Show ESP32 pinout diagram"
"Arduino UNO pin layout?"
"STM32 Blue Pill diagram?"

Sample Output:

๐Ÿ“Œ ESP32 DevKit V1 Pinout (30-pin)

                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚  ESP32  โ”‚
                   โ”‚ DevKit  โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       
     EN            โ”‚  1    30 โ”‚ VP (GPIO36) - ADC1_CH0 โš ๏ธ Input only
     VP (GPIO36)   โ”‚  2    29 โ”‚ VN (GPIO39) - ADC1_CH3 โš ๏ธ Input only
     VN (GPIO39)   โ”‚  3    28 โ”‚ GPIO34 - ADC1_CH6 โš ๏ธ Input only
     GPIO34        โ”‚  4    27 โ”‚ GPIO35 - ADC1_CH7 โš ๏ธ Input only
     GPIO35        โ”‚  5    26 โ”‚ GPIO32 - ADC1_CH4
     GPIO32        โ”‚  6    25 โ”‚ GPIO33 - ADC1_CH5
     GPIO33        โ”‚  7    24 โ”‚ GPIO25 - DAC1, ADC2_CH8
     GPIO25        โ”‚  8    23 โ”‚ GPIO26 - DAC2, ADC2_CH9
     GPIO26        โ”‚  9    22 โ”‚ GPIO27 - ADC2_CH7
     GPIO27        โ”‚ 10    21 โ”‚ GPIO14 - ADC2_CH6
     GPIO14        โ”‚ 11    20 โ”‚ GPIO12 - ADC2_CH5 โš ๏ธ Strapping
     GPIO12 โš ๏ธ     โ”‚ 12    19 โ”‚ GND
     GND           โ”‚ 13    18 โ”‚ GPIO13 - ADC2_CH4
     GPIO13        โ”‚ 14    17 โ”‚ GPIO9  โš ๏ธ Flash (do not use)
     GPIO9  โš ๏ธ     โ”‚ 15    16 โ”‚ GPIO10 โš ๏ธ Flash (do not use)
     GPIO10 โš ๏ธ     โ”‚ 16    15 โ”‚ GPIO11 โš ๏ธ Flash (do not use)
     GPIO11 โš ๏ธ     โ”‚ 17    14 โ”‚ VIN
     VIN           โ”‚ 18    13 โ”‚ GND
     GND           โ”‚ 19    12 โ”‚ GPIO6  โš ๏ธ Flash (do not use)
     GPIO6  โš ๏ธ     โ”‚ 20    11 โ”‚ GPIO7  โš ๏ธ Flash (do not use)
     GPIO7  โš ๏ธ     โ”‚ 21    10 โ”‚ GPIO8  โš ๏ธ Flash (do not use)
     GPIO8  โš ๏ธ     โ”‚ 22     9 โ”‚ GPIO15 โš ๏ธ Strapping
     GPIO15 โš ๏ธ     โ”‚ 23     8 โ”‚ GPIO2  โš ๏ธ Strapping + Built-in LED
     GPIO2  โš ๏ธ     โ”‚ 24     7 โ”‚ GPIO0  โš ๏ธ Strapping + Boot button
     GPIO0  โš ๏ธ     โ”‚ 25     6 โ”‚ GPIO4
     GPIO4         โ”‚ 26     5 โ”‚ GPIO16 (RX2)
     GPIO16        โ”‚ 27     4 โ”‚ GPIO17 (TX2)
     GPIO17        โ”‚ 28     3 โ”‚ GPIO5
     GPIO5         โ”‚ 29     2 โ”‚ GPIO18 - VSPI SCK
     GPIO18        โ”‚ 30     1 โ”‚ GPIO19 - VSPI MISO
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โš ๏ธ **Critical Warnings:**
  โ€ข GPIO6-11: Connected to SPI flash - DO NOT USE
  โ€ข GPIO0, 2, 12, 15: Strapping pins - affect boot behavior
  โ€ข GPIO34-39: Input only (no pull-up/pull-down)
  โ€ข ADC2 (GPIO0, 2, 4, 12-15, 25-27): Cannot be used with WiFi

๐Ÿ’ฌ Example Conversations

See EXAMPLES.md for comprehensive real-world usage examples including:

  • Beginner: LED dimming, resistor identification, button circuits
  • Intermediate: Sensor data loggers, RC filters, LC tank circuits
  • Advanced: Multi-channel ADC with WiFi, STM32 debugging, high-speed SPI
  • Multi-Tool Workflows: Complete sensor nodes, signal conditioning, multi-protocol hubs

Quick Examples:

๐ŸŽจ Resistor Decoder

User: "What's a Brown-Black-Red-Gold resistor?"
Claude: [Uses decode_resistor_color_bands] โ†’ "1000ฮฉ (1kฮฉ) ยฑ5%"

โšก Capacitor Calculator

User: "RC filter: 10kฮฉ, 1kHz cutoff?"
Claude: [Uses suggest_capacitor_for_filter] โ†’ "15nF capacitor recommended"

๐Ÿ“Œ GPIO Reference

User: "Which ESP32 pins work with WiFi for analog?"
Claude: [Uses find_adc_pins] โ†’ "Use ADC1: GPIO32-39 (ADC2 conflicts with WiFi)"

๐Ÿš€ Deployment

Production Options

Docker Container (Recommended)

Dockerfile:

FROM python:3.11-slim
WORKDIR /app
RUN pip install uv
COPY . .
RUN uv sync
CMD ["uv", "run", "servers/gpio_reference.py"]

Build and run:

docker build -t electronics-mcp .
docker run -i electronics-mcp uv run servers/resistor_decoder.py

Systemd Service (Linux)

/etc/systemd/system/mcp-gpio.service:

[Unit]
Description=MCP GPIO Reference Server
After=network.target

[Service]
Type=simple
User=mcp
WorkingDirectory=/opt/electronics-mcp
ExecStart=/usr/local/bin/uv run servers/gpio_reference.py
Restart=on-failure

[Install]
WantedBy=multi-user.target
sudo systemctl enable mcp-gpio
sudo systemctl start mcp-gpio

HTTP Transport (Remote Access)

# Start with HTTP on port 8003
uv run fastmcp run servers/gpio_reference.py --transport http --port 8003

Claude Desktop HTTP config:

{
  "mcpServers": {
    "gpio-reference": {
      "url": "http://your-server.com:8003/mcp"
    }
  }
}

๐Ÿงช Testing

Run All Tests

uv run pytest tests/ -v           # All 103 tests
uv run pytest tests/test_gpio_reference.py -v  # GPIO only (44 tests)
uv run pytest tests/ --cov=servers --cov-report=html  # With coverage

Expected Output

==================== test session starts ====================
collected 103 items

tests/test_resistor_decoder.py::TestDecodeResistor::test_4_band_standard PASSED [ 1%]
...
tests/test_gpio_reference.py::TestIntegration::test_project_planning PASSED [100%]

==================== 103 passed in 1.12s ====================

Manual Testing

# Interactive development mode
uv run fastmcp dev servers/gpio_reference.py

# Test specific function
uv run python -c "from servers.gpio_reference import get_pin_info; print(get_pin_info('ESP32', 0))"

๐Ÿ“ Project Structure

mcp-server/
โ”œโ”€โ”€ servers/                      # MCP server implementations
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ __main__.py               # Package entry point
โ”‚   โ”œโ”€โ”€ combined_server.py        # ๐Ÿ”— All 14 tools combined (recommended)
โ”‚   โ”œโ”€โ”€ resistor_decoder.py       # ๐ŸŽจ 3 tools, 26 tests
โ”‚   โ”œโ”€โ”€ capacitor_calculator.py   # โšก 4 tools, 33 tests
โ”‚   โ””โ”€โ”€ gpio_reference.py         # ๐Ÿ“Œ 7 tools, 44 tests
โ”‚
โ”œโ”€โ”€ tests/                        # Comprehensive test suite
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ test_resistor_decoder.py
โ”‚   โ”œโ”€โ”€ test_capacitor_calculator.py
โ”‚   โ””โ”€โ”€ test_gpio_reference.py
โ”‚
โ”œโ”€โ”€ memory-bank/                  # Development context
โ”‚   โ”œโ”€โ”€ SESSION.md                # Version changelog
โ”‚   โ”œโ”€โ”€ master-plan.md            # Milestone tracking
โ”‚   โ””โ”€โ”€ PROJECT.md                # Project overview
โ”‚
โ”œโ”€โ”€ EXAMPLES.md                   # Real-world use cases
โ”œโ”€โ”€ pyproject.toml                # Dependencies & metadata
โ”œโ”€โ”€ uv.lock                       # Locked dependencies
โ”œโ”€โ”€ README.md                     # This file
โ””โ”€โ”€ ref.md                        # Original requirements

๐Ÿ› ๏ธ Troubleshooting

"Module 'mcp' not found"

uv sync  # Reinstall dependencies

"Tools not showing in Claude Desktop"

  1. Check config file location (see Quick Start)
  2. Verify JSON syntax: python -m json.tool claude_desktop_config.json
  3. Use absolute paths in args
  4. Restart Claude Desktop completely
  5. Check logs: %APPDATA%\Claude\logs\ (Windows)

"ESP32 ADC fails with WiFi"

Cause: ADC2 channels (GPIO 0, 2, 4, 12-15, 25-27) conflict with WiFi driver.

Solution: Use ADC1 channels (GPIO32-39) - check with find_adc_pins('ESP32')

"ESP32 won't boot"

Cause: Strapping pins (GPIO 0, 2, 12, 15) held at wrong state.

Solution: Disconnect these pins during boot, or use check_pin_conflict() before wiring.

"Import Error: FastMCP"

Fix import path:

# Correct:
from mcp.server.fastmcp import FastMCP

# Incorrect:
from mcp import FastMCP

VS Code MCP Server Not Loading

Symptoms: Tools don't appear in Copilot chat after adding config.

Solutions:

  1. Verify the config file location:

    • Windows: %APPDATA%\Code\User\mcp.json
    • Check with: code --locate-shell-integration-path bash (shows user data dir)
  2. Check JSON syntax: Open the file in VS Codeโ€”syntax errors will be highlighted.

  3. Use absolute paths with proper escaping:

    "--directory", "/path/to/electronics-mcp-servers"
    

    On Windows, use double backslashes: "C:\\Users\\yourname\\electronics-mcp-servers"

  4. Verify uv is installed and in PATH:

    uv --version
    
  5. Test the server manually:

    cd /path/to/electronics-mcp-servers
    uv run python servers/combined_server.py
    

    The server should start and wait for input (no errors).

  6. Reload VS Code window: Ctrl+Shift+P โ†’ "Developer: Reload Window"

  7. Check VS Code Output panel: Look for MCP-related errors in the Output panel (select "MCP" or "GitHub Copilot" from dropdown).


๐Ÿค Contributing

Contributions welcome! Ideas:

  • Additional boards (Raspberry Pi Pico, Teensy, nRF52)
  • More tools (voltage divider, PCB trace width)
  • SVG/PNG pinout generation
  • Web UI for standalone use

Dev setup:

git clone https://github.com/yourusername/electronics-mcp-servers.git
cd electronics-mcp-servers
uv sync
git checkout -b feature/your-feature
uv run pytest tests/ -v

๐Ÿ“„ License

MIT License


๐Ÿ™ Acknowledgments

Datasheet Sources:

Frameworks:


๐Ÿ“ž Support


Built with โค๏ธ for the electronics and embedded systems community

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

electronics_mcp_servers-0.1.0.tar.gz (125.7 kB view details)

Uploaded Source

Built Distribution

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

electronics_mcp_servers-0.1.0-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file electronics_mcp_servers-0.1.0.tar.gz.

File metadata

  • Download URL: electronics_mcp_servers-0.1.0.tar.gz
  • Upload date:
  • Size: 125.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for electronics_mcp_servers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83a3e56f2869691f2d2f751b3ef43e9ae2436471340113ab3575dc14b2d6d84a
MD5 66b974cf524103126f740ea65dee885b
BLAKE2b-256 30a31c74c9b0c787b6dcf8ff038acf4b771f76aba0f9ef25d12a870c0a4ac895

See more details on using hashes here.

File details

Details for the file electronics_mcp_servers-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for electronics_mcp_servers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3be115ece714b5a7c0e70538ee549aac09f7002d6d9d037da45243f570590c6
MD5 f88033d0ae5296ed614cdb3904a59bd3
BLAKE2b-256 7d9d61b6640981b3ddbf634583b4390f5bb0549f196f83bbf3e9931ec6a62b07

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