feat: add MCP server for AI assistant integration - #1
Draft
donrami wants to merge 5 commits into
Draft
Conversation
Add headless MCP server binary at cmd/penopt-mcp/ that runs on stdio transport. Uses the official go-sdk v1.6.0. - cmd/penopt-mcp/main.go — server entry point with ping tool - cmd/penopt-mcp/smoke_test.go — MCP protocol integration test - go.mod/go.sum — add modelcontextprotocol/go-sdk dependency - .gitignore — ignore root-level penopt-mcp binaries
Add 4 headless tools that delegate to the existing internal/* packages: - load_mesh: reads STL/OBL from disk, parses, centers, builds BVH - get_mesh_info: returns metadata for the currently loaded mesh - evaluate_orientation: scores a single (theta, phi) orientation - run_optimization: runs coarse->fine grid search with progress notifications Includes: - tools.go: shared state, typed handlers, input validation - tools_test.go: 10 integration tests covering all happy/error paths - testdata/cube20.stl: 20mm test cube (ASCII STL) All 12 tests pass, go vet clean, binary builds at 8.5 MB.
…ardening - search.Run() now accepts context.Context for cancellation support (passes context.Background() from GUI, handler context from MCP) - Cancellation checked before starting and between coarse/fine phases - MCP progress notifications now also log to stderr for clients that don't display MCP notification messages - All 22 tests pass, go vet clean
- cmd/penopt-mcp/README.md: full user guide with quick start, Claude Desktop/Code setup, tool reference, example conversation, troubleshooting, and build instructions - README.md: add AI Integration (MCP) section to the project root - CHANGELOG.md: add v0.3.0 entry for MCP server features
donrami
marked this pull request as draft
May 27, 2026 09:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a headless MCP server binary (
penopt-mcp) that lets AI assistants like Claude Desktop and Claude Code load 3D meshes and run CT orientation optimization directly. Mesh data stays local — only file paths and JSON results cross the protocol boundary.What's included
MCP Server (cmd/penopt-mcp)
pingload_meshget_mesh_infoevaluate_orientationrun_optimizationTechnical highlights
cmd/penopt-mcp/directoryinternal/*directly — same Go packages as the GUI, no Wails dependencyCI/CD
ci.yml— builds + tests + vets MCP server on every push and PR (separate from release workflow)release.yml— newbuild-mcpjob cross-compiles for all 4 platforms from a single ubuntu runner; 8 binaries per release (4 GUI + 4 MCP)Docs
cmd/penopt-mcp/README.md— full setup guide with Claude Desktop/Code config, tool reference, example conversation, troubleshootingREADME.md— new "AI Integration (MCP)" sectionCHANGELOG.md— v0.3.0 entryTesting
How to use
penopt-mcp-{platform}from the next releaseclaude mcp add penopt -- ./penopt-mcp