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.
- hanzo_mcp/__init__.py +1 -3
- hanzo_mcp/analytics/posthog_analytics.py +3 -9
- hanzo_mcp/bridge.py +9 -25
- hanzo_mcp/cli.py +6 -15
- hanzo_mcp/cli_enhanced.py +5 -14
- hanzo_mcp/cli_plugin.py +3 -9
- hanzo_mcp/config/settings.py +6 -20
- hanzo_mcp/config/tool_config.py +1 -3
- hanzo_mcp/core/base_agent.py +88 -88
- hanzo_mcp/core/model_registry.py +238 -210
- hanzo_mcp/dev_server.py +5 -15
- hanzo_mcp/prompts/__init__.py +2 -6
- hanzo_mcp/prompts/project_todo_reminder.py +3 -9
- hanzo_mcp/prompts/tool_explorer.py +1 -3
- hanzo_mcp/prompts/utils.py +7 -21
- hanzo_mcp/server.py +2 -6
- hanzo_mcp/tools/__init__.py +26 -27
- hanzo_mcp/tools/agent/__init__.py +2 -1
- hanzo_mcp/tools/agent/agent.py +10 -30
- hanzo_mcp/tools/agent/agent_tool.py +22 -15
- hanzo_mcp/tools/agent/claude_desktop_auth.py +3 -9
- hanzo_mcp/tools/agent/cli_agent_base.py +7 -24
- hanzo_mcp/tools/agent/cli_tools.py +75 -74
- hanzo_mcp/tools/agent/code_auth.py +1 -3
- hanzo_mcp/tools/agent/code_auth_tool.py +2 -6
- hanzo_mcp/tools/agent/critic_tool.py +8 -24
- hanzo_mcp/tools/agent/iching_tool.py +12 -36
- hanzo_mcp/tools/agent/network_tool.py +7 -18
- hanzo_mcp/tools/agent/prompt.py +1 -5
- hanzo_mcp/tools/agent/review_tool.py +10 -25
- hanzo_mcp/tools/agent/swarm_alias.py +1 -3
- hanzo_mcp/tools/agent/unified_cli_tools.py +38 -38
- hanzo_mcp/tools/common/batch_tool.py +15 -45
- hanzo_mcp/tools/common/config_tool.py +9 -28
- hanzo_mcp/tools/common/context.py +1 -3
- hanzo_mcp/tools/common/critic_tool.py +1 -3
- hanzo_mcp/tools/common/decorators.py +2 -6
- hanzo_mcp/tools/common/enhanced_base.py +2 -6
- hanzo_mcp/tools/common/fastmcp_pagination.py +4 -12
- hanzo_mcp/tools/common/forgiving_edit.py +9 -28
- hanzo_mcp/tools/common/mode.py +1 -5
- hanzo_mcp/tools/common/paginated_base.py +3 -11
- hanzo_mcp/tools/common/paginated_response.py +10 -30
- hanzo_mcp/tools/common/pagination.py +3 -9
- hanzo_mcp/tools/common/path_utils.py +34 -0
- hanzo_mcp/tools/common/permissions.py +14 -13
- hanzo_mcp/tools/common/personality.py +983 -701
- hanzo_mcp/tools/common/plugin_loader.py +3 -15
- hanzo_mcp/tools/common/stats.py +6 -18
- hanzo_mcp/tools/common/thinking_tool.py +1 -3
- hanzo_mcp/tools/common/tool_disable.py +2 -6
- hanzo_mcp/tools/common/tool_list.py +2 -6
- hanzo_mcp/tools/common/validation.py +1 -3
- hanzo_mcp/tools/compiler/__init__.py +8 -0
- hanzo_mcp/tools/compiler/sandboxed_compiler.py +681 -0
- hanzo_mcp/tools/config/config_tool.py +7 -13
- hanzo_mcp/tools/config/index_config.py +1 -3
- hanzo_mcp/tools/config/mode_tool.py +5 -15
- hanzo_mcp/tools/database/database_manager.py +3 -9
- hanzo_mcp/tools/database/graph.py +1 -3
- hanzo_mcp/tools/database/graph_add.py +3 -9
- hanzo_mcp/tools/database/graph_query.py +11 -34
- hanzo_mcp/tools/database/graph_remove.py +3 -9
- hanzo_mcp/tools/database/graph_search.py +6 -20
- hanzo_mcp/tools/database/graph_stats.py +11 -33
- hanzo_mcp/tools/database/sql.py +4 -12
- hanzo_mcp/tools/database/sql_query.py +6 -10
- hanzo_mcp/tools/database/sql_search.py +2 -6
- hanzo_mcp/tools/database/sql_stats.py +5 -15
- hanzo_mcp/tools/editor/neovim_command.py +1 -3
- hanzo_mcp/tools/editor/neovim_session.py +7 -13
- hanzo_mcp/tools/environment/__init__.py +8 -0
- hanzo_mcp/tools/environment/environment_detector.py +594 -0
- hanzo_mcp/tools/filesystem/__init__.py +28 -26
- hanzo_mcp/tools/filesystem/ast_multi_edit.py +14 -43
- hanzo_mcp/tools/filesystem/ast_tool.py +3 -0
- hanzo_mcp/tools/filesystem/base.py +20 -12
- hanzo_mcp/tools/filesystem/content_replace.py +7 -12
- hanzo_mcp/tools/filesystem/diff.py +2 -10
- hanzo_mcp/tools/filesystem/directory_tree.py +285 -51
- hanzo_mcp/tools/filesystem/edit.py +10 -18
- hanzo_mcp/tools/filesystem/find.py +312 -179
- hanzo_mcp/tools/filesystem/git_search.py +12 -24
- hanzo_mcp/tools/filesystem/multi_edit.py +10 -18
- hanzo_mcp/tools/filesystem/read.py +14 -30
- hanzo_mcp/tools/filesystem/rules_tool.py +9 -17
- hanzo_mcp/tools/filesystem/search.py +1160 -0
- hanzo_mcp/tools/filesystem/watch.py +2 -4
- hanzo_mcp/tools/filesystem/write.py +7 -10
- hanzo_mcp/tools/framework/__init__.py +8 -0
- hanzo_mcp/tools/framework/framework_modes.py +714 -0
- hanzo_mcp/tools/jupyter/base.py +6 -20
- hanzo_mcp/tools/jupyter/jupyter.py +4 -12
- hanzo_mcp/tools/llm/consensus_tool.py +8 -24
- hanzo_mcp/tools/llm/llm_manage.py +2 -6
- hanzo_mcp/tools/llm/llm_tool.py +17 -58
- hanzo_mcp/tools/llm/llm_unified.py +18 -59
- hanzo_mcp/tools/llm/provider_tools.py +1 -3
- hanzo_mcp/tools/lsp/lsp_tool.py +621 -481
- hanzo_mcp/tools/mcp/mcp_add.py +1 -3
- hanzo_mcp/tools/mcp/mcp_stats.py +1 -3
- hanzo_mcp/tools/mcp/mcp_tool.py +9 -23
- hanzo_mcp/tools/memory/__init__.py +10 -27
- hanzo_mcp/tools/memory/conversation_memory.py +636 -0
- hanzo_mcp/tools/memory/knowledge_tools.py +7 -25
- hanzo_mcp/tools/memory/memory_tools.py +6 -18
- hanzo_mcp/tools/search/find_tool.py +12 -34
- hanzo_mcp/tools/search/unified_search.py +24 -78
- hanzo_mcp/tools/shell/__init__.py +16 -4
- hanzo_mcp/tools/shell/auto_background.py +2 -6
- hanzo_mcp/tools/shell/base.py +1 -5
- hanzo_mcp/tools/shell/base_process.py +5 -7
- hanzo_mcp/tools/shell/bash_session.py +7 -24
- hanzo_mcp/tools/shell/bash_session_executor.py +5 -15
- hanzo_mcp/tools/shell/bash_tool.py +3 -7
- hanzo_mcp/tools/shell/command_executor.py +26 -79
- hanzo_mcp/tools/shell/logs.py +4 -16
- hanzo_mcp/tools/shell/npx.py +2 -8
- hanzo_mcp/tools/shell/npx_tool.py +1 -3
- hanzo_mcp/tools/shell/pkill.py +4 -12
- hanzo_mcp/tools/shell/process_tool.py +2 -8
- hanzo_mcp/tools/shell/processes.py +5 -17
- hanzo_mcp/tools/shell/run_background.py +1 -3
- hanzo_mcp/tools/shell/run_command.py +1 -3
- hanzo_mcp/tools/shell/run_command_windows.py +1 -3
- hanzo_mcp/tools/shell/run_tool.py +56 -0
- hanzo_mcp/tools/shell/session_manager.py +2 -6
- hanzo_mcp/tools/shell/session_storage.py +2 -6
- hanzo_mcp/tools/shell/streaming_command.py +7 -23
- hanzo_mcp/tools/shell/uvx.py +4 -14
- hanzo_mcp/tools/shell/uvx_background.py +2 -6
- hanzo_mcp/tools/shell/uvx_tool.py +1 -3
- hanzo_mcp/tools/shell/zsh_tool.py +12 -20
- hanzo_mcp/tools/todo/todo.py +1 -3
- hanzo_mcp/tools/vector/__init__.py +97 -50
- hanzo_mcp/tools/vector/ast_analyzer.py +6 -20
- hanzo_mcp/tools/vector/git_ingester.py +10 -30
- hanzo_mcp/tools/vector/index_tool.py +3 -9
- hanzo_mcp/tools/vector/infinity_store.py +7 -27
- hanzo_mcp/tools/vector/mock_infinity.py +1 -3
- hanzo_mcp/tools/vector/node_tool.py +538 -0
- hanzo_mcp/tools/vector/project_manager.py +4 -12
- hanzo_mcp/tools/vector/unified_vector.py +384 -0
- hanzo_mcp/tools/vector/vector.py +2 -6
- hanzo_mcp/tools/vector/vector_index.py +8 -8
- hanzo_mcp/tools/vector/vector_search.py +7 -21
- {hanzo_mcp-0.8.11.dist-info → hanzo_mcp-0.9.0.dist-info}/METADATA +2 -2
- hanzo_mcp-0.9.0.dist-info/RECORD +191 -0
- hanzo_mcp/tools/agent/agent_tool_v1_deprecated.py +0 -645
- hanzo_mcp/tools/agent/swarm_tool.py +0 -718
- hanzo_mcp/tools/agent/swarm_tool_v1_deprecated.py +0 -577
- hanzo_mcp/tools/filesystem/batch_search.py +0 -900
- hanzo_mcp/tools/filesystem/directory_tree_paginated.py +0 -350
- hanzo_mcp/tools/filesystem/find_files.py +0 -369
- hanzo_mcp/tools/filesystem/grep.py +0 -467
- hanzo_mcp/tools/filesystem/search_tool.py +0 -767
- hanzo_mcp/tools/filesystem/symbols_tool.py +0 -515
- hanzo_mcp/tools/filesystem/tree.py +0 -270
- hanzo_mcp/tools/jupyter/notebook_edit.py +0 -317
- hanzo_mcp/tools/jupyter/notebook_read.py +0 -147
- hanzo_mcp/tools/todo/todo_read.py +0 -143
- hanzo_mcp/tools/todo/todo_write.py +0 -374
- hanzo_mcp-0.8.11.dist-info/RECORD +0 -193
- {hanzo_mcp-0.8.11.dist-info → hanzo_mcp-0.9.0.dist-info}/WHEEL +0 -0
- {hanzo_mcp-0.8.11.dist-info → hanzo_mcp-0.9.0.dist-info}/entry_points.txt +0 -0
- {hanzo_mcp-0.8.11.dist-info → hanzo_mcp-0.9.0.dist-info}/top_level.txt +0 -0
hanzo_mcp/tools/mcp/mcp_add.py
CHANGED
|
@@ -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 = {
|
hanzo_mcp/tools/mcp/mcp_stats.py
CHANGED
|
@@ -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 ===")
|
hanzo_mcp/tools/mcp/mcp_tool.py
CHANGED
|
@@ -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
|
|
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
|
-
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
71
|
-
)
|
|
72
|
-
|
|
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)
|