- Implement 3D model analysis and mechanical constraints checking - Add advanced DRC rule customization for HDI, RF, and automotive applications - Create symbol library management with analysis and validation tools - Implement PCB layer stack-up analysis with impedance calculations - Fix Context parameter validation errors causing client failures - Add enhanced tool annotations with examples for better LLM compatibility - Include comprehensive test coverage improvements (22.21% coverage) - Add CLAUDE.md documentation for development guidance New Advanced Tools: • 3D model analysis: analyze_3d_models, check_mechanical_constraints • Advanced DRC: create_drc_rule_set, analyze_pcb_drc_violations • Symbol management: analyze_symbol_library, validate_symbol_library • Layer analysis: analyze_pcb_stackup, calculate_trace_impedance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
"""
|
|
Project listing and information resources.
|
|
"""
|
|
|
|
import os
|
|
from mcp.server.fastmcp import FastMCP
|
|
|
|
from kicad_mcp.utils.kicad_utils import find_kicad_projects
|
|
from kicad_mcp.utils.file_utils import get_project_files, load_project_json
|
|
|
|
|
|
def register_project_resources(mcp: FastMCP) -> None:
|
|
"""Register project-related resources with the MCP server.
|
|
|
|
Args:
|
|
mcp: The FastMCP server instance
|
|
"""
|
|
|
|
@mcp.resource("kicad://project/{project_path}")
|
|
def get_project_details(project_path: str) -> str:
|
|
"""Get details about a specific KiCad project."""
|
|
if not os.path.exists(project_path):
|
|
return f"Project not found: {project_path}"
|
|
|
|
try:
|
|
# Load project file
|
|
project_data = load_project_json(project_path)
|
|
if not project_data:
|
|
return f"Error reading project file: {project_path}"
|
|
|
|
# Get related files
|
|
files = get_project_files(project_path)
|
|
|
|
# Format project details
|
|
result = f"# Project: {os.path.basename(project_path)[:-10]}\n\n"
|
|
|
|
result += "## Project Files\n"
|
|
for file_type, file_path in files.items():
|
|
result += f"- **{file_type}**: {file_path}\n"
|
|
|
|
result += "\n## Project Settings\n"
|
|
|
|
# Extract metadata
|
|
if "metadata" in project_data:
|
|
metadata = project_data["metadata"]
|
|
for key, value in metadata.items():
|
|
result += f"- **{key}**: {value}\n"
|
|
|
|
return result
|
|
|
|
except Exception as e:
|
|
return f"Error reading project file: {str(e)}"
|