Skip to main content

Module python

Module python 

Source
Expand description

PythonGenerator — generates an importable Python module.

Each upstream tool becomes a typed async function that calls POST /exec on the local tool proxy. The generated module:

  • Is named <cli_name>.py.
  • Imports httpx for HTTP calls.
  • Contains _BRIDGE and _TOKEN module-level constants.
  • Has one def <tool_name>(...) function per upstream tool with:
    • Required params as positional; optional as keyword-only with None default.
    • A docstring taken from the tool’s description.
    • Return type annotation of str.
  • Contains a # generated by mcp-compressor — do not edit manually header.

Structs§

PythonGenerator