feat: Add workbench and major cleanup, refactor, and updates (#21)

* FreeCAD addon support for Workbench and Plugins

* docs: refactor docs and clean up linters, etc.

* Remove mdformat

* test: improve test coverage

* test:Lots of general fixes

* chore: more general fixes
This commit is contained in:
Sean P. Kane
2026-01-06 15:44:27 -08:00
committed by GitHub
parent 4344ff7536
commit 6a6cad9e65
64 changed files with 8317 additions and 2245 deletions
+2 -2
View File
@@ -209,8 +209,8 @@ jobs:
Before using this Docker image, start FreeCAD with the MCP bridge:
1. Open FreeCAD
2. Go to **Macro → Macros → StartMCPBridge** (or run from Python console)
1. Install the **MCP Bridge** workbench via FreeCAD Addon Manager
2. Switch to the MCP Bridge workbench and click **Start MCP Bridge**
3. The bridge will start listening on ports 9875 (XML-RPC) and 9876 (Socket)
## Full Documentation
+18 -12
View File
@@ -1,21 +1,23 @@
name: Macro Tests
name: Integration Tests
on:
push:
branches: [main, master]
paths:
- "src/freecad_mcp/**/*.py"
- "macros/**/*.FCMacro"
- "macros/**/*.py"
- "tests/integration/test_cut_object_for_magnets.py"
- "tests/integration/test_multi_export.py"
- "addon/FreecadRobustMCP/**/*.py"
- "tests/integration/**/*.py"
- ".github/workflows/macro-test.yaml"
pull_request:
branches: [main, master]
paths:
- "src/freecad_mcp/**/*.py"
- "macros/**/*.FCMacro"
- "macros/**/*.py"
- "tests/integration/test_cut_object_for_magnets.py"
- "tests/integration/test_multi_export.py"
- "addon/FreecadRobustMCP/**/*.py"
- "tests/integration/**/*.py"
- ".github/workflows/macro-test.yaml"
# Cancel in-progress runs for the same branch
@@ -24,8 +26,8 @@ concurrency:
cancel-in-progress: true
jobs:
test-macros:
name: Test FreeCAD Macros
test-integration:
name: Integration Tests with FreeCAD
runs-on: ubuntu-latest
steps:
@@ -117,14 +119,11 @@ jobs:
- name: Start FreeCAD headless with MCP bridge
run: |
# Set up environment
export PYTHONPATH="${PWD}/src:${PYTHONPATH:-}"
echo "Using FreeCAD: freecadcmd"
# Start FreeCAD headless with MCP bridge in background
# Capture stdout to a file so we can extract the instance ID
freecadcmd src/freecad_mcp/freecad_plugin/headless_server.py > /tmp/freecad_bridge.log 2>&1 &
# Uses the workbench addon's headless server script
freecadcmd addon/FreecadRobustMCP/freecad_mcp_bridge/headless_server.py > /tmp/freecad_bridge.log 2>&1 &
FREECAD_PID=$!
echo "FREECAD_PID=$FREECAD_PID" >> "$GITHUB_ENV"
@@ -173,6 +172,13 @@ jobs:
run: |
uv run pytest tests/integration/test_multi_export.py -v --tb=short
- name: Run headless mode integration tests
env:
FREECAD_MODE: xmlrpc
# Tests for headless FreeCAD operations (primitives, booleans, exports, etc.)
run: |
uv run pytest tests/integration/test_headless_mode.py -v --tb=short
- name: Stop FreeCAD
if: always()
run: |
+2
View File
@@ -46,4 +46,6 @@ jobs:
# - no-commit-to-branch: Always fails in CI (we're on main/master)
# - trufflehog: Has wasm/go-re2 panic bug in GitHub Actions environment
SKIP: no-commit-to-branch,trufflehog
# Safety CLI API key for dependency vulnerability scanning
SAFETY_API_KEY: ${{ secrets.SAFETY_API_KEY }}
run: uv run pre-commit run --all-files --show-diff-on-failure
+3 -1
View File
@@ -5,6 +5,7 @@ on:
branches: [main, master]
paths:
- "src/**/*.py"
- "addon/**/*.py"
- "tests/**/*.py"
- "pyproject.toml"
- "uv.lock"
@@ -13,6 +14,7 @@ on:
branches: [main, master]
paths:
- "src/**/*.py"
- "addon/**/*.py"
- "tests/**/*.py"
- "pyproject.toml"
- "uv.lock"
@@ -50,6 +52,6 @@ jobs:
- name: Run type checking
run: uv run mypy src/
# Note: FreeCAD integration tests are handled by the "Macro Tests" workflow
# Note: FreeCAD integration tests are handled by the "Integration Tests" workflow
# (macro-test.yaml) which runs on every PR. That workflow sets up FreeCAD
# AppImage and runs tests/integration/ tests with proper headless configuration.