Skip to main content
The common.py pattern is deprecated. Use standard Python module and package structures instead.
Multiple components often need to share utility functions, client initializations, or Pydantic models. GolfMCP supports standard Python repository structures for organizing shared code. You can create properly named modules, packages, and organize your code using normal Python conventions. The build system will handle imports correctly regardless of your chosen structure. Example: tools/payments/common.py:
tools/payments/charge.py:
The GolfMCP build system understands these relative imports and ensures that the common.py modules are correctly packaged and accessible in the final dist/ output. The ImportTransformer in golf.core.transformer handles rewriting these imports to be absolute paths relative to the generated components directory structure.