Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
---
name: Bug Report
about: Report a bug or issue with the KiCad MCP Server
title: "[BUG] "
labels: bug
assignees: ''
---

## Bug Description
<!-- A clear and concise description of the bug -->

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ __pycache__/
dist/
build/
*.egg-info/
*.egg
*.whl

# PyPI
.pypirc

# Unit test / coverage reports
htmlcov/
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include README.md
include LICENSE
include requirements.txt
include .env.example
recursive-include kicad_mcp *.py
recursive-include docs *.md
23 changes: 23 additions & 0 deletions kicad_mcp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
"""
KiCad MCP Server - A Model Context Protocol server for KiCad.
"""
from .server import *
from .config import *
from .context import *

__version__ = "0.1.0"
__author__ = "Lama Al Rajih"
__description__ = "Model Context Protocol server for KiCad on Mac, Windows, and Linux"

__all__ = [
# Package metadata
"__version__",
"__author__",
"__description__",

# Server creation / shutdown helpers
"create_server",
"add_cleanup_handler",
"run_cleanup_handlers",
"shutdown_server",

# Lifespan / context helpers
"kicad_lifespan",
"KiCadAppContext",
]
6 changes: 3 additions & 3 deletions kicad_mcp/tools/export_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def register_export_tools(mcp: FastMCP) -> None:
"""

@mcp.tool()
async def generate_pcb_thumbnail(project_path: str, ctx: Context) -> Optional[Image]:
async def generate_pcb_thumbnail(project_path: str, ctx: Context):
"""Generate a thumbnail image of a KiCad PCB layout using kicad-cli.

Args:
Expand Down Expand Up @@ -88,14 +88,14 @@ async def generate_pcb_thumbnail(project_path: str, ctx: Context) -> Optional[Im
return None

@mcp.tool()
async def generate_project_thumbnail(project_path: str, ctx: Context) -> Optional[Image]:
async def generate_project_thumbnail(project_path: str, ctx: Context):
"""Generate a thumbnail of a KiCad project's PCB layout (Alias for generate_pcb_thumbnail)."""
# This function now just calls the main CLI-based thumbnail generator
print(f"generate_project_thumbnail called, redirecting to generate_pcb_thumbnail for {project_path}")
return await generate_pcb_thumbnail(project_path, ctx)

# Helper functions for thumbnail generation
async def generate_thumbnail_with_cli(pcb_file: str, ctx: Context) -> Optional[Image]:
async def generate_thumbnail_with_cli(pcb_file: str, ctx: Context):
"""Generate PCB thumbnail using command line tools.
This is a fallback method when the kicad Python module is not available or fails.

Expand Down
41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "kicad-mcp"
version = "0.1.0"
authors = [{ name = "Lama Al Rajih" }]
description = "Model Context Protocol server for KiCad on Mac, Windows, and Linux"
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
]
dependencies = ["mcp[cli]>=1.11.0", "pandas>=2.3.1", "pytest>=8.4.1"]

[project.urls]
"Homepage" = "https://github.com/lamaalrajih/kicad-mcp"
"Bug Tracker" = "https://github.com/lamaalrajih/kicad-mcp/issues"
"Documentation" = "https://github.com/lamaalrajih/kicad-mcp#readme"

[project.scripts]
kicad-mcp = "kicad_mcp.main:main"

[tool.setuptools.packages.find]
where = ["."]
include = ["kicad_mcp*"]
exclude = ["tests*", "docs*"]

[tool.setuptools.package-data]
"kicad_mcp" = ["prompts/*.txt", "resources/**/*.json"]
939 changes: 939 additions & 0 deletions uv.lock

Large diffs are not rendered by default.