Parameter object MCP tool¶
The Parameter object MCP tool exposes BetterPy's parameter-object refactoring flow to MCP-capable assistants. It lets an assistant request the same IDE-backed transformation instead of trying to rewrite Python source text on its own.
How to use¶
Connect an MCP client to the IDE, then ask it to introduce or inline a parameter object for a specific function. The tool runs inside the IDE context, so it can use project PSI, inspections, and refactoring infrastructure.
Example request¶
Introduce a parameter object for create_order in orders/service.py.
Use a dataclass and update call sites.
The assistant can route that request to BetterPy's MCP tool. The IDE performs the refactoring and returns the result through the MCP session.
What it supports¶
- Assistant-triggered introduce parameter object operations.
- The same target validation used by the interactive refactoring.
- Project-aware source edits rather than standalone text replacement.
- Respecting the parameter-object feature settings configured in the IDE.
What it deliberately avoids¶
- Running when the Parameter object refactoring feature is disabled.
- Applying transformations to unsupported or ambiguous function signatures.
- Replacing human review. You should still inspect the produced diff.
Notes¶
- This feature is useful when you want an assistant to orchestrate refactoring while the IDE remains responsible for correctness-sensitive edits.
- The feature is gated by the Parameter object MCP tool setting under Settings | BetterPy | Refactoring & code transformations | Parameter Object.