hanzo-mcp 0.7.7__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 +6 -0
- 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.7.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.7.dist-info/RECORD +0 -182
- {hanzo_mcp-0.7.7.dist-info → hanzo_mcp-0.8.0.dist-info}/WHEEL +0 -0
- {hanzo_mcp-0.7.7.dist-info → hanzo_mcp-0.8.0.dist-info}/entry_points.txt +0 -0
- {hanzo_mcp-0.7.7.dist-info → hanzo_mcp-0.8.0.dist-info}/top_level.txt +0 -0
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
This module provides the TodoWrite tool for creating and managing a structured task list for a session.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
from typing import
|
|
6
|
+
from typing import Unpack, Literal, Annotated, TypedDict, final, override
|
|
7
7
|
|
|
8
|
-
from mcp.server.fastmcp import Context as MCPContext
|
|
9
|
-
from mcp.server import FastMCP
|
|
10
8
|
from pydantic import Field
|
|
9
|
+
from mcp.server import FastMCP
|
|
10
|
+
from mcp.server.fastmcp import Context as MCPContext
|
|
11
11
|
|
|
12
|
-
from hanzo_mcp.tools.todo.base import
|
|
12
|
+
from hanzo_mcp.tools.todo.base import TodoStorage, TodoBaseTool
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class TodoItem(TypedDict):
|
|
@@ -369,8 +369,6 @@ When in doubt, use this tool. Being proactive with task management demonstrates
|
|
|
369
369
|
|
|
370
370
|
@mcp_server.tool(name=self.name, description=self.description)
|
|
371
371
|
async def todo_write(
|
|
372
|
-
session_id: SessionId,
|
|
373
|
-
todos: Todos,
|
|
374
|
-
ctx: MCPContext
|
|
372
|
+
session_id: SessionId, todos: Todos, ctx: MCPContext
|
|
375
373
|
) -> str:
|
|
376
374
|
return await tool_self.call(ctx, session_id=session_id, todos=todos)
|
|
@@ -7,30 +7,31 @@ Supported backends:
|
|
|
7
7
|
- Infinity database (default) - High-performance local vector database
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
+
from mcp.server import FastMCP
|
|
11
|
+
|
|
10
12
|
from hanzo_mcp.tools.common.base import BaseTool
|
|
11
13
|
from hanzo_mcp.tools.common.permissions import PermissionManager
|
|
12
|
-
from mcp.server import FastMCP
|
|
13
14
|
|
|
14
15
|
# Try to import vector dependencies
|
|
15
16
|
try:
|
|
16
|
-
from .
|
|
17
|
-
from .project_manager import ProjectVectorManager
|
|
17
|
+
from .index_tool import IndexTool
|
|
18
18
|
from .vector_index import VectorIndexTool
|
|
19
19
|
from .vector_search import VectorSearchTool
|
|
20
|
-
from .
|
|
21
|
-
|
|
20
|
+
from .infinity_store import InfinityVectorStore
|
|
21
|
+
from .project_manager import ProjectVectorManager
|
|
22
|
+
|
|
22
23
|
VECTOR_AVAILABLE = True
|
|
23
|
-
|
|
24
|
+
|
|
24
25
|
def register_vector_tools(
|
|
25
26
|
mcp_server: FastMCP,
|
|
26
27
|
permission_manager: PermissionManager,
|
|
27
28
|
vector_config: dict | None = None,
|
|
28
29
|
enabled_tools: dict[str, bool] | None = None,
|
|
29
30
|
search_paths: list[str] | None = None,
|
|
30
|
-
project_manager:
|
|
31
|
+
project_manager: "ProjectVectorManager | None" = None,
|
|
31
32
|
) -> list[BaseTool]:
|
|
32
33
|
"""Register vector database tools with the MCP server.
|
|
33
|
-
|
|
34
|
+
|
|
34
35
|
Args:
|
|
35
36
|
mcp_server: The FastMCP server instance
|
|
36
37
|
permission_manager: Permission manager for access control
|
|
@@ -38,58 +39,67 @@ try:
|
|
|
38
39
|
enabled_tools: Dictionary of individual tool enable states
|
|
39
40
|
search_paths: Paths to search for projects (default: None, uses allowed paths)
|
|
40
41
|
project_manager: Optional existing project manager to reuse
|
|
41
|
-
|
|
42
|
+
|
|
42
43
|
Returns:
|
|
43
44
|
List of registered tools
|
|
44
45
|
"""
|
|
45
46
|
if not vector_config or not vector_config.get("enabled", False):
|
|
46
47
|
return []
|
|
47
|
-
|
|
48
|
+
|
|
48
49
|
# Check individual tool enablement
|
|
49
50
|
tool_enabled = enabled_tools or {}
|
|
50
51
|
tools = []
|
|
51
|
-
|
|
52
|
+
|
|
52
53
|
# Use provided project manager or create new one
|
|
53
54
|
if project_manager is None:
|
|
54
55
|
# Initialize project-aware vector manager
|
|
55
56
|
store_config = vector_config.copy()
|
|
56
57
|
project_manager = ProjectVectorManager(
|
|
57
58
|
global_db_path=store_config.get("data_path"),
|
|
58
|
-
embedding_model=store_config.get(
|
|
59
|
+
embedding_model=store_config.get(
|
|
60
|
+
"embedding_model", "text-embedding-3-small"
|
|
61
|
+
),
|
|
59
62
|
dimension=store_config.get("dimension", 1536),
|
|
60
63
|
)
|
|
61
|
-
|
|
64
|
+
|
|
62
65
|
# Auto-detect projects from search paths for new manager
|
|
63
66
|
if search_paths:
|
|
64
67
|
detected_projects = project_manager.detect_projects(search_paths)
|
|
65
68
|
import logging
|
|
69
|
+
|
|
66
70
|
logger = logging.getLogger(__name__)
|
|
67
|
-
logger.info(
|
|
68
|
-
|
|
71
|
+
logger.info(
|
|
72
|
+
f"Detected {len(detected_projects)} projects with LLM.md files"
|
|
73
|
+
)
|
|
74
|
+
|
|
69
75
|
# Register individual tools if enabled
|
|
70
76
|
if tool_enabled.get("index", True):
|
|
71
77
|
tools.append(IndexTool(permission_manager))
|
|
72
|
-
|
|
78
|
+
|
|
73
79
|
if tool_enabled.get("vector_index", True):
|
|
74
80
|
tools.append(VectorIndexTool(permission_manager, project_manager))
|
|
75
|
-
|
|
81
|
+
|
|
76
82
|
if tool_enabled.get("vector_search", True):
|
|
77
83
|
tools.append(VectorSearchTool(permission_manager, project_manager))
|
|
78
|
-
|
|
84
|
+
|
|
79
85
|
# Register with MCP server
|
|
80
86
|
from hanzo_mcp.tools.common.base import ToolRegistry
|
|
87
|
+
|
|
81
88
|
ToolRegistry.register_tools(mcp_server, tools)
|
|
82
|
-
|
|
89
|
+
|
|
83
90
|
return tools
|
|
84
91
|
|
|
85
92
|
except ImportError:
|
|
86
93
|
VECTOR_AVAILABLE = False
|
|
87
|
-
|
|
94
|
+
|
|
88
95
|
def register_vector_tools(*args, **kwargs) -> list[BaseTool]:
|
|
89
96
|
"""Vector tools not available - missing dependencies."""
|
|
90
97
|
import logging
|
|
98
|
+
|
|
91
99
|
logger = logging.getLogger(__name__)
|
|
92
|
-
logger.warning(
|
|
100
|
+
logger.warning(
|
|
101
|
+
"Vector tools not available. Install infinity-embedded: pip install infinity-embedded"
|
|
102
|
+
)
|
|
93
103
|
return []
|
|
94
104
|
|
|
95
105
|
|
|
@@ -99,10 +109,12 @@ __all__ = [
|
|
|
99
109
|
]
|
|
100
110
|
|
|
101
111
|
if VECTOR_AVAILABLE:
|
|
102
|
-
__all__.extend(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
__all__.extend(
|
|
113
|
+
[
|
|
114
|
+
"InfinityVectorStore",
|
|
115
|
+
"ProjectVectorManager",
|
|
116
|
+
"IndexTool",
|
|
117
|
+
"VectorIndexTool",
|
|
118
|
+
"VectorSearchTool",
|
|
119
|
+
]
|
|
120
|
+
)
|