hanzo-mcp 0.8.11__py3-none-any.whl → 0.9.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.

Files changed (166) hide show
  1. hanzo_mcp/__init__.py +1 -3
  2. hanzo_mcp/analytics/posthog_analytics.py +3 -9
  3. hanzo_mcp/bridge.py +9 -25
  4. hanzo_mcp/cli.py +6 -15
  5. hanzo_mcp/cli_enhanced.py +5 -14
  6. hanzo_mcp/cli_plugin.py +3 -9
  7. hanzo_mcp/config/settings.py +6 -20
  8. hanzo_mcp/config/tool_config.py +1 -3
  9. hanzo_mcp/core/base_agent.py +88 -88
  10. hanzo_mcp/core/model_registry.py +238 -210
  11. hanzo_mcp/dev_server.py +5 -15
  12. hanzo_mcp/prompts/__init__.py +2 -6
  13. hanzo_mcp/prompts/project_todo_reminder.py +3 -9
  14. hanzo_mcp/prompts/tool_explorer.py +1 -3
  15. hanzo_mcp/prompts/utils.py +7 -21
  16. hanzo_mcp/server.py +2 -6
  17. hanzo_mcp/tools/__init__.py +26 -27
  18. hanzo_mcp/tools/agent/__init__.py +2 -1
  19. hanzo_mcp/tools/agent/agent.py +10 -30
  20. hanzo_mcp/tools/agent/agent_tool.py +22 -15
  21. hanzo_mcp/tools/agent/claude_desktop_auth.py +3 -9
  22. hanzo_mcp/tools/agent/cli_agent_base.py +7 -24
  23. hanzo_mcp/tools/agent/cli_tools.py +75 -74
  24. hanzo_mcp/tools/agent/code_auth.py +1 -3
  25. hanzo_mcp/tools/agent/code_auth_tool.py +2 -6
  26. hanzo_mcp/tools/agent/critic_tool.py +8 -24
  27. hanzo_mcp/tools/agent/iching_tool.py +12 -36
  28. hanzo_mcp/tools/agent/network_tool.py +7 -18
  29. hanzo_mcp/tools/agent/prompt.py +1 -5
  30. hanzo_mcp/tools/agent/review_tool.py +10 -25
  31. hanzo_mcp/tools/agent/swarm_alias.py +1 -3
  32. hanzo_mcp/tools/agent/unified_cli_tools.py +38 -38
  33. hanzo_mcp/tools/common/batch_tool.py +15 -45
  34. hanzo_mcp/tools/common/config_tool.py +9 -28
  35. hanzo_mcp/tools/common/context.py +1 -3
  36. hanzo_mcp/tools/common/critic_tool.py +1 -3
  37. hanzo_mcp/tools/common/decorators.py +2 -6
  38. hanzo_mcp/tools/common/enhanced_base.py +2 -6
  39. hanzo_mcp/tools/common/fastmcp_pagination.py +4 -12
  40. hanzo_mcp/tools/common/forgiving_edit.py +9 -28
  41. hanzo_mcp/tools/common/mode.py +1 -5
  42. hanzo_mcp/tools/common/paginated_base.py +3 -11
  43. hanzo_mcp/tools/common/paginated_response.py +10 -30
  44. hanzo_mcp/tools/common/pagination.py +3 -9
  45. hanzo_mcp/tools/common/path_utils.py +34 -0
  46. hanzo_mcp/tools/common/permissions.py +14 -13
  47. hanzo_mcp/tools/common/personality.py +983 -701
  48. hanzo_mcp/tools/common/plugin_loader.py +3 -15
  49. hanzo_mcp/tools/common/stats.py +6 -18
  50. hanzo_mcp/tools/common/thinking_tool.py +1 -3
  51. hanzo_mcp/tools/common/tool_disable.py +2 -6
  52. hanzo_mcp/tools/common/tool_list.py +2 -6
  53. hanzo_mcp/tools/common/validation.py +1 -3
  54. hanzo_mcp/tools/compiler/__init__.py +8 -0
  55. hanzo_mcp/tools/compiler/sandboxed_compiler.py +681 -0
  56. hanzo_mcp/tools/config/config_tool.py +7 -13
  57. hanzo_mcp/tools/config/index_config.py +1 -3
  58. hanzo_mcp/tools/config/mode_tool.py +5 -15
  59. hanzo_mcp/tools/database/database_manager.py +3 -9
  60. hanzo_mcp/tools/database/graph.py +1 -3
  61. hanzo_mcp/tools/database/graph_add.py +3 -9
  62. hanzo_mcp/tools/database/graph_query.py +11 -34
  63. hanzo_mcp/tools/database/graph_remove.py +3 -9
  64. hanzo_mcp/tools/database/graph_search.py +6 -20
  65. hanzo_mcp/tools/database/graph_stats.py +11 -33
  66. hanzo_mcp/tools/database/sql.py +4 -12
  67. hanzo_mcp/tools/database/sql_query.py +6 -10
  68. hanzo_mcp/tools/database/sql_search.py +2 -6
  69. hanzo_mcp/tools/database/sql_stats.py +5 -15
  70. hanzo_mcp/tools/editor/neovim_command.py +1 -3
  71. hanzo_mcp/tools/editor/neovim_session.py +7 -13
  72. hanzo_mcp/tools/environment/__init__.py +8 -0
  73. hanzo_mcp/tools/environment/environment_detector.py +594 -0
  74. hanzo_mcp/tools/filesystem/__init__.py +28 -26
  75. hanzo_mcp/tools/filesystem/ast_multi_edit.py +14 -43
  76. hanzo_mcp/tools/filesystem/ast_tool.py +3 -0
  77. hanzo_mcp/tools/filesystem/base.py +20 -12
  78. hanzo_mcp/tools/filesystem/content_replace.py +7 -12
  79. hanzo_mcp/tools/filesystem/diff.py +2 -10
  80. hanzo_mcp/tools/filesystem/directory_tree.py +285 -51
  81. hanzo_mcp/tools/filesystem/edit.py +10 -18
  82. hanzo_mcp/tools/filesystem/find.py +312 -179
  83. hanzo_mcp/tools/filesystem/git_search.py +12 -24
  84. hanzo_mcp/tools/filesystem/multi_edit.py +10 -18
  85. hanzo_mcp/tools/filesystem/read.py +14 -30
  86. hanzo_mcp/tools/filesystem/rules_tool.py +9 -17
  87. hanzo_mcp/tools/filesystem/search.py +1160 -0
  88. hanzo_mcp/tools/filesystem/watch.py +2 -4
  89. hanzo_mcp/tools/filesystem/write.py +7 -10
  90. hanzo_mcp/tools/framework/__init__.py +8 -0
  91. hanzo_mcp/tools/framework/framework_modes.py +714 -0
  92. hanzo_mcp/tools/jupyter/base.py +6 -20
  93. hanzo_mcp/tools/jupyter/jupyter.py +4 -12
  94. hanzo_mcp/tools/llm/consensus_tool.py +8 -24
  95. hanzo_mcp/tools/llm/llm_manage.py +2 -6
  96. hanzo_mcp/tools/llm/llm_tool.py +17 -58
  97. hanzo_mcp/tools/llm/llm_unified.py +18 -59
  98. hanzo_mcp/tools/llm/provider_tools.py +1 -3
  99. hanzo_mcp/tools/lsp/lsp_tool.py +621 -481
  100. hanzo_mcp/tools/mcp/mcp_add.py +1 -3
  101. hanzo_mcp/tools/mcp/mcp_stats.py +1 -3
  102. hanzo_mcp/tools/mcp/mcp_tool.py +9 -23
  103. hanzo_mcp/tools/memory/__init__.py +10 -27
  104. hanzo_mcp/tools/memory/conversation_memory.py +636 -0
  105. hanzo_mcp/tools/memory/knowledge_tools.py +7 -25
  106. hanzo_mcp/tools/memory/memory_tools.py +6 -18
  107. hanzo_mcp/tools/search/find_tool.py +12 -34
  108. hanzo_mcp/tools/search/unified_search.py +24 -78
  109. hanzo_mcp/tools/shell/__init__.py +16 -4
  110. hanzo_mcp/tools/shell/auto_background.py +2 -6
  111. hanzo_mcp/tools/shell/base.py +1 -5
  112. hanzo_mcp/tools/shell/base_process.py +5 -7
  113. hanzo_mcp/tools/shell/bash_session.py +7 -24
  114. hanzo_mcp/tools/shell/bash_session_executor.py +5 -15
  115. hanzo_mcp/tools/shell/bash_tool.py +3 -7
  116. hanzo_mcp/tools/shell/command_executor.py +26 -79
  117. hanzo_mcp/tools/shell/logs.py +4 -16
  118. hanzo_mcp/tools/shell/npx.py +2 -8
  119. hanzo_mcp/tools/shell/npx_tool.py +1 -3
  120. hanzo_mcp/tools/shell/pkill.py +4 -12
  121. hanzo_mcp/tools/shell/process_tool.py +2 -8
  122. hanzo_mcp/tools/shell/processes.py +5 -17
  123. hanzo_mcp/tools/shell/run_background.py +1 -3
  124. hanzo_mcp/tools/shell/run_command.py +1 -3
  125. hanzo_mcp/tools/shell/run_command_windows.py +1 -3
  126. hanzo_mcp/tools/shell/run_tool.py +56 -0
  127. hanzo_mcp/tools/shell/session_manager.py +2 -6
  128. hanzo_mcp/tools/shell/session_storage.py +2 -6
  129. hanzo_mcp/tools/shell/streaming_command.py +7 -23
  130. hanzo_mcp/tools/shell/uvx.py +4 -14
  131. hanzo_mcp/tools/shell/uvx_background.py +2 -6
  132. hanzo_mcp/tools/shell/uvx_tool.py +1 -3
  133. hanzo_mcp/tools/shell/zsh_tool.py +12 -20
  134. hanzo_mcp/tools/todo/todo.py +1 -3
  135. hanzo_mcp/tools/vector/__init__.py +97 -50
  136. hanzo_mcp/tools/vector/ast_analyzer.py +6 -20
  137. hanzo_mcp/tools/vector/git_ingester.py +10 -30
  138. hanzo_mcp/tools/vector/index_tool.py +3 -9
  139. hanzo_mcp/tools/vector/infinity_store.py +7 -27
  140. hanzo_mcp/tools/vector/mock_infinity.py +1 -3
  141. hanzo_mcp/tools/vector/node_tool.py +538 -0
  142. hanzo_mcp/tools/vector/project_manager.py +4 -12
  143. hanzo_mcp/tools/vector/unified_vector.py +384 -0
  144. hanzo_mcp/tools/vector/vector.py +2 -6
  145. hanzo_mcp/tools/vector/vector_index.py +8 -8
  146. hanzo_mcp/tools/vector/vector_search.py +7 -21
  147. {hanzo_mcp-0.8.11.dist-info → hanzo_mcp-0.9.0.dist-info}/METADATA +2 -2
  148. hanzo_mcp-0.9.0.dist-info/RECORD +191 -0
  149. hanzo_mcp/tools/agent/agent_tool_v1_deprecated.py +0 -645
  150. hanzo_mcp/tools/agent/swarm_tool.py +0 -718
  151. hanzo_mcp/tools/agent/swarm_tool_v1_deprecated.py +0 -577
  152. hanzo_mcp/tools/filesystem/batch_search.py +0 -900
  153. hanzo_mcp/tools/filesystem/directory_tree_paginated.py +0 -350
  154. hanzo_mcp/tools/filesystem/find_files.py +0 -369
  155. hanzo_mcp/tools/filesystem/grep.py +0 -467
  156. hanzo_mcp/tools/filesystem/search_tool.py +0 -767
  157. hanzo_mcp/tools/filesystem/symbols_tool.py +0 -515
  158. hanzo_mcp/tools/filesystem/tree.py +0 -270
  159. hanzo_mcp/tools/jupyter/notebook_edit.py +0 -317
  160. hanzo_mcp/tools/jupyter/notebook_read.py +0 -147
  161. hanzo_mcp/tools/todo/todo_read.py +0 -143
  162. hanzo_mcp/tools/todo/todo_write.py +0 -374
  163. hanzo_mcp-0.8.11.dist-info/RECORD +0 -193
  164. {hanzo_mcp-0.8.11.dist-info → hanzo_mcp-0.9.0.dist-info}/WHEEL +0 -0
  165. {hanzo_mcp-0.8.11.dist-info → hanzo_mcp-0.9.0.dist-info}/entry_points.txt +0 -0
  166. {hanzo_mcp-0.8.11.dist-info → hanzo_mcp-0.9.0.dist-info}/top_level.txt +0 -0
@@ -189,9 +189,7 @@ Use 'mcp_stats' to see all added servers and their status.
189
189
 
190
190
  full_command = shlex.split(command)
191
191
 
192
- await tool_ctx.info(
193
- f"Adding MCP server '{name}' with command: {' '.join(full_command)}"
194
- )
192
+ await tool_ctx.info(f"Adding MCP server '{name}' with command: {' '.join(full_command)}")
195
193
 
196
194
  # Create server configuration
197
195
  server_config = {
@@ -68,9 +68,7 @@ Example:
68
68
  servers = McpAddTool.get_servers()
69
69
 
70
70
  if not servers:
71
- return (
72
- "No MCP servers have been added yet.\n\nUse 'mcp_add' to add servers."
73
- )
71
+ return "No MCP servers have been added yet.\n\nUse 'mcp_add' to add servers."
74
72
 
75
73
  output = []
76
74
  output.append("=== MCP Server Statistics ===")
@@ -173,9 +173,7 @@ class MCPTool(BaseTool):
173
173
  def _auto_start_servers(self):
174
174
  """Auto-start servers configured for auto-start."""
175
175
  for name, server_config in self.config.get("servers", {}).items():
176
- if server_config.get("enabled", False) and server_config.get(
177
- "auto_start", False
178
- ):
176
+ if server_config.get("enabled", False) and server_config.get("auto_start", False):
179
177
  self._start_server(name, server_config)
180
178
 
181
179
  def _start_server(self, name: str, config: Dict[str, Any]) -> bool:
@@ -202,9 +200,7 @@ class MCPTool(BaseTool):
202
200
  cmd = [config["command"]] + config.get("args", [])
203
201
 
204
202
  # Create log directory
205
- log_dir = Path(
206
- self.config.get("log_dir", str(Path.home() / ".hanzo" / "mcp" / "logs"))
207
- )
203
+ log_dir = Path(self.config.get("log_dir", str(Path.home() / ".hanzo" / "mcp" / "logs")))
208
204
  log_dir.mkdir(parents=True, exist_ok=True)
209
205
 
210
206
  # Start process
@@ -307,11 +303,11 @@ Status: {enabled} enabled, {running} running"""
307
303
  elif action == "restart":
308
304
  return self._handle_restart(params.get("name"))
309
305
  elif action == "config":
310
- return self._handle_config(
311
- params.get("config_key"), params.get("config_value")
312
- )
306
+ return self._handle_config(params.get("config_key"), params.get("config_value"))
313
307
  else:
314
- return f"Error: Unknown action '{action}'. Valid actions: list, add, remove, enable, disable, restart, config"
308
+ return (
309
+ f"Error: Unknown action '{action}'. Valid actions: list, add, remove, enable, disable, restart, config"
310
+ )
315
311
 
316
312
  def _handle_list(self) -> str:
317
313
  """List all MCP servers."""
@@ -355,9 +351,7 @@ Status: {enabled} enabled, {running} running"""
355
351
  output.append(f"{name}: {status}")
356
352
  if config.get("description"):
357
353
  output.append(f" Description: {config['description']}")
358
- output.append(
359
- f" Command: {config['command']} {' '.join(config.get('args', []))}"
360
- )
354
+ output.append(f" Command: {config['command']} {' '.join(config.get('args', []))}")
361
355
 
362
356
  if config.get("env"):
363
357
  env_str = ", ".join([f"{k}={v}" for k, v in config["env"].items()])
@@ -498,11 +492,7 @@ Status: {enabled} enabled, {running} running"""
498
492
  else:
499
493
  return f"Configuration key '{key}' not found"
500
494
 
501
- return (
502
- json.dumps(current, indent=2)
503
- if isinstance(current, (dict, list))
504
- else str(current)
505
- )
495
+ return json.dumps(current, indent=2) if isinstance(current, (dict, list)) else str(current)
506
496
  else:
507
497
  # Set value
508
498
  # Navigate to parent
@@ -513,11 +503,7 @@ Status: {enabled} enabled, {running} running"""
513
503
  current = current[k]
514
504
 
515
505
  # Parse value if it looks like JSON
516
- if (
517
- isinstance(value, str)
518
- and value.startswith("{")
519
- or value.startswith("[")
520
- ):
506
+ if isinstance(value, str) and value.startswith("{") or value.startswith("["):
521
507
  try:
522
508
  value = json.loads(value)
523
509
  except Exception:
@@ -20,6 +20,7 @@ try:
20
20
  SummarizeToMemoryTool,
21
21
  ManageKnowledgeBasesTool,
22
22
  )
23
+
23
24
  MEMORY_TOOLS_AVAILABLE = True
24
25
  except ImportError:
25
26
  MEMORY_TOOLS_AVAILABLE = False
@@ -49,35 +50,17 @@ def register_memory_tools(
49
50
  return []
50
51
 
51
52
  # Create memory tools
52
- recall_tool = RecallMemoriesTool(
53
- user_id=user_id, project_id=project_id, **memory_config
54
- )
55
- create_tool = CreateMemoriesTool(
56
- user_id=user_id, project_id=project_id, **memory_config
57
- )
58
- update_tool = UpdateMemoriesTool(
59
- user_id=user_id, project_id=project_id, **memory_config
60
- )
61
- delete_tool = DeleteMemoriesTool(
62
- user_id=user_id, project_id=project_id, **memory_config
63
- )
64
- manage_tool = ManageMemoriesTool(
65
- user_id=user_id, project_id=project_id, **memory_config
66
- )
53
+ recall_tool = RecallMemoriesTool(user_id=user_id, project_id=project_id, **memory_config)
54
+ create_tool = CreateMemoriesTool(user_id=user_id, project_id=project_id, **memory_config)
55
+ update_tool = UpdateMemoriesTool(user_id=user_id, project_id=project_id, **memory_config)
56
+ delete_tool = DeleteMemoriesTool(user_id=user_id, project_id=project_id, **memory_config)
57
+ manage_tool = ManageMemoriesTool(user_id=user_id, project_id=project_id, **memory_config)
67
58
 
68
59
  # Create knowledge tools
69
- recall_facts_tool = RecallFactsTool(
70
- user_id=user_id, project_id=project_id, **memory_config
71
- )
72
- store_facts_tool = StoreFactsTool(
73
- user_id=user_id, project_id=project_id, **memory_config
74
- )
75
- summarize_tool = SummarizeToMemoryTool(
76
- user_id=user_id, project_id=project_id, **memory_config
77
- )
78
- manage_kb_tool = ManageKnowledgeBasesTool(
79
- user_id=user_id, project_id=project_id, **memory_config
80
- )
60
+ recall_facts_tool = RecallFactsTool(user_id=user_id, project_id=project_id, **memory_config)
61
+ store_facts_tool = StoreFactsTool(user_id=user_id, project_id=project_id, **memory_config)
62
+ summarize_tool = SummarizeToMemoryTool(user_id=user_id, project_id=project_id, **memory_config)
63
+ manage_kb_tool = ManageKnowledgeBasesTool(user_id=user_id, project_id=project_id, **memory_config)
81
64
 
82
65
  # Register tools
83
66
  ToolRegistry.register_tool(mcp_server, recall_tool)