Skip to content

Fix Report for KiCad MCP Tools #31

@Neil-TC

Description

@Neil-TC

I used Claude Code for deployment and Claude Windows for testing. Several tools were failing, and Claude Code fixed them.
Here is the feedback written by Claude Code:

Complete Fix Report for KiCad MCP Tools
Environment
• macOS (Darwin 24.5.0)
• FastMCP 2.10.6 / MCP 1.11.0
• Python virtual environment with dependencies installed
• MCP Clients: Claude Desktop and Cherry Studio

Summary

All 14 KiCad MCP tools have been fixed and now run correctly in production environments. The main issue was incompatibility of the Context parameter used in FastMCP, which has been removed in favor of synchronous functions and standard Python logging.

Root Cause
1. FastMCP Context parameter was not compatible with standard MCP clients.
2. Async/await with Context caused uncallable function errors.
3. Missing logging imports led to “name ‘logging’ is not defined” errors.
4. MCP-decorated functions calling each other caused FunctionTool errors.

Fix Strategy
1. Removed Context parameters and converted all tools to synchronous functions.
2. Replaced Context-based progress reporting with Python logging.
3. Introduced helper functions to avoid MCP-decorated functions calling each other.

Scope of Fixes
• Total of 6 files, around 2000 lines of refactoring:
• netlist_tools.py
• export_tools.py
• bom_tools.py
• drc_tools.py
• drc_impl/cli_drc.py
• pattern_tools.py
• All 14 tools fixed, including netlist, export, BOM, DRC, and pattern recognition.

Technical Insights
1. FastMCP Context injection is not suitable for universal MCP clients. Standard Python patterns are more compatible.
2. Synchronous functions are more reliable for file and CLI operations than async functions in MCP contexts.
3. MCP tools cannot directly call other MCP tools. Shared logic should be placed in helper functions.

Recommendations for Maintainers
1. Adopt synchronous function patterns to ensure MCP client compatibility.
2. Use standard Python logging instead of Context-based progress reporting.
3. Extract shared logic into helper functions to prevent direct tool-to-tool calls.
4. Test across multiple MCP clients for compatibility.
5. Document Context parameter limitations in FastMCP usage guides.

Final Status
All 14 KiCad MCP tools have been fully repaired and now work as expected in production environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions