hanzo-mcp 0.7.6__py3-none-any.whl → 0.8.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 +7 -1
- hanzo_mcp/__main__.py +1 -1
- hanzo_mcp/analytics/__init__.py +2 -2
- hanzo_mcp/analytics/posthog_analytics.py +76 -82
- hanzo_mcp/cli.py +31 -36
- hanzo_mcp/cli_enhanced.py +94 -72
- hanzo_mcp/cli_plugin.py +27 -17
- hanzo_mcp/config/__init__.py +2 -2
- hanzo_mcp/config/settings.py +112 -88
- hanzo_mcp/config/tool_config.py +32 -34
- hanzo_mcp/dev_server.py +66 -67
- hanzo_mcp/prompts/__init__.py +94 -12
- hanzo_mcp/prompts/enhanced_prompts.py +809 -0
- hanzo_mcp/prompts/example_custom_prompt.py +6 -5
- hanzo_mcp/prompts/project_todo_reminder.py +0 -1
- hanzo_mcp/prompts/tool_explorer.py +10 -7
- hanzo_mcp/server.py +17 -21
- hanzo_mcp/server_enhanced.py +15 -22
- hanzo_mcp/tools/__init__.py +56 -28
- hanzo_mcp/tools/agent/__init__.py +16 -19
- hanzo_mcp/tools/agent/agent.py +82 -65
- hanzo_mcp/tools/agent/agent_tool.py +152 -122
- hanzo_mcp/tools/agent/agent_tool_v1_deprecated.py +66 -62
- hanzo_mcp/tools/agent/clarification_protocol.py +55 -50
- hanzo_mcp/tools/agent/clarification_tool.py +11 -10
- hanzo_mcp/tools/agent/claude_cli_tool.py +21 -20
- hanzo_mcp/tools/agent/claude_desktop_auth.py +130 -144
- hanzo_mcp/tools/agent/cli_agent_base.py +59 -53
- hanzo_mcp/tools/agent/code_auth.py +102 -107
- hanzo_mcp/tools/agent/code_auth_tool.py +28 -27
- hanzo_mcp/tools/agent/codex_cli_tool.py +20 -19
- hanzo_mcp/tools/agent/critic_tool.py +86 -73
- hanzo_mcp/tools/agent/gemini_cli_tool.py +21 -20
- hanzo_mcp/tools/agent/grok_cli_tool.py +21 -20
- hanzo_mcp/tools/agent/iching_tool.py +404 -139
- hanzo_mcp/tools/agent/network_tool.py +89 -73
- hanzo_mcp/tools/agent/prompt.py +2 -1
- hanzo_mcp/tools/agent/review_tool.py +101 -98
- hanzo_mcp/tools/agent/swarm_alias.py +87 -0
- hanzo_mcp/tools/agent/swarm_tool.py +246 -161
- hanzo_mcp/tools/agent/swarm_tool_v1_deprecated.py +134 -92
- hanzo_mcp/tools/agent/tool_adapter.py +21 -11
- hanzo_mcp/tools/common/__init__.py +1 -1
- hanzo_mcp/tools/common/base.py +3 -5
- hanzo_mcp/tools/common/batch_tool.py +46 -39
- hanzo_mcp/tools/common/config_tool.py +120 -84
- hanzo_mcp/tools/common/context.py +1 -5
- hanzo_mcp/tools/common/context_fix.py +5 -3
- hanzo_mcp/tools/common/critic_tool.py +4 -8
- hanzo_mcp/tools/common/decorators.py +58 -56
- hanzo_mcp/tools/common/enhanced_base.py +29 -32
- hanzo_mcp/tools/common/fastmcp_pagination.py +91 -94
- hanzo_mcp/tools/common/forgiving_edit.py +91 -87
- hanzo_mcp/tools/common/mode.py +15 -17
- hanzo_mcp/tools/common/mode_loader.py +27 -24
- hanzo_mcp/tools/common/paginated_base.py +61 -53
- hanzo_mcp/tools/common/paginated_response.py +72 -79
- hanzo_mcp/tools/common/pagination.py +50 -53
- hanzo_mcp/tools/common/permissions.py +4 -4
- hanzo_mcp/tools/common/personality.py +186 -138
- hanzo_mcp/tools/common/plugin_loader.py +54 -54
- hanzo_mcp/tools/common/stats.py +65 -47
- hanzo_mcp/tools/common/test_helpers.py +31 -0
- hanzo_mcp/tools/common/thinking_tool.py +4 -8
- hanzo_mcp/tools/common/tool_disable.py +17 -12
- hanzo_mcp/tools/common/tool_enable.py +13 -14
- hanzo_mcp/tools/common/tool_list.py +36 -28
- hanzo_mcp/tools/common/truncate.py +23 -23
- hanzo_mcp/tools/config/__init__.py +4 -4
- hanzo_mcp/tools/config/config_tool.py +42 -29
- hanzo_mcp/tools/config/index_config.py +37 -34
- hanzo_mcp/tools/config/mode_tool.py +175 -55
- hanzo_mcp/tools/database/__init__.py +15 -12
- hanzo_mcp/tools/database/database_manager.py +77 -75
- hanzo_mcp/tools/database/graph.py +137 -91
- hanzo_mcp/tools/database/graph_add.py +30 -18
- hanzo_mcp/tools/database/graph_query.py +178 -102
- hanzo_mcp/tools/database/graph_remove.py +33 -28
- hanzo_mcp/tools/database/graph_search.py +97 -75
- hanzo_mcp/tools/database/graph_stats.py +91 -59
- hanzo_mcp/tools/database/sql.py +107 -79
- hanzo_mcp/tools/database/sql_query.py +30 -24
- hanzo_mcp/tools/database/sql_search.py +29 -25
- hanzo_mcp/tools/database/sql_stats.py +47 -35
- hanzo_mcp/tools/editor/neovim_command.py +25 -28
- hanzo_mcp/tools/editor/neovim_edit.py +21 -23
- hanzo_mcp/tools/editor/neovim_session.py +60 -54
- hanzo_mcp/tools/filesystem/__init__.py +31 -30
- hanzo_mcp/tools/filesystem/ast_multi_edit.py +329 -249
- hanzo_mcp/tools/filesystem/ast_tool.py +4 -4
- hanzo_mcp/tools/filesystem/base.py +1 -1
- hanzo_mcp/tools/filesystem/batch_search.py +316 -224
- hanzo_mcp/tools/filesystem/content_replace.py +4 -4
- hanzo_mcp/tools/filesystem/diff.py +71 -59
- hanzo_mcp/tools/filesystem/directory_tree.py +7 -7
- hanzo_mcp/tools/filesystem/directory_tree_paginated.py +49 -37
- hanzo_mcp/tools/filesystem/edit.py +4 -4
- hanzo_mcp/tools/filesystem/find.py +173 -80
- hanzo_mcp/tools/filesystem/find_files.py +73 -52
- hanzo_mcp/tools/filesystem/git_search.py +157 -104
- hanzo_mcp/tools/filesystem/grep.py +8 -8
- hanzo_mcp/tools/filesystem/multi_edit.py +4 -8
- hanzo_mcp/tools/filesystem/read.py +12 -10
- hanzo_mcp/tools/filesystem/rules_tool.py +59 -43
- hanzo_mcp/tools/filesystem/search_tool.py +263 -207
- hanzo_mcp/tools/filesystem/symbols_tool.py +94 -54
- hanzo_mcp/tools/filesystem/tree.py +35 -33
- hanzo_mcp/tools/filesystem/unix_aliases.py +13 -18
- hanzo_mcp/tools/filesystem/watch.py +37 -36
- hanzo_mcp/tools/filesystem/write.py +4 -8
- hanzo_mcp/tools/jupyter/__init__.py +4 -4
- hanzo_mcp/tools/jupyter/base.py +4 -5
- hanzo_mcp/tools/jupyter/jupyter.py +67 -47
- hanzo_mcp/tools/jupyter/notebook_edit.py +4 -4
- hanzo_mcp/tools/jupyter/notebook_read.py +4 -7
- hanzo_mcp/tools/llm/__init__.py +5 -7
- hanzo_mcp/tools/llm/consensus_tool.py +72 -52
- hanzo_mcp/tools/llm/llm_manage.py +101 -60
- hanzo_mcp/tools/llm/llm_tool.py +226 -166
- hanzo_mcp/tools/llm/provider_tools.py +25 -26
- hanzo_mcp/tools/lsp/__init__.py +1 -1
- hanzo_mcp/tools/lsp/lsp_tool.py +228 -143
- hanzo_mcp/tools/mcp/__init__.py +2 -3
- hanzo_mcp/tools/mcp/mcp_add.py +27 -25
- hanzo_mcp/tools/mcp/mcp_remove.py +7 -8
- hanzo_mcp/tools/mcp/mcp_stats.py +23 -22
- hanzo_mcp/tools/mcp/mcp_tool.py +129 -98
- hanzo_mcp/tools/memory/__init__.py +39 -21
- hanzo_mcp/tools/memory/knowledge_tools.py +124 -99
- hanzo_mcp/tools/memory/memory_tools.py +90 -108
- hanzo_mcp/tools/search/__init__.py +7 -2
- hanzo_mcp/tools/search/find_tool.py +297 -212
- hanzo_mcp/tools/search/unified_search.py +366 -314
- hanzo_mcp/tools/shell/__init__.py +8 -7
- hanzo_mcp/tools/shell/auto_background.py +56 -49
- hanzo_mcp/tools/shell/base.py +1 -1
- hanzo_mcp/tools/shell/base_process.py +75 -75
- hanzo_mcp/tools/shell/bash_session.py +2 -2
- hanzo_mcp/tools/shell/bash_session_executor.py +4 -4
- hanzo_mcp/tools/shell/bash_tool.py +24 -31
- hanzo_mcp/tools/shell/command_executor.py +12 -12
- hanzo_mcp/tools/shell/logs.py +43 -33
- hanzo_mcp/tools/shell/npx.py +13 -13
- hanzo_mcp/tools/shell/npx_background.py +24 -21
- hanzo_mcp/tools/shell/npx_tool.py +18 -22
- hanzo_mcp/tools/shell/open.py +19 -21
- hanzo_mcp/tools/shell/pkill.py +31 -26
- hanzo_mcp/tools/shell/process_tool.py +32 -32
- hanzo_mcp/tools/shell/processes.py +57 -58
- hanzo_mcp/tools/shell/run_background.py +24 -25
- hanzo_mcp/tools/shell/run_command.py +5 -5
- hanzo_mcp/tools/shell/run_command_windows.py +5 -5
- hanzo_mcp/tools/shell/session_storage.py +3 -3
- hanzo_mcp/tools/shell/streaming_command.py +141 -126
- hanzo_mcp/tools/shell/uvx.py +24 -25
- hanzo_mcp/tools/shell/uvx_background.py +35 -33
- hanzo_mcp/tools/shell/uvx_tool.py +18 -22
- hanzo_mcp/tools/todo/__init__.py +6 -2
- hanzo_mcp/tools/todo/todo.py +50 -37
- hanzo_mcp/tools/todo/todo_read.py +5 -8
- hanzo_mcp/tools/todo/todo_write.py +5 -7
- hanzo_mcp/tools/vector/__init__.py +40 -28
- hanzo_mcp/tools/vector/ast_analyzer.py +176 -143
- hanzo_mcp/tools/vector/git_ingester.py +170 -179
- hanzo_mcp/tools/vector/index_tool.py +96 -44
- hanzo_mcp/tools/vector/infinity_store.py +283 -228
- hanzo_mcp/tools/vector/mock_infinity.py +39 -40
- hanzo_mcp/tools/vector/project_manager.py +88 -78
- hanzo_mcp/tools/vector/vector.py +59 -42
- hanzo_mcp/tools/vector/vector_index.py +30 -27
- hanzo_mcp/tools/vector/vector_search.py +64 -45
- hanzo_mcp/types.py +6 -4
- {hanzo_mcp-0.7.6.dist-info → hanzo_mcp-0.8.0.dist-info}/METADATA +1 -1
- hanzo_mcp-0.8.0.dist-info/RECORD +185 -0
- hanzo_mcp-0.7.6.dist-info/RECORD +0 -182
- {hanzo_mcp-0.7.6.dist-info → hanzo_mcp-0.8.0.dist-info}/WHEEL +0 -0
- {hanzo_mcp-0.7.6.dist-info → hanzo_mcp-0.8.0.dist-info}/entry_points.txt +0 -0
- {hanzo_mcp-0.7.6.dist-info → hanzo_mcp-0.8.0.dist-info}/top_level.txt +0 -0
|
@@ -4,26 +4,27 @@ This tool provides integration with Google's Gemini CLI,
|
|
|
4
4
|
allowing programmatic execution of Gemini models for code tasks.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from typing import List, Optional,
|
|
7
|
+
from typing import List, Optional, final, override
|
|
8
|
+
|
|
8
9
|
from mcp.server import FastMCP
|
|
9
10
|
from mcp.server.fastmcp import Context as MCPContext
|
|
10
11
|
|
|
11
|
-
from hanzo_mcp.tools.agent.cli_agent_base import CLIAgentBase
|
|
12
12
|
from hanzo_mcp.tools.common.permissions import PermissionManager
|
|
13
|
+
from hanzo_mcp.tools.agent.cli_agent_base import CLIAgentBase
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
@final
|
|
16
17
|
class GeminiCLITool(CLIAgentBase):
|
|
17
18
|
"""Tool for executing Google Gemini CLI."""
|
|
18
|
-
|
|
19
|
+
|
|
19
20
|
def __init__(
|
|
20
21
|
self,
|
|
21
22
|
permission_manager: PermissionManager,
|
|
22
23
|
model: Optional[str] = None,
|
|
23
|
-
**kwargs
|
|
24
|
+
**kwargs,
|
|
24
25
|
):
|
|
25
26
|
"""Initialize Gemini CLI tool.
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
Args:
|
|
28
29
|
permission_manager: Permission manager for access control
|
|
29
30
|
model: Optional model override (defaults to gemini-1.5-pro)
|
|
@@ -35,15 +36,15 @@ class GeminiCLITool(CLIAgentBase):
|
|
|
35
36
|
provider_name="Google Gemini",
|
|
36
37
|
default_model=model or "gemini-1.5-pro",
|
|
37
38
|
env_vars=["GOOGLE_API_KEY", "GEMINI_API_KEY"],
|
|
38
|
-
**kwargs
|
|
39
|
+
**kwargs,
|
|
39
40
|
)
|
|
40
|
-
|
|
41
|
+
|
|
41
42
|
@property
|
|
42
43
|
@override
|
|
43
44
|
def name(self) -> str:
|
|
44
45
|
"""Get the tool name."""
|
|
45
46
|
return "gemini_cli"
|
|
46
|
-
|
|
47
|
+
|
|
47
48
|
@property
|
|
48
49
|
@override
|
|
49
50
|
def description(self) -> str:
|
|
@@ -67,46 +68,46 @@ Requirements:
|
|
|
67
68
|
- Gemini CLI must be installed
|
|
68
69
|
- GOOGLE_API_KEY or GEMINI_API_KEY environment variable
|
|
69
70
|
"""
|
|
70
|
-
|
|
71
|
+
|
|
71
72
|
@override
|
|
72
73
|
def get_cli_args(self, prompt: str, **kwargs) -> List[str]:
|
|
73
74
|
"""Get CLI arguments for Gemini.
|
|
74
|
-
|
|
75
|
+
|
|
75
76
|
Args:
|
|
76
77
|
prompt: The prompt to send
|
|
77
78
|
**kwargs: Additional arguments (model, temperature, etc.)
|
|
78
|
-
|
|
79
|
+
|
|
79
80
|
Returns:
|
|
80
81
|
List of command arguments
|
|
81
82
|
"""
|
|
82
83
|
args = ["generate"]
|
|
83
|
-
|
|
84
|
+
|
|
84
85
|
# Add model
|
|
85
86
|
model = kwargs.get("model", self.default_model)
|
|
86
87
|
args.extend(["--model", model])
|
|
87
|
-
|
|
88
|
+
|
|
88
89
|
# Add temperature if specified
|
|
89
90
|
if "temperature" in kwargs:
|
|
90
91
|
args.extend(["--temperature", str(kwargs["temperature"])])
|
|
91
|
-
|
|
92
|
+
|
|
92
93
|
# Add max tokens if specified
|
|
93
94
|
if "max_tokens" in kwargs:
|
|
94
95
|
args.extend(["--max-output-tokens", str(kwargs["max_tokens"])])
|
|
95
|
-
|
|
96
|
+
|
|
96
97
|
# Add safety settings if needed
|
|
97
98
|
if kwargs.get("safety_settings"):
|
|
98
99
|
args.extend(["--safety-settings", kwargs["safety_settings"]])
|
|
99
|
-
|
|
100
|
+
|
|
100
101
|
# Add the prompt
|
|
101
102
|
args.extend(["--prompt", prompt])
|
|
102
|
-
|
|
103
|
+
|
|
103
104
|
return args
|
|
104
|
-
|
|
105
|
+
|
|
105
106
|
@override
|
|
106
107
|
def register(self, mcp_server: FastMCP) -> None:
|
|
107
108
|
"""Register this tool with the MCP server."""
|
|
108
109
|
tool_self = self
|
|
109
|
-
|
|
110
|
+
|
|
110
111
|
@mcp_server.tool(name=self.name, description=self.description)
|
|
111
112
|
async def gemini_cli(
|
|
112
113
|
ctx: MCPContext,
|
|
@@ -125,4 +126,4 @@ Requirements:
|
|
|
125
126
|
max_tokens=max_tokens,
|
|
126
127
|
working_dir=working_dir,
|
|
127
128
|
safety_settings=safety_settings,
|
|
128
|
-
)
|
|
129
|
+
)
|
|
@@ -4,26 +4,27 @@ This tool provides integration with xAI's Grok CLI,
|
|
|
4
4
|
allowing programmatic execution of Grok models for code tasks.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from typing import List, Optional,
|
|
7
|
+
from typing import List, Optional, final, override
|
|
8
|
+
|
|
8
9
|
from mcp.server import FastMCP
|
|
9
10
|
from mcp.server.fastmcp import Context as MCPContext
|
|
10
11
|
|
|
11
|
-
from hanzo_mcp.tools.agent.cli_agent_base import CLIAgentBase
|
|
12
12
|
from hanzo_mcp.tools.common.permissions import PermissionManager
|
|
13
|
+
from hanzo_mcp.tools.agent.cli_agent_base import CLIAgentBase
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
@final
|
|
16
17
|
class GrokCLITool(CLIAgentBase):
|
|
17
18
|
"""Tool for executing Grok CLI."""
|
|
18
|
-
|
|
19
|
+
|
|
19
20
|
def __init__(
|
|
20
21
|
self,
|
|
21
22
|
permission_manager: PermissionManager,
|
|
22
23
|
model: Optional[str] = None,
|
|
23
|
-
**kwargs
|
|
24
|
+
**kwargs,
|
|
24
25
|
):
|
|
25
26
|
"""Initialize Grok CLI tool.
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
Args:
|
|
28
29
|
permission_manager: Permission manager for access control
|
|
29
30
|
model: Optional model override (defaults to grok-2)
|
|
@@ -35,15 +36,15 @@ class GrokCLITool(CLIAgentBase):
|
|
|
35
36
|
provider_name="xAI Grok",
|
|
36
37
|
default_model=model or "grok-2",
|
|
37
38
|
env_vars=["XAI_API_KEY", "GROK_API_KEY"],
|
|
38
|
-
**kwargs
|
|
39
|
+
**kwargs,
|
|
39
40
|
)
|
|
40
|
-
|
|
41
|
+
|
|
41
42
|
@property
|
|
42
43
|
@override
|
|
43
44
|
def name(self) -> str:
|
|
44
45
|
"""Get the tool name."""
|
|
45
46
|
return "grok_cli"
|
|
46
|
-
|
|
47
|
+
|
|
47
48
|
@property
|
|
48
49
|
@override
|
|
49
50
|
def description(self) -> str:
|
|
@@ -67,46 +68,46 @@ Requirements:
|
|
|
67
68
|
- Grok CLI must be installed
|
|
68
69
|
- XAI_API_KEY or GROK_API_KEY environment variable
|
|
69
70
|
"""
|
|
70
|
-
|
|
71
|
+
|
|
71
72
|
@override
|
|
72
73
|
def get_cli_args(self, prompt: str, **kwargs) -> List[str]:
|
|
73
74
|
"""Get CLI arguments for Grok.
|
|
74
|
-
|
|
75
|
+
|
|
75
76
|
Args:
|
|
76
77
|
prompt: The prompt to send
|
|
77
78
|
**kwargs: Additional arguments (model, temperature, etc.)
|
|
78
|
-
|
|
79
|
+
|
|
79
80
|
Returns:
|
|
80
81
|
List of command arguments
|
|
81
82
|
"""
|
|
82
83
|
args = ["chat"]
|
|
83
|
-
|
|
84
|
+
|
|
84
85
|
# Add model
|
|
85
86
|
model = kwargs.get("model", self.default_model)
|
|
86
87
|
args.extend(["--model", model])
|
|
87
|
-
|
|
88
|
+
|
|
88
89
|
# Add temperature if specified
|
|
89
90
|
if "temperature" in kwargs:
|
|
90
91
|
args.extend(["--temperature", str(kwargs["temperature"])])
|
|
91
|
-
|
|
92
|
+
|
|
92
93
|
# Add max tokens if specified
|
|
93
94
|
if "max_tokens" in kwargs:
|
|
94
95
|
args.extend(["--max-tokens", str(kwargs["max_tokens"])])
|
|
95
|
-
|
|
96
|
+
|
|
96
97
|
# Add system prompt if specified
|
|
97
98
|
if "system_prompt" in kwargs:
|
|
98
99
|
args.extend(["--system", kwargs["system_prompt"]])
|
|
99
|
-
|
|
100
|
+
|
|
100
101
|
# Add the prompt
|
|
101
102
|
args.append(prompt)
|
|
102
|
-
|
|
103
|
+
|
|
103
104
|
return args
|
|
104
|
-
|
|
105
|
+
|
|
105
106
|
@override
|
|
106
107
|
def register(self, mcp_server: FastMCP) -> None:
|
|
107
108
|
"""Register this tool with the MCP server."""
|
|
108
109
|
tool_self = self
|
|
109
|
-
|
|
110
|
+
|
|
110
111
|
@mcp_server.tool(name=self.name, description=self.description)
|
|
111
112
|
async def grok_cli(
|
|
112
113
|
ctx: MCPContext,
|
|
@@ -125,4 +126,4 @@ Requirements:
|
|
|
125
126
|
max_tokens=max_tokens,
|
|
126
127
|
working_dir=working_dir,
|
|
127
128
|
system_prompt=system_prompt,
|
|
128
|
-
)
|
|
129
|
+
)
|