feat: add macOS automated setup script and update platform documentation
Add setup-macos.sh, a shell script that automates Claude Desktop MCP configuration on macOS. The script detects KiCad's bundled Python, resolves PYTHONPATH, generates the correct MCP server config, and safely merges it into the existing Claude Desktop configuration with backup support. Supports --verify, --dry-run, and --apply modes. Update README.md with documentation for the automated setup workflow, including usage examples, parameter reference, and post-setup steps. Extend docs/PLATFORM_GUIDE.md with macOS-specific sections covering installation, path handling, Python environment, troubleshooting, best practices, cross-platform migration, and support resources. Update docs/STATUS_SUMMARY.md to reflect the new macOS automation capabilities and bump the last-updated date.
This commit is contained in:
134
README.md
134
README.md
@@ -505,7 +505,9 @@ See [Windows Installation Guide](docs/WINDOWS_SETUP.md) for detailed instruction
|
||||
|
||||
### macOS
|
||||
|
||||
**Important:** On macOS, use KiCAD's bundled Python to ensure proper access to pcbnew module.
|
||||
**Important:** On macOS, use KiCAD's bundled Python to ensure proper access to the `pcbnew` module.
|
||||
|
||||
#### Manual Setup
|
||||
|
||||
```bash
|
||||
# Install KiCAD 9.0 from kicad.org/download/macos
|
||||
@@ -529,7 +531,135 @@ pip install -r requirements.txt
|
||||
npm run build
|
||||
```
|
||||
|
||||
**Note:** The `--system-site-packages` flag is required to access KiCAD's pcbnew module from the virtual environment.
|
||||
**Note:** The `--system-site-packages` flag is required to access KiCAD's `pcbnew` module from the virtual environment.
|
||||
|
||||
#### Automated Setup
|
||||
|
||||
To simplify configuration with Claude Desktop, this repository provides a macOS setup script:
|
||||
|
||||
```bash
|
||||
./setup-macos.sh
|
||||
```
|
||||
|
||||
In case of error `zsh: permission denied: ./setup-macos.sh` you can either:
|
||||
|
||||
- always allow the script to be executed by running: `chmod +x setup-macos.sh`.
|
||||
- alternatively explicitly run it with bash: `bash setup-macos.sh` so no chmod change needed.
|
||||
|
||||
This script does **not replace the manual setup above** — it assumes dependencies are already installed and the project is built. Instead, it automates:
|
||||
|
||||
- detection of your environment (Node.js, KiCad Python, `pcbnew`)
|
||||
- resolving the correct macOS `PYTHONPATH`
|
||||
- generating the correct Claude Desktop MCP configuration
|
||||
- safely merging the configuration into your existing Claude config
|
||||
- optionally writing the configuration with backup support
|
||||
|
||||
##### Basic Usage
|
||||
|
||||
###### Verify setup (no changes)
|
||||
|
||||
```bash
|
||||
./setup-macos.sh --verify
|
||||
```
|
||||
|
||||
###### Preview configuration (dry run)
|
||||
|
||||
```bash
|
||||
./setup-macos.sh --dry-run
|
||||
```
|
||||
|
||||
###### Apply configuration
|
||||
|
||||
```bash
|
||||
./setup-macos.sh --apply
|
||||
```
|
||||
|
||||
After applying, restart Claude Desktop.
|
||||
|
||||
##### Parameters
|
||||
|
||||
###### Required parameters
|
||||
|
||||
None. The script works out-of-the-box using sensible defaults.
|
||||
|
||||
###### Optional parameters
|
||||
|
||||
##### `--name NAME`
|
||||
|
||||
Specify the MCP server name in Claude Desktop.
|
||||
|
||||
Default:
|
||||
|
||||
```text
|
||||
kicad
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
./setup-macos.sh --apply --name kicad-dev
|
||||
```
|
||||
|
||||
Use this when:
|
||||
|
||||
- running multiple MCP configurations
|
||||
- testing forks or development versions
|
||||
- avoiding overwriting an existing setup
|
||||
|
||||
##### `--claude-config PATH`
|
||||
|
||||
Specify a custom Claude Desktop configuration file.
|
||||
|
||||
Default:
|
||||
|
||||
```text
|
||||
~/.config/Claude/claude_desktop_config.json
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
./setup-macos.sh --dry-run --claude-config ~/tmp/claude_config.json
|
||||
```
|
||||
|
||||
Use this when:
|
||||
|
||||
- testing configurations safely
|
||||
- using non-standard config locations
|
||||
- debugging without modifying your main setup
|
||||
|
||||
##### `--yes`
|
||||
|
||||
Skip confirmation prompt when applying changes.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
./setup-macos.sh --apply --yes
|
||||
```
|
||||
|
||||
##### After Setup
|
||||
|
||||
1. Fully quit Claude Desktop
|
||||
2. Reopen Claude Desktop
|
||||
3. Open a new chat
|
||||
4. Click **+ → Connectors**
|
||||
5. Verify the server appears (e.g. `kicad` or your custom name)
|
||||
|
||||
Test with prompt in Claude Desktop:
|
||||
|
||||
```text
|
||||
Use the kicad MCP server to run check_kicad_ui.
|
||||
```
|
||||
|
||||
##### Notes
|
||||
|
||||
- The script only modifies the `mcpServers` section and leaves all other configuration untouched
|
||||
- Existing configurations are automatically backed up before changes
|
||||
- macOS support relies on KiCad’s bundled Python; system Python will not work correctly
|
||||
- If KiCad is updated or moved, re-run the script to refresh paths
|
||||
|
||||
---
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user