Skip to content

feat: results-inspector MCP core as an autofit[mcp] extra#1404

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/graduate-mcp-autofit-extra
Jul 21, 2026
Merged

feat: results-inspector MCP core as an autofit[mcp] extra#1404
Jammy2211 merged 1 commit into
mainfrom
feature/graduate-mcp-autofit-extra

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Graduates the read-only results-inspector MCP core into PyAutoFit as an optional autofit[mcp] extra, de-duplicating the byte-identical tools.py that was copied across both assistants.

New autofit/mcp/

  • tools.py — the 7 aggregator-wrapper functions (imports autofit + autonerves only; no autoarray/autogalaxy/autolens).
  • server.pycore_server() FastMCP factory registering those 7 tools.
  • bootstrap.pypin_config + route_logging_to_stderr, kept autonerves-only so a launcher can pin config before importing autofit.
  • __main__.py — standalone python -m autofit.mcp.
  • pyproject.tomlmcp = ["mcp"] under optional-dependencies (never a core requirement).
  • test_autofit/mcp/test_mcp_tools.py — the fixture test (real tiny af.LBFGS fit; numpy-only).

Verification

Standalone python -m autofit.mcp completes a real MCP stdio handshake from a neutral CWD with a minimal env — gaussian-first ranking, clean stdout. test_autofit/mcp passes 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

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>
@Jammy2211
Jammy2211 merged commit 1af904b into main Jul 21, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/graduate-mcp-autofit-extra branch July 21, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: graduate results-inspector MCP core into an autofit[mcp] extra

1 participant