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+.
๐ Table of Contents
- Overview
- Servers
- Installation
- Quick Start
- Detailed Usage
- Example Conversations
- Deployment
- Testing
- Project Structure
- Contributing
๐ฏ 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 valueencode_resistor_value- Convert resistance value to color band sequencefind_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 currentcalculate_rc_time_constant- Calculate ฯ = RC with charging timelinecalculate_resonant_frequency- Calculate fโ = 1/(2ฯโLC) with resonance checksuggest_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 warningsfind_pwm_pins- List all PWM-capable pins with timer informationfind_adc_pins- List ADC pins with channel info and WiFi compatibility (ESP32)find_i2c_pins- List I2C SDA/SCL pins with default configurationsfind_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(orCmd+Shift+Pon 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 ohmsseries(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 Faradsfrequency(float): Frequency in Hzvoltage(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 Ohmscapacitance(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 Henriescapacitance(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 Ohmscutoff_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"
- Check config file location (see Quick Start)
- Verify JSON syntax:
python -m json.tool claude_desktop_config.json - Use absolute paths in
args - Restart Claude Desktop completely
- 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:
-
Verify the config file location:
- Windows:
%APPDATA%\Code\User\mcp.json - Check with:
code --locate-shell-integration-path bash(shows user data dir)
- Windows:
-
Check JSON syntax: Open the file in VS Codeโsyntax errors will be highlighted.
-
Use absolute paths with proper escaping:
"--directory", "/path/to/electronics-mcp-servers"
On Windows, use double backslashes:
"C:\\Users\\yourname\\electronics-mcp-servers" -
Verify uv is installed and in PATH:
uv --version -
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).
-
Reload VS Code window:
Ctrl+Shift+Pโ "Developer: Reload Window" -
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
- Issues: GitHub Issues
- Discussions: GitHub Discussions
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a3e56f2869691f2d2f751b3ef43e9ae2436471340113ab3575dc14b2d6d84a
|
|
| MD5 |
66b974cf524103126f740ea65dee885b
|
|
| BLAKE2b-256 |
30a31c74c9b0c787b6dcf8ff038acf4b771f76aba0f9ef25d12a870c0a4ac895
|
File details
Details for the file electronics_mcp_servers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: electronics_mcp_servers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3be115ece714b5a7c0e70538ee549aac09f7002d6d9d037da45243f570590c6
|
|
| MD5 |
f88033d0ae5296ed614cdb3904a59bd3
|
|
| BLAKE2b-256 |
7d9d61b6640981b3ddbf634583b4390f5bb0549f196f83bbf3e9931ec6a62b07
|