feat: results-inspector MCP core as an autofit[mcp] extra#1404
Merged
Conversation
Graduate the read-only results-inspector MCP core into PyAutoFit as an optional `autofit[mcp]` extra, so the two assistants import it instead of copying the byte-identical `tools.py` verbatim. New `autofit/mcp/`: tools (aggregator wrappers, autofit+autonerves only), server.core_server (FastMCP factory), bootstrap (config-pin + stdout routing, autonerves-only so a launcher can pin config before the autofit import), __main__ (standalone `python -m autofit.mcp`). The `mcp` package is an optional extra, never a core requirement. Closes #1403 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Graduates the read-only results-inspector MCP core into PyAutoFit as an optional
autofit[mcp]extra, de-duplicating the byte-identicaltools.pythat was copied across both assistants.New
autofit/mcp/tools.py— the 7 aggregator-wrapper functions (imports autofit + autonerves only; no autoarray/autogalaxy/autolens).server.py—core_server()FastMCP factory registering those 7 tools.bootstrap.py—pin_config+route_logging_to_stderr, kept autonerves-only so a launcher can pin config before importing autofit.__main__.py— standalonepython -m autofit.mcp.pyproject.toml—mcp = ["mcp"]under optional-dependencies (never a core requirement).test_autofit/mcp/test_mcp_tools.py— the fixture test (real tinyaf.LBFGSfit; numpy-only).Verification
Standalone
python -m autofit.mcpcompletes a real MCP stdio handshake from a neutral CWD with a minimal env — gaussian-first ranking, clean stdout.test_autofit/mcppasses 10/10. Both assistants (PyAutoLabs/autofit_assistant + PyAutoLabs/autolens_assistant, companion PRs) import this core and pass their handshakes + tests. Also verified the config-pin overrides a poison config planted in the launch CWD.Merge first (the assistants import
autofit.mcp).Closes #1403
🤖 Generated with Claude Code