hanzo-mcp 0.1.35__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of hanzo-mcp might be problematic. Click here for more details.

hanzo_mcp/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Hanzo MCP - Implementation of Hanzo capabilities using MCP."""
2
2
 
3
- __version__ = "0.1.35"
3
+ __version__ = "0.2.0"
hanzo_mcp/cli.py CHANGED
@@ -82,6 +82,14 @@ def main() -> None:
82
82
  default=False,
83
83
  help="Enable the agent tool (disabled by default)"
84
84
  )
85
+
86
+ _ = parser.add_argument(
87
+ "--disable-write-tools",
88
+ dest="disable_write_tools",
89
+ action="store_true",
90
+ default=False,
91
+ help="Disable write/edit tools (file writing, editing, notebook editing) to use IDE tools instead. Note: Shell commands can still modify files."
92
+ )
85
93
 
86
94
  _ = parser.add_argument(
87
95
  "--install",
@@ -102,12 +110,13 @@ def main() -> None:
102
110
  agent_max_iterations: int = cast(int, args.agent_max_iterations)
103
111
  agent_max_tool_uses: int = cast(int, args.agent_max_tool_uses)
104
112
  enable_agent_tool: bool = cast(bool, args.enable_agent_tool)
113
+ disable_write_tools: bool = cast(bool, args.disable_write_tools)
105
114
  allowed_paths: list[str] = (
106
115
  cast(list[str], args.allowed_paths) if args.allowed_paths else []
107
116
  )
108
117
 
109
118
  if install:
110
- install_claude_desktop_config(name, allowed_paths)
119
+ install_claude_desktop_config(name, allowed_paths, disable_write_tools)
111
120
  return
112
121
 
113
122
  # If no allowed paths are specified, use the user's home directory
@@ -140,20 +149,25 @@ def main() -> None:
140
149
  agent_api_key=agent_api_key,
141
150
  agent_max_iterations=agent_max_iterations,
142
151
  agent_max_tool_uses=agent_max_tool_uses,
143
- enable_agent_tool=enable_agent_tool
152
+ enable_agent_tool=enable_agent_tool,
153
+ disable_write_tools=disable_write_tools
144
154
  )
145
155
  # Transport will be automatically cast to Literal['stdio', 'sse'] by the server
146
156
  server.run(transport=transport)
147
157
 
148
158
 
149
159
  def install_claude_desktop_config(
150
- name: str = "claude-code", allowed_paths: list[str] | None = None
160
+ name: str = "claude-code", allowed_paths: list[str] | None = None,
161
+ disable_write_tools: bool = False
151
162
  ) -> None:
152
163
  """Install the server configuration in Claude Desktop.
153
164
 
154
165
  Args:
155
166
  name: The name to use for the server in the config
156
167
  allowed_paths: Optional list of paths to allow
168
+ disable_write_tools: Whether to disable write/edit tools (file writing, editing, notebook editing)
169
+ to use IDE tools instead. Note: Shell commands can still modify files.
170
+ (default: False)
157
171
  """
158
172
  # Find the Claude Desktop config directory
159
173
  home: Path = Path.home()
@@ -183,6 +197,10 @@ def install_claude_desktop_config(
183
197
  else:
184
198
  # Allow home directory by default
185
199
  args.extend(["--allow-path", str(home)])
200
+
201
+ # Add disable_write_tools flag if specified
202
+ if disable_write_tools:
203
+ args.append("--disable-write-tools")
186
204
 
187
205
  # Create config object
188
206
  config: dict[str, Any] = {
hanzo_mcp/server.py CHANGED
@@ -27,6 +27,7 @@ class HanzoServer:
27
27
  agent_max_iterations: int = 10,
28
28
  agent_max_tool_uses: int = 30,
29
29
  enable_agent_tool: bool = False,
30
+ disable_write_tools: bool = False,
30
31
  ):
31
32
  """Initialize the Hanzo server.
32
33
 
@@ -41,6 +42,7 @@ class HanzoServer:
41
42
  agent_max_iterations: Maximum number of iterations for agent (default: 10)
42
43
  agent_max_tool_uses: Maximum number of total tool uses for agent (default: 30)
43
44
  enable_agent_tool: Whether to enable the agent tool (default: False)
45
+ disable_write_tools: Whether to disable write/edit tools (default: False)
44
46
  """
45
47
  self.mcp = mcp_instance if mcp_instance is not None else FastMCP(name)
46
48
 
@@ -80,6 +82,7 @@ class HanzoServer:
80
82
  self.agent_max_iterations = agent_max_iterations
81
83
  self.agent_max_tool_uses = agent_max_tool_uses
82
84
  self.enable_agent_tool = enable_agent_tool
85
+ self.disable_write_tools = disable_write_tools
83
86
 
84
87
  # Register all tools
85
88
  register_all_tools(
@@ -92,6 +95,7 @@ class HanzoServer:
92
95
  agent_max_iterations=self.agent_max_iterations,
93
96
  agent_max_tool_uses=self.agent_max_tool_uses,
94
97
  enable_agent_tool=self.enable_agent_tool,
98
+ disable_write_tools=self.disable_write_tools,
95
99
  )
96
100
 
97
101
  def run(self, transport: str = "stdio", allowed_paths: list[str] | None = None):
@@ -12,7 +12,7 @@ to delegate tasks to sub-agents for concurrent execution and specialized process
12
12
  from mcp.server.fastmcp import FastMCP
13
13
 
14
14
  from hanzo_mcp.tools.agent import register_agent_tools
15
- from hanzo_mcp.tools.common import register_thinking_tool, register_version_tool
15
+ from hanzo_mcp.tools.common import register_think_tool, register_version_tool
16
16
  from hanzo_mcp.tools.common.context import DocumentContext
17
17
  from hanzo_mcp.tools.common.permissions import PermissionManager
18
18
  from hanzo_mcp.tools.filesystem import register_filesystem_tools
@@ -32,6 +32,7 @@ def register_all_tools(
32
32
  agent_max_iterations: int = 10,
33
33
  agent_max_tool_uses: int = 30,
34
34
  enable_agent_tool: bool = False,
35
+ disable_write_tools: bool = False,
35
36
  ) -> None:
36
37
  """Register all Hanzo tools with the MCP server.
37
38
 
@@ -45,12 +46,13 @@ def register_all_tools(
45
46
  agent_max_iterations: Maximum number of iterations for agent (default: 10)
46
47
  agent_max_tool_uses: Maximum number of total tool uses for agent (default: 30)
47
48
  enable_agent_tool: Whether to enable the agent tool (default: False)
49
+ disable_write_tools: Whether to disable write/edit tools (default: False)
48
50
  """
49
51
  # Register all filesystem tools
50
- register_filesystem_tools(mcp_server, document_context, permission_manager)
52
+ register_filesystem_tools(mcp_server, document_context, permission_manager, disable_write_tools)
51
53
 
52
54
  # Register all jupyter tools
53
- register_jupyter_tools(mcp_server, document_context, permission_manager)
55
+ register_jupyter_tools(mcp_server, document_context, permission_manager, disable_write_tools)
54
56
 
55
57
  # Register shell tools
56
58
  register_shell_tools(mcp_server, permission_manager)
@@ -78,7 +80,7 @@ def register_all_tools(
78
80
  )
79
81
 
80
82
  # Initialize and register thinking tool
81
- register_thinking_tool(mcp_server)
83
+ register_think_tool(mcp_server)
82
84
 
83
85
  # Register version tool
84
86
  register_version_tool(mcp_server)
@@ -3,11 +3,11 @@
3
3
  from mcp.server.fastmcp import FastMCP
4
4
 
5
5
  from hanzo_mcp.tools.common.base import ToolRegistry
6
- from hanzo_mcp.tools.common.thinking_tool import ThinkingTool
6
+ from hanzo_mcp.tools.common.think_tool import ThinkingTool
7
7
  from hanzo_mcp.tools.common.version_tool import VersionTool
8
8
 
9
9
 
10
- def register_thinking_tool(
10
+ def register_think_tool(
11
11
  mcp_server: FastMCP,
12
12
  ) -> None:
13
13
  """Register all thinking tools with the MCP server.
@@ -15,8 +15,8 @@ def register_thinking_tool(
15
15
  Args:
16
16
  mcp_server: The FastMCP server instance
17
17
  """
18
- thinking_tool = ThinkingTool()
19
- ToolRegistry.register_tool(mcp_server, thinking_tool)
18
+ think_tool = ThinkingTool()
19
+ ToolRegistry.register_tool(mcp_server, think_tool)
20
20
 
21
21
 
22
22
  def register_version_tool(
@@ -77,6 +77,7 @@ def register_filesystem_tools(
77
77
  mcp_server: FastMCP,
78
78
  document_context: DocumentContext,
79
79
  permission_manager: PermissionManager,
80
+ disable_write_tools: bool = False,
80
81
  ) -> None:
81
82
  """Register all filesystem tools with the MCP server.
82
83
 
@@ -84,6 +85,10 @@ def register_filesystem_tools(
84
85
  mcp_server: The FastMCP server instance
85
86
  document_context: Document context for tracking file contents
86
87
  permission_manager: Permission manager for access control
88
+ disable_write_tools: Whether to disable write/edit tools (default: False)
87
89
  """
88
- tools = get_filesystem_tools(document_context, permission_manager)
90
+ if disable_write_tools:
91
+ tools = get_read_only_filesystem_tools(document_context, permission_manager)
92
+ else:
93
+ tools = get_filesystem_tools(document_context, permission_manager)
89
94
  ToolRegistry.register_tools(mcp_server, tools)
@@ -59,6 +59,7 @@ def register_jupyter_tools(
59
59
  mcp_server: FastMCP,
60
60
  document_context: DocumentContext,
61
61
  permission_manager: PermissionManager,
62
+ disable_write_tools: bool = False,
62
63
  ) -> None:
63
64
  """Register all Jupyter notebook tools with the MCP server.
64
65
 
@@ -66,6 +67,10 @@ def register_jupyter_tools(
66
67
  mcp_server: The FastMCP server instance
67
68
  document_context: Document context for tracking file contents
68
69
  permission_manager: Permission manager for access control
70
+ disable_write_tools: Whether to disable write/edit tools (default: False)
69
71
  """
70
- tools = get_jupyter_tools(document_context, permission_manager)
72
+ if disable_write_tools:
73
+ tools = get_read_only_jupyter_tools(document_context, permission_manager)
74
+ else:
75
+ tools = get_jupyter_tools(document_context, permission_manager)
71
76
  ToolRegistry.register_tools(mcp_server, tools)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hanzo-mcp
3
- Version: 0.1.35
3
+ Version: 0.2.0
4
4
  Summary: MCP implementation of Hanzo capabilities
5
5
  Author-email: Hanzo Industries Inc <dev@hanzo.ai>
6
6
  License: MIT
@@ -1,20 +1,20 @@
1
- hanzo_mcp/__init__.py,sha256=CORvlrxN3iL_OvRoZJZxvZ66fZJY0KGcDrgDDVDB9Qw,90
2
- hanzo_mcp/cli.py,sha256=G0Klg7RMK9XLehLT9ysWbpii0XRrECglUaxwvCekl7g,7201
3
- hanzo_mcp/server.py,sha256=j2UagHTxwCbZrnhODbMUI0wdZ-7yLFxB9-ZbignZFzg,5671
4
- hanzo_mcp/tools/__init__.py,sha256=3IHzhmSiAbxg2yvqVJn4SH6YP_DSnxYaNk9ccBtk7H0,3339
1
+ hanzo_mcp/__init__.py,sha256=crlSOFdbUf7WY8A-esMOCLI-YKa7IwfxXTsOZvFswvg,89
2
+ hanzo_mcp/cli.py,sha256=nfTY2lDvdxUR7KTk5j89CGpgLCj9YwAb2mqBzWlJBHI,8070
3
+ hanzo_mcp/server.py,sha256=rZcu0JsOQlnnbBVV128qpXEl-ocWEVToBDeA8wmt068,5913
4
+ hanzo_mcp/tools/__init__.py,sha256=9LbWAPfSntDwLaAex3dagsHO4BgZQHKj5E6UX-Gmyb4,3496
5
5
  hanzo_mcp/tools/agent/__init__.py,sha256=0eyQqqdAy7WCZEqUfV6xh66bDpQI9neB6iDjWf0_pJI,2189
6
6
  hanzo_mcp/tools/agent/agent_tool.py,sha256=qXu62ZRGM0o9mxOiRVFy-ABIZtEJ8z03DqAXshKAieI,19180
7
7
  hanzo_mcp/tools/agent/prompt.py,sha256=jmYRI4Sm2D3LwEdC2qWakpqupgfGg8CT6grmx4NEDaA,4431
8
8
  hanzo_mcp/tools/agent/tool_adapter.py,sha256=g9NKfIET0WOsm0r28xEXsibsprpI1C6ripcM6QwU-rI,2172
9
- hanzo_mcp/tools/common/__init__.py,sha256=VS_eJP0oJGEgO78stwQWyer1heVfhhHihtt5sctjei8,809
9
+ hanzo_mcp/tools/common/__init__.py,sha256=felrGAEqLWOa8fuHjTCS7khqtlA-izz8k865ky7R-f8,797
10
10
  hanzo_mcp/tools/common/base.py,sha256=O7Lgft0XiC9Iyi3fYsmoWWrvKDK2Aa-FJLxPgnNJRJY,7341
11
11
  hanzo_mcp/tools/common/context.py,sha256=ReIfcm37j5qnLQ8G_-d88ad5uC1OKkjQZKG9HdJPybI,13145
12
12
  hanzo_mcp/tools/common/permissions.py,sha256=4YCfA2PJUOl-z_47n5uaRXO8gAZ_shMaPhpi1dilgRE,7594
13
13
  hanzo_mcp/tools/common/session.py,sha256=csX5ZhgBjO2bdXXXPpsUPzOCc7Tib-apYe01AP8sh8k,2774
14
- hanzo_mcp/tools/common/thinking_tool.py,sha256=I-O6ipM-PUofkNoMMzv37Y_2Yfx9mh7F1upTTsfRN4M,4046
14
+ hanzo_mcp/tools/common/think_tool.py,sha256=I-O6ipM-PUofkNoMMzv37Y_2Yfx9mh7F1upTTsfRN4M,4046
15
15
  hanzo_mcp/tools/common/validation.py,sha256=gB3uM_cbPZsH4Ez0hnTgIcdP-AUlHZU02aRmZEpk_6I,3648
16
16
  hanzo_mcp/tools/common/version_tool.py,sha256=4bJZhqgtvwQMyVSSZ-xU-NQvr1xfnyDi_4FnOpZvuw0,3406
17
- hanzo_mcp/tools/filesystem/__init__.py,sha256=-wNhb0IjJgz05n_fRP0wDXfKgJ6fgBp4wrGo62Hpyvc,3265
17
+ hanzo_mcp/tools/filesystem/__init__.py,sha256=Jm5AmLIdRxzcZ4L8ajNJCQYObpmUeoBOzdYdFvDgQIA,3513
18
18
  hanzo_mcp/tools/filesystem/base.py,sha256=HAzuMCrS0dKOBZNoLr7y74tdbYyKpi0FGhStuRgkFTU,3917
19
19
  hanzo_mcp/tools/filesystem/content_replace.py,sha256=ZwzxyOTASUmzP-jtEnsSR-MKtNFC4R3kQunpV3KOCyg,11049
20
20
  hanzo_mcp/tools/filesystem/directory_tree.py,sha256=cx-zpOeKP8DDuMt1ls3QhRk9h3RVmMhpPwpqn4wTfP4,11271
@@ -23,7 +23,7 @@ hanzo_mcp/tools/filesystem/get_file_info.py,sha256=WR7uMqFcpKboS3FX3jF-MD-0-ROJJ
23
23
  hanzo_mcp/tools/filesystem/read_files.py,sha256=0JYJ2kM8FIoksbnnO8V0uY3D2R1uWvR7zb7_oXV0sMM,6968
24
24
  hanzo_mcp/tools/filesystem/search_content.py,sha256=2zXke1YHYxg6GKQ_XHb0sXeaSkHI7Jx3P-YAqrpOTNM,10766
25
25
  hanzo_mcp/tools/filesystem/write_file.py,sha256=7ZNR1ygECBjT7m62QNkeIEt0OGxNZL2zijX-bASWj0Y,5303
26
- hanzo_mcp/tools/jupyter/__init__.py,sha256=xFYW8Idb4x1jLWbexN5sqFKSCd1aL820uENzJ7mb6rs,2282
26
+ hanzo_mcp/tools/jupyter/__init__.py,sha256=9mZ55Mq0JMmjOxCxbeFHS8vOqvezzh_uCst02EPB4Ng,2527
27
27
  hanzo_mcp/tools/jupyter/base.py,sha256=xtssHrkHx_u_nE12dqtZGcvuJe8kfsbSkMmq-6KQobQ,10412
28
28
  hanzo_mcp/tools/jupyter/edit_notebook.py,sha256=_ZNlsCYaO9_SbZouvrLYElvssL6nlElCc2JxNCeMdQo,11986
29
29
  hanzo_mcp/tools/jupyter/notebook_operations.py,sha256=PkZXk_PYPkBGxg2RWzqh-rN6VDHjFybImhdUm3xLLoY,23120
@@ -38,9 +38,9 @@ hanzo_mcp/tools/shell/command_executor.py,sha256=5GcJvg54uty9fl_tkGdWTBcHyjxuynQ
38
38
  hanzo_mcp/tools/shell/run_command.py,sha256=r7HBw0lqabgkGnVsDXmLnrTo0SU9g8gLvzpa-9n-cmM,6891
39
39
  hanzo_mcp/tools/shell/run_script.py,sha256=CLYnDc0Ze8plkXU6d98RgE4UrBg-fwaMVdcn9Fc6Ixw,7432
40
40
  hanzo_mcp/tools/shell/script_tool.py,sha256=s63tawIZBvwgm_kU9P7A3D4v2ulVw7j4l_rpsa_zGuc,8680
41
- hanzo_mcp-0.1.35.dist-info/licenses/LICENSE,sha256=mf1qZGFsPGskoPgytp9B-RsahfKvXsBpmaAbTLGTt8Y,1063
42
- hanzo_mcp-0.1.35.dist-info/METADATA,sha256=4pFM0WHFNJhGuwIu_XUT3rdPn5SBQTnRHVpINX6K7eo,7551
43
- hanzo_mcp-0.1.35.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
44
- hanzo_mcp-0.1.35.dist-info/entry_points.txt,sha256=aRKOKXtuQr-idSr-yH4efnRl2v8te94AcgN3ysqqSYs,49
45
- hanzo_mcp-0.1.35.dist-info/top_level.txt,sha256=eGFANatA0MHWiVlpS56fTYRIShtibrSom1uXI6XU0GU,10
46
- hanzo_mcp-0.1.35.dist-info/RECORD,,
41
+ hanzo_mcp-0.2.0.dist-info/licenses/LICENSE,sha256=mf1qZGFsPGskoPgytp9B-RsahfKvXsBpmaAbTLGTt8Y,1063
42
+ hanzo_mcp-0.2.0.dist-info/METADATA,sha256=dAdJtsK8J9wl9dVksKcMPvaj7xcxtPjcyhbIekF_BX0,7550
43
+ hanzo_mcp-0.2.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
44
+ hanzo_mcp-0.2.0.dist-info/entry_points.txt,sha256=aRKOKXtuQr-idSr-yH4efnRl2v8te94AcgN3ysqqSYs,49
45
+ hanzo_mcp-0.2.0.dist-info/top_level.txt,sha256=eGFANatA0MHWiVlpS56fTYRIShtibrSom1uXI6XU0GU,10
46
+ hanzo_mcp-0.2.0.dist-info/RECORD,,