Files
python-sdk/pkg/hanzo-tools-fs
zeekay 85bf05c796 feat(mcp): native MCP ImageContent — tools return images the client can SEE
HIP-0300 tools serialize results to JSON text, which flattened images into
useless base64-in-text. Add a ToolImage value type + one converter in
BaseTool.register: any ToolImage anywhere in a result becomes a real
mcp.types.ImageContent block; text-only results stay byte-for-byte JSON.
Emitters wired: fs read of image files, browser screenshots (bidi+playwright).
This gives hanzo-mcp vision parity with zai-mcp — an agent with native vision
(Claude) sees pixels directly, no per-task vision tool needed.

Also decomplect the core-package collision that caused this class of bug:
hanzo-tools-core shipped a DUPLICATE hanzo_tools/core/ that nondeterministically
shadowed canonical hanzo-tools (dropping ToolImage, the sophisticated register,
etc. — same shadow class as the 0.3.0 error-reexport gap). Finish the
'merge core into hanzo-tools' refactor: move id_tool into hanzo-tools, make
hanzo-tools-core a pure empty metapackage. Now ONE package owns hanzo_tools.core.

Versions: hanzo-tools 0.3.2, -core 0.3.1 (shim), -browser 0.5.9, -fs 0.3.4,
hanzo-mcp 0.15.12 (floors bumped). Verified: fs read PNG -> [text, image];
fs stat -> [text]; 29 tools intact; 9 tests pass.
2026-07-03 00:45:49 -07:00
..
2025-12-27 15:00:11 -08:00

hanzo-tools-fs

Filesystem tools for Hanzo MCP.

Installation

pip install hanzo-tools-fs

Tools

read - Read Files

read(file_path="/path/to/file.py")
read(file_path="/path/to/file.py", offset=100, limit=50)

write - Write Files

write(file_path="/path/to/file.py", content="...")

edit - Edit Files

edit(
    file_path="/path/to/file.py",
    old_string="def old():",
    new_string="def new():"
)

tree - Directory Structure

tree(path="/project", depth=3)

find - File Discovery

find(pattern="*.py", path="/project")
search(pattern="TODO|FIXME", path="./src")

ast - Code Structure

ast(pattern="class.*Service", path="/src")

License

MIT