hanzo-mcp 0.5.2__py3-none-any.whl → 0.6.1__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 (114) hide show
  1. hanzo_mcp/__init__.py +1 -1
  2. hanzo_mcp/cli.py +32 -0
  3. hanzo_mcp/dev_server.py +246 -0
  4. hanzo_mcp/prompts/__init__.py +1 -1
  5. hanzo_mcp/prompts/project_system.py +43 -7
  6. hanzo_mcp/server.py +5 -1
  7. hanzo_mcp/tools/__init__.py +66 -35
  8. hanzo_mcp/tools/agent/__init__.py +1 -1
  9. hanzo_mcp/tools/agent/agent.py +401 -0
  10. hanzo_mcp/tools/agent/agent_tool.py +3 -4
  11. hanzo_mcp/tools/common/__init__.py +1 -1
  12. hanzo_mcp/tools/common/base.py +2 -2
  13. hanzo_mcp/tools/common/batch_tool.py +3 -5
  14. hanzo_mcp/tools/common/config_tool.py +1 -1
  15. hanzo_mcp/tools/common/context.py +1 -1
  16. hanzo_mcp/tools/common/palette.py +344 -0
  17. hanzo_mcp/tools/common/palette_loader.py +108 -0
  18. hanzo_mcp/tools/common/stats.py +1 -1
  19. hanzo_mcp/tools/common/thinking_tool.py +3 -5
  20. hanzo_mcp/tools/common/tool_disable.py +1 -1
  21. hanzo_mcp/tools/common/tool_enable.py +1 -1
  22. hanzo_mcp/tools/common/tool_list.py +49 -52
  23. hanzo_mcp/tools/config/__init__.py +10 -0
  24. hanzo_mcp/tools/config/config_tool.py +212 -0
  25. hanzo_mcp/tools/config/index_config.py +176 -0
  26. hanzo_mcp/tools/config/palette_tool.py +166 -0
  27. hanzo_mcp/tools/database/__init__.py +1 -1
  28. hanzo_mcp/tools/database/graph.py +482 -0
  29. hanzo_mcp/tools/database/graph_add.py +1 -1
  30. hanzo_mcp/tools/database/graph_query.py +1 -1
  31. hanzo_mcp/tools/database/graph_remove.py +1 -1
  32. hanzo_mcp/tools/database/graph_search.py +1 -1
  33. hanzo_mcp/tools/database/graph_stats.py +1 -1
  34. hanzo_mcp/tools/database/sql.py +411 -0
  35. hanzo_mcp/tools/database/sql_query.py +1 -1
  36. hanzo_mcp/tools/database/sql_search.py +1 -1
  37. hanzo_mcp/tools/database/sql_stats.py +1 -1
  38. hanzo_mcp/tools/editor/neovim_command.py +1 -1
  39. hanzo_mcp/tools/editor/neovim_edit.py +1 -1
  40. hanzo_mcp/tools/editor/neovim_session.py +1 -1
  41. hanzo_mcp/tools/filesystem/__init__.py +42 -13
  42. hanzo_mcp/tools/filesystem/base.py +1 -1
  43. hanzo_mcp/tools/filesystem/batch_search.py +4 -4
  44. hanzo_mcp/tools/filesystem/content_replace.py +3 -5
  45. hanzo_mcp/tools/filesystem/diff.py +193 -0
  46. hanzo_mcp/tools/filesystem/directory_tree.py +3 -5
  47. hanzo_mcp/tools/filesystem/edit.py +3 -5
  48. hanzo_mcp/tools/filesystem/find.py +443 -0
  49. hanzo_mcp/tools/filesystem/find_files.py +1 -1
  50. hanzo_mcp/tools/filesystem/git_search.py +1 -1
  51. hanzo_mcp/tools/filesystem/grep.py +2 -2
  52. hanzo_mcp/tools/filesystem/multi_edit.py +3 -5
  53. hanzo_mcp/tools/filesystem/read.py +17 -5
  54. hanzo_mcp/tools/filesystem/{grep_ast_tool.py → symbols.py} +17 -27
  55. hanzo_mcp/tools/filesystem/symbols_unified.py +376 -0
  56. hanzo_mcp/tools/filesystem/tree.py +268 -0
  57. hanzo_mcp/tools/filesystem/unified_search.py +711 -0
  58. hanzo_mcp/tools/filesystem/unix_aliases.py +99 -0
  59. hanzo_mcp/tools/filesystem/watch.py +174 -0
  60. hanzo_mcp/tools/filesystem/write.py +3 -5
  61. hanzo_mcp/tools/jupyter/__init__.py +9 -12
  62. hanzo_mcp/tools/jupyter/base.py +1 -1
  63. hanzo_mcp/tools/jupyter/jupyter.py +326 -0
  64. hanzo_mcp/tools/jupyter/notebook_edit.py +3 -4
  65. hanzo_mcp/tools/jupyter/notebook_read.py +3 -5
  66. hanzo_mcp/tools/llm/__init__.py +4 -0
  67. hanzo_mcp/tools/llm/consensus_tool.py +1 -1
  68. hanzo_mcp/tools/llm/llm_manage.py +1 -1
  69. hanzo_mcp/tools/llm/llm_tool.py +1 -1
  70. hanzo_mcp/tools/llm/llm_unified.py +851 -0
  71. hanzo_mcp/tools/llm/provider_tools.py +1 -1
  72. hanzo_mcp/tools/mcp/__init__.py +4 -0
  73. hanzo_mcp/tools/mcp/mcp_add.py +1 -1
  74. hanzo_mcp/tools/mcp/mcp_remove.py +1 -1
  75. hanzo_mcp/tools/mcp/mcp_stats.py +1 -1
  76. hanzo_mcp/tools/mcp/mcp_unified.py +503 -0
  77. hanzo_mcp/tools/shell/__init__.py +20 -42
  78. hanzo_mcp/tools/shell/base.py +1 -1
  79. hanzo_mcp/tools/shell/base_process.py +303 -0
  80. hanzo_mcp/tools/shell/bash_unified.py +134 -0
  81. hanzo_mcp/tools/shell/logs.py +1 -1
  82. hanzo_mcp/tools/shell/npx.py +1 -1
  83. hanzo_mcp/tools/shell/npx_background.py +1 -1
  84. hanzo_mcp/tools/shell/npx_unified.py +101 -0
  85. hanzo_mcp/tools/shell/open.py +107 -0
  86. hanzo_mcp/tools/shell/pkill.py +1 -1
  87. hanzo_mcp/tools/shell/process_unified.py +131 -0
  88. hanzo_mcp/tools/shell/processes.py +1 -1
  89. hanzo_mcp/tools/shell/run_background.py +1 -1
  90. hanzo_mcp/tools/shell/run_command.py +3 -4
  91. hanzo_mcp/tools/shell/run_command_windows.py +3 -4
  92. hanzo_mcp/tools/shell/uvx.py +1 -1
  93. hanzo_mcp/tools/shell/uvx_background.py +1 -1
  94. hanzo_mcp/tools/shell/uvx_unified.py +101 -0
  95. hanzo_mcp/tools/todo/__init__.py +1 -1
  96. hanzo_mcp/tools/todo/base.py +1 -1
  97. hanzo_mcp/tools/todo/todo.py +265 -0
  98. hanzo_mcp/tools/todo/todo_read.py +3 -5
  99. hanzo_mcp/tools/todo/todo_write.py +3 -5
  100. hanzo_mcp/tools/vector/__init__.py +1 -1
  101. hanzo_mcp/tools/vector/index_tool.py +1 -1
  102. hanzo_mcp/tools/vector/project_manager.py +27 -5
  103. hanzo_mcp/tools/vector/vector.py +311 -0
  104. hanzo_mcp/tools/vector/vector_index.py +1 -1
  105. hanzo_mcp/tools/vector/vector_search.py +1 -1
  106. hanzo_mcp-0.6.1.dist-info/METADATA +336 -0
  107. hanzo_mcp-0.6.1.dist-info/RECORD +134 -0
  108. hanzo_mcp-0.6.1.dist-info/entry_points.txt +3 -0
  109. hanzo_mcp-0.5.2.dist-info/METADATA +0 -276
  110. hanzo_mcp-0.5.2.dist-info/RECORD +0 -106
  111. hanzo_mcp-0.5.2.dist-info/entry_points.txt +0 -2
  112. {hanzo_mcp-0.5.2.dist-info → hanzo_mcp-0.6.1.dist-info}/WHEEL +0 -0
  113. {hanzo_mcp-0.5.2.dist-info → hanzo_mcp-0.6.1.dist-info}/licenses/LICENSE +0 -0
  114. {hanzo_mcp-0.5.2.dist-info → hanzo_mcp-0.6.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,344 @@
1
+ """Tool palette system for organizing development tools."""
2
+
3
+ from abc import ABC, abstractmethod
4
+ from dataclasses import dataclass, field
5
+ from typing import Dict, List, Optional, Set
6
+
7
+ from hanzo_mcp.tools.common.base import BaseTool
8
+
9
+
10
+ @dataclass
11
+ class ToolPalette:
12
+ """A collection of tools for a specific development environment."""
13
+
14
+ name: str
15
+ description: str
16
+ author: Optional[str] = None
17
+ tools: List[str] = field(default_factory=list)
18
+ dependencies: List[str] = field(default_factory=list)
19
+ environment: Dict[str, str] = field(default_factory=dict)
20
+
21
+ def __post_init__(self):
22
+ """Validate palette configuration."""
23
+ if not self.name:
24
+ raise ValueError("Palette name is required")
25
+ if not self.tools:
26
+ raise ValueError("Palette must include at least one tool")
27
+
28
+
29
+ class PaletteRegistry:
30
+ """Registry for tool palettes."""
31
+
32
+ _palettes: Dict[str, ToolPalette] = {}
33
+ _active_palette: Optional[str] = None
34
+
35
+ @classmethod
36
+ def register(cls, palette: ToolPalette) -> None:
37
+ """Register a tool palette."""
38
+ cls._palettes[palette.name] = palette
39
+
40
+ @classmethod
41
+ def get(cls, name: str) -> Optional[ToolPalette]:
42
+ """Get a palette by name."""
43
+ return cls._palettes.get(name)
44
+
45
+ @classmethod
46
+ def list(cls) -> List[ToolPalette]:
47
+ """List all registered palettes."""
48
+ return list(cls._palettes.values())
49
+
50
+ @classmethod
51
+ def set_active(cls, name: str) -> None:
52
+ """Set the active palette."""
53
+ if name not in cls._palettes:
54
+ raise ValueError(f"Palette '{name}' not found")
55
+ cls._active_palette = name
56
+
57
+ @classmethod
58
+ def get_active(cls) -> Optional[ToolPalette]:
59
+ """Get the active palette."""
60
+ if cls._active_palette:
61
+ return cls._palettes.get(cls._active_palette)
62
+ return None
63
+
64
+ @classmethod
65
+ def get_active_tools(cls) -> Set[str]:
66
+ """Get the set of tools from the active palette."""
67
+ palette = cls.get_active()
68
+ if palette:
69
+ return set(palette.tools)
70
+ return set()
71
+
72
+
73
+ # Pre-defined palettes for famous programmers and ecosystems
74
+
75
+ # Python palette - Guido van Rossum style
76
+ python_palette = ToolPalette(
77
+ name="python",
78
+ description="Python development tools following Guido's philosophy",
79
+ author="Guido van Rossum",
80
+ tools=[
81
+ # Core tools
82
+ "bash", "read", "write", "edit", "grep", "tree", "find",
83
+ # Python specific
84
+ "uvx", "process",
85
+ # Python tooling commands via uvx
86
+ "ruff", # Linting and formatting
87
+ "black", # Code formatting
88
+ "mypy", # Type checking
89
+ "pytest", # Testing
90
+ "poetry", # Dependency management
91
+ "pip-tools", # Requirements management
92
+ "jupyter", # Interactive notebooks
93
+ "sphinx", # Documentation
94
+ ],
95
+ environment={
96
+ "PYTHONDONTWRITEBYTECODE": "1",
97
+ "PYTHONUNBUFFERED": "1",
98
+ }
99
+ )
100
+
101
+ # Ruby palette - Yukihiro Matsumoto (Matz) style
102
+ ruby_palette = ToolPalette(
103
+ name="ruby",
104
+ description="Ruby development tools for programmer happiness by Yukihiro Matsumoto",
105
+ author="Yukihiro Matsumoto",
106
+ tools=[
107
+ # Core tools
108
+ "bash", "read", "write", "edit", "grep", "tree", "find",
109
+ # Ruby specific
110
+ "process",
111
+ # Ruby tooling - optimized for happiness
112
+ "ruby", # Ruby interpreter
113
+ "gem", # Package manager
114
+ "bundler", # Dependency management
115
+ "rake", # Task automation
116
+ "irb", # Interactive Ruby
117
+ "pry", # Enhanced REPL and debugging
118
+ "rubocop", # Style guide enforcement
119
+ "rspec", # Behavior-driven testing
120
+ "minitest", # Lightweight testing
121
+ "yard", # Documentation generator
122
+ "rails", # Web application framework
123
+ "sinatra", # Lightweight web framework
124
+ "sidekiq", # Background processing
125
+ "capistrano", # Deployment automation
126
+ ],
127
+ environment={
128
+ "RUBYOPT": "-W:deprecated",
129
+ "BUNDLE_JOBS": "4",
130
+ "BUNDLE_RETRY": "3",
131
+ }
132
+ )
133
+
134
+ # JavaScript/Node palette - Brendan Eich / Ryan Dahl style
135
+ javascript_palette = ToolPalette(
136
+ name="javascript",
137
+ description="JavaScript/Node.js development tools by Brendan Eich / Ryan Dahl",
138
+ author="Brendan Eich / Ryan Dahl",
139
+ tools=[
140
+ # Core tools
141
+ "bash", "read", "write", "edit", "grep", "tree", "find",
142
+ # JavaScript specific
143
+ "npx", "process",
144
+ # Package managers
145
+ "npm", "yarn", "pnpm", "bun",
146
+ # Core tooling via npx
147
+ "node", # Node.js runtime
148
+ "prettier", # Code formatting
149
+ "eslint", # Linting and static analysis
150
+ "typescript", # TypeScript compiler
151
+ "jest", # Testing framework
152
+ "vitest", # Fast testing with Vite
153
+ "playwright", # End-to-end testing
154
+ # Build tools
155
+ "webpack", # Module bundler
156
+ "vite", # Fast dev server and bundler
157
+ "rollup", # Module bundler
158
+ "esbuild", # Fast bundler
159
+ # Frameworks and scaffolding
160
+ "create-react-app", # React scaffolding
161
+ "create-next-app", # Next.js scaffolding
162
+ "nuxt", # Vue.js framework
163
+ "svelte", # Component framework
164
+ ],
165
+ environment={
166
+ "NODE_ENV": "development",
167
+ "NPM_CONFIG_PROGRESS": "false",
168
+ "FORCE_COLOR": "1",
169
+ }
170
+ )
171
+
172
+ # Go palette - Rob Pike / Ken Thompson style
173
+ go_palette = ToolPalette(
174
+ name="go",
175
+ description="Go development tools emphasizing simplicity by Rob Pike / Ken Thompson",
176
+ author="Rob Pike / Ken Thompson",
177
+ tools=[
178
+ # Core tools
179
+ "bash", "read", "write", "edit", "grep", "tree", "find",
180
+ # Go specific
181
+ "process",
182
+ # Go tooling - emphasizing simplicity
183
+ "go", # Compiler and standard tools (go build, go test, go mod)
184
+ "gofmt", # Code formatting
185
+ "goimports", # Import management
186
+ "golangci-lint", # Modern linting (replaces golint)
187
+ "godoc", # Documentation
188
+ "delve", # Debugger (dlv)
189
+ "go-outline", # Code outline
190
+ "guru", # Code analysis
191
+ "goreleaser", # Release automation
192
+ ],
193
+ environment={
194
+ "GO111MODULE": "on",
195
+ "GOPROXY": "https://proxy.golang.org,direct",
196
+ "GOSUMDB": "sum.golang.org",
197
+ "CGO_ENABLED": "0", # Rob Pike prefers pure Go when possible
198
+ }
199
+ )
200
+
201
+ # Rust palette - Graydon Hoare style
202
+ rust_palette = ToolPalette(
203
+ name="rust",
204
+ description="Rust development tools for systems programming by Graydon Hoare",
205
+ author="Graydon Hoare",
206
+ tools=[
207
+ # Core tools
208
+ "bash", "read", "write", "edit", "grep", "tree", "find",
209
+ # Rust specific
210
+ "process",
211
+ # Rust tooling - all via cargo/rustup
212
+ "cargo", # Build system and package manager
213
+ "rustfmt", # Code formatting (cargo fmt)
214
+ "clippy", # Linting (cargo clippy)
215
+ "rustdoc", # Documentation (cargo doc)
216
+ "rust-analyzer", # Language server
217
+ "miri", # Interpreter for unsafe code checking
218
+ "rustup", # Rust toolchain manager
219
+ "sccache", # Shared compilation cache
220
+ "wasm-pack", # WebAssembly workflow
221
+ ],
222
+ environment={
223
+ "RUST_BACKTRACE": "1",
224
+ "RUSTFLAGS": "-D warnings",
225
+ "CARGO_INCREMENTAL": "1",
226
+ }
227
+ )
228
+
229
+ # DevOps palette - Infrastructure and operations
230
+ devops_palette = ToolPalette(
231
+ name="devops",
232
+ description="DevOps and infrastructure tools",
233
+ tools=[
234
+ # Core tools
235
+ "bash", "read", "write", "edit", "grep", "tree", "find",
236
+ "process", "open",
237
+ # DevOps tooling
238
+ "docker", # Containerization
239
+ "kubectl", # Kubernetes
240
+ "terraform", # Infrastructure as code
241
+ "ansible", # Configuration management
242
+ "helm", # Kubernetes package manager
243
+ "prometheus", # Monitoring
244
+ "grafana", # Visualization
245
+ ],
246
+ environment={
247
+ "DOCKER_BUILDKIT": "1",
248
+ }
249
+ )
250
+
251
+ # Full stack palette - Everything enabled
252
+ fullstack_palette = ToolPalette(
253
+ name="fullstack",
254
+ description="All development tools enabled",
255
+ tools=[
256
+ # All filesystem tools
257
+ "read", "write", "edit", "multi_edit", "grep", "tree", "find",
258
+ "symbols", "git_search", "watch",
259
+ # All shell tools
260
+ "bash", "npx", "uvx", "process", "open",
261
+ # All other tools
262
+ "agent", "thinking", "llm", "mcp", "sql", "graph", "config",
263
+ "todo", "jupyter", "vim",
264
+ ]
265
+ )
266
+
267
+ # Minimal palette - Just the essentials
268
+ minimal_palette = ToolPalette(
269
+ name="minimal",
270
+ description="Minimal set of essential tools",
271
+ tools=[
272
+ "read", "write", "edit", "bash", "grep", "tree"
273
+ ]
274
+ )
275
+
276
+ # C/C++ palette - Dennis Ritchie / Bjarne Stroustrup style
277
+ cpp_palette = ToolPalette(
278
+ name="cpp",
279
+ description="C/C++ development tools for systems programming by Dennis Ritchie / Bjarne Stroustrup",
280
+ author="Dennis Ritchie / Bjarne Stroustrup",
281
+ tools=[
282
+ # Core tools
283
+ "bash", "read", "write", "edit", "grep", "tree", "find",
284
+ # C/C++ specific
285
+ "process",
286
+ # Compilers and build systems
287
+ "gcc", "clang", "g++", "clang++",
288
+ "make", "cmake", "ninja",
289
+ # Debugging and analysis
290
+ "gdb", "lldb", "valgrind",
291
+ "clang-format", "clang-tidy",
292
+ # Package management
293
+ "conan", "vcpkg",
294
+ # Documentation
295
+ "doxygen",
296
+ ],
297
+ environment={
298
+ "CC": "clang",
299
+ "CXX": "clang++",
300
+ "CFLAGS": "-Wall -Wextra",
301
+ "CXXFLAGS": "-Wall -Wextra -std=c++20",
302
+ }
303
+ )
304
+
305
+ # Data Science palette - Scientific computing
306
+ datascience_palette = ToolPalette(
307
+ name="datascience",
308
+ description="Data science and machine learning tools",
309
+ author="Scientific Computing Community",
310
+ tools=[
311
+ # Core tools
312
+ "bash", "read", "write", "edit", "grep", "tree", "find",
313
+ # Python for data science
314
+ "uvx", "process", "jupyter",
315
+ # Data science tooling via uvx/pip
316
+ "pandas", "numpy", "scipy", "matplotlib", "seaborn",
317
+ "scikit-learn", "tensorflow", "pytorch",
318
+ "plotly", "bokeh", "streamlit",
319
+ "dvc", "mlflow", "wandb",
320
+ "black", "isort", "mypy",
321
+ ],
322
+ environment={
323
+ "PYTHONDONTWRITEBYTECODE": "1",
324
+ "PYTHONUNBUFFERED": "1",
325
+ "JUPYTER_ENABLE_LAB": "yes",
326
+ }
327
+ )
328
+
329
+ # Register all pre-defined palettes
330
+ def register_default_palettes():
331
+ """Register all default tool palettes."""
332
+ for palette in [
333
+ python_palette,
334
+ ruby_palette,
335
+ javascript_palette,
336
+ go_palette,
337
+ rust_palette,
338
+ cpp_palette,
339
+ datascience_palette,
340
+ devops_palette,
341
+ fullstack_palette,
342
+ minimal_palette,
343
+ ]:
344
+ PaletteRegistry.register(palette)
@@ -0,0 +1,108 @@
1
+ """Tool palette loader for dynamic tool configuration."""
2
+
3
+ import os
4
+ from typing import Dict, List, Optional, Set
5
+
6
+ from hanzo_mcp.tools.common.palette import PaletteRegistry, register_default_palettes
7
+
8
+
9
+ class PaletteLoader:
10
+ """Loads and manages tool palettes for dynamic configuration."""
11
+
12
+ @staticmethod
13
+ def initialize_palettes() -> None:
14
+ """Initialize the palette system with defaults."""
15
+ register_default_palettes()
16
+
17
+ # Check for environment variable to set default palette
18
+ default_palette = os.environ.get("HANZO_MCP_PALETTE", "python")
19
+ if PaletteRegistry.get(default_palette):
20
+ PaletteRegistry.set_active(default_palette)
21
+
22
+ @staticmethod
23
+ def get_enabled_tools_from_palette(
24
+ base_enabled_tools: Optional[Dict[str, bool]] = None,
25
+ force_palette: Optional[str] = None
26
+ ) -> Dict[str, bool]:
27
+ """Get enabled tools configuration from active palette.
28
+
29
+ Args:
30
+ base_enabled_tools: Base configuration to merge with
31
+ force_palette: Force a specific palette (overrides active)
32
+
33
+ Returns:
34
+ Dictionary of tool enable states
35
+ """
36
+ # Initialize if needed
37
+ if not PaletteRegistry.list():
38
+ PaletteLoader.initialize_palettes()
39
+
40
+ # Get palette to use
41
+ if force_palette:
42
+ PaletteRegistry.set_active(force_palette)
43
+
44
+ palette = PaletteRegistry.get_active()
45
+ if not palette:
46
+ # No active palette, return base config
47
+ return base_enabled_tools or {}
48
+
49
+ # Start with base configuration
50
+ result = base_enabled_tools.copy() if base_enabled_tools else {}
51
+
52
+ # Get all possible tools (this is a superset for safety)
53
+ all_possible_tools = {
54
+ # Filesystem tools
55
+ "read", "write", "edit", "multi_edit", "grep", "tree", "find",
56
+ "symbols", "git_search", "content_replace", "batch_search",
57
+ "find_files", "unified_search", "watch",
58
+ # Shell tools
59
+ "bash", "npx", "uvx", "process", "open",
60
+ # Database tools
61
+ "sql", "graph",
62
+ # Config tools
63
+ "config", "palette",
64
+ # LLM tools
65
+ "llm", "agent", "thinking",
66
+ # MCP tools
67
+ "mcp",
68
+ # Todo tools
69
+ "todo",
70
+ # Jupyter tools
71
+ "jupyter",
72
+ # Editor tools
73
+ "vim",
74
+ # Stats/system tools
75
+ "stats", "tool_enable", "tool_disable", "tool_list",
76
+ }
77
+
78
+ # Disable all tools first (clean slate for palette)
79
+ for tool in all_possible_tools:
80
+ result[tool] = False
81
+
82
+ # Enable tools from palette
83
+ for tool in palette.tools:
84
+ result[tool] = True
85
+
86
+ # Always enable palette tool itself (meta)
87
+ result["palette"] = True
88
+
89
+ return result
90
+
91
+ @staticmethod
92
+ def get_environment_from_palette() -> Dict[str, str]:
93
+ """Get environment variables from active palette.
94
+
95
+ Returns:
96
+ Dictionary of environment variables
97
+ """
98
+ palette = PaletteRegistry.get_active()
99
+ if palette and palette.environment:
100
+ return palette.environment.copy()
101
+ return {}
102
+
103
+ @staticmethod
104
+ def apply_palette_environment() -> None:
105
+ """Apply environment variables from active palette to process."""
106
+ env_vars = PaletteLoader.get_environment_from_palette()
107
+ for key, value in env_vars.items():
108
+ os.environ[key] = value
@@ -7,7 +7,7 @@ from typing import TypedDict, Unpack, final, override
7
7
  from datetime import datetime
8
8
  from pathlib import Path
9
9
 
10
- from fastmcp import Context as MCPContext
10
+ from mcp.server.fastmcp import Context as MCPContext
11
11
 
12
12
  from hanzo_mcp.tools.common.base import BaseTool
13
13
  from hanzo_mcp.tools.common.context import create_tool_context
@@ -5,9 +5,8 @@ This module provides the ThinkingTool for Claude to engage in structured thinkin
5
5
 
6
6
  from typing import Annotated, TypedDict, Unpack, final, override
7
7
 
8
- from fastmcp import Context as MCPContext
9
- from fastmcp import FastMCP
10
- from fastmcp.server.dependencies import get_context
8
+ from mcp.server.fastmcp import Context as MCPContext
9
+ from mcp.server import FastMCP
11
10
  from pydantic import Field
12
11
 
13
12
  from hanzo_mcp.tools.common.base import BaseTool
@@ -146,8 +145,7 @@ Feature Implementation Planning
146
145
 
147
146
  @mcp_server.tool(name=self.name, description=self.description)
148
147
  async def think(
149
- ctx: MCPContext,
150
148
  thought: Thought,
149
+ ctx: MCPContext
151
150
  ) -> str:
152
- ctx = get_context()
153
151
  return await tool_self.call(ctx, thought=thought)
@@ -2,7 +2,7 @@
2
2
 
3
3
  from typing import Annotated, TypedDict, Unpack, final, override
4
4
 
5
- from fastmcp import Context as MCPContext
5
+ from mcp.server.fastmcp import Context as MCPContext
6
6
  from pydantic import Field
7
7
 
8
8
  from hanzo_mcp.tools.common.base import BaseTool
@@ -4,7 +4,7 @@ import json
4
4
  from typing import Annotated, TypedDict, Unpack, final, override
5
5
  from pathlib import Path
6
6
 
7
- from fastmcp import Context as MCPContext
7
+ from mcp.server.fastmcp import Context as MCPContext
8
8
  from pydantic import Field
9
9
 
10
10
  from hanzo_mcp.tools.common.base import BaseTool
@@ -2,7 +2,7 @@
2
2
 
3
3
  from typing import Annotated, TypedDict, Unpack, final, override, Optional
4
4
 
5
- from fastmcp import Context as MCPContext
5
+ from mcp.server.fastmcp import Context as MCPContext
6
6
  from pydantic import Field
7
7
 
8
8
  from hanzo_mcp.tools.common.base import BaseTool
@@ -54,75 +54,72 @@ class ToolListTool(BaseTool):
54
54
  ("write", "Write contents to files"),
55
55
  ("edit", "Edit specific parts of files"),
56
56
  ("multi_edit", "Make multiple edits to a file"),
57
- ("directory_tree", "Display directory structure"),
58
- ("grep", "Search file contents with patterns"),
59
- ("grep_ast", "Search code with AST patterns"),
57
+ ("tree", "Directory tree visualization (Unix-style)"),
58
+ ("find", "Find text in files (rg/ag/ack/grep)"),
59
+ ("symbols", "Code symbols search with tree-sitter"),
60
+ ("search", "Unified search (parallel grep/symbols/vector/git)"),
60
61
  ("git_search", "Search git history"),
61
- ("batch_search", "Run multiple searches in parallel"),
62
- ("find_files", "Find files by name pattern"),
62
+ ("glob", "Find files by name pattern"),
63
63
  ("content_replace", "Replace content across files"),
64
64
  ],
65
65
  "shell": [
66
- ("run_command", "Execute shell commands"),
67
- ("run_background", "Run commands in background"),
66
+ ("run_command", "Execute shell commands (--background option)"),
68
67
  ("processes", "List background processes"),
69
68
  ("pkill", "Kill background processes"),
70
69
  ("logs", "View process logs"),
71
- ("uvx", "Run Python packages"),
72
- ("uvx_background", "Run Python servers"),
73
- ("npx", "Run Node.js packages"),
74
- ("npx_background", "Run Node.js servers"),
70
+ ("uvx", "Run Python packages (--background option)"),
71
+ ("npx", "Run Node.js packages (--background option)"),
75
72
  ],
76
73
  "database": [
77
- ("sql_query", "Execute SQL queries"),
78
- ("sql_search", "Search in SQLite databases"),
79
- ("sql_stats", "SQLite database statistics"),
80
- ("graph_add", "Add nodes/edges to graph"),
81
- ("graph_remove", "Remove nodes/edges from graph"),
82
- ("graph_query", "Query graph relationships"),
83
- ("graph_search", "Search in graph database"),
84
- ("graph_stats", "Graph database statistics"),
74
+ ("sql", "SQLite operations (query/search/schema/stats)"),
75
+ ("graph", "Graph database (query/add/remove/search/stats)"),
76
+ ("vector", "Semantic search (search/index/stats/clear)"),
85
77
  ],
86
- "vector": [
87
- ("vector_index", "Index files into vector store"),
88
- ("vector_search", "Semantic search in vector store"),
78
+ "ai": [
79
+ ("llm", "LLM interface (query/consensus/list/models/enable/disable)"),
80
+ ("agent", "AI agents (run/start/call/stop/list with A2A support)"),
81
+ ("mcp", "MCP servers (list/add/remove/enable/disable/restart)"),
89
82
  ],
90
- "mcp": [
91
- ("mcp_add", "Add MCP servers"),
92
- ("mcp_remove", "Remove MCP servers"),
93
- ("mcp_stats", "MCP server statistics"),
94
- ],
95
- "system": [
96
- ("stats", "System and resource statistics"),
83
+ "config": [
84
+ ("config", "Git-style configuration (get/set/list/toggle)"),
97
85
  ("tool_enable", "Enable tools"),
98
86
  ("tool_disable", "Disable tools"),
99
87
  ("tool_list", "List all tools (this tool)"),
100
88
  ],
101
- "editor": [
102
- ("neovim_edit", "Open files in Neovim"),
103
- ("neovim_command", "Execute Neovim commands"),
104
- ("neovim_session", "Manage Neovim sessions"),
105
- ],
106
- "llm": [
107
- ("llm", "Query any LLM via LiteLLM"),
108
- ("consensus", "Get consensus from multiple LLMs"),
109
- ("llm_manage", "Manage LLM providers"),
110
- ("openai", "Query OpenAI models"),
111
- ("anthropic", "Query Anthropic Claude models"),
112
- ("gemini", "Query Google Gemini models"),
113
- ("groq", "Query Groq fast models"),
114
- ("mistral", "Query Mistral models"),
115
- ("perplexity", "Query Perplexity with search"),
116
- ],
117
- "other": [
89
+ "productivity": [
90
+ ("todo", "Todo management (list/add/update/remove/clear)"),
91
+ ("jupyter", "Jupyter notebooks (read/edit/create/delete/execute)"),
118
92
  ("think", "Structured thinking space"),
119
- ("dispatch_agent", "Delegate tasks to sub-agents"),
120
- ("todo_read", "Read todo list"),
121
- ("todo_write", "Write todo list"),
122
- ("notebook_read", "Read Jupyter notebooks"),
123
- ("notebook_edit", "Edit Jupyter notebooks"),
93
+ ],
94
+ "system": [
95
+ ("stats", "System and resource statistics"),
124
96
  ("batch", "Run multiple tools in parallel"),
125
97
  ],
98
+ "legacy": [
99
+ ("directory_tree", "Legacy: Use 'tree' instead"),
100
+ ("grep", "Legacy: Use 'find' instead"),
101
+ ("grep_ast", "Legacy: Use 'symbols' instead"),
102
+ ("batch_search", "Legacy: Use 'search' instead"),
103
+ ("find_files", "Legacy: Use 'glob' instead"),
104
+ ("run_background", "Legacy: Use 'run_command --background'"),
105
+ ("uvx_background", "Legacy: Use 'uvx --background'"),
106
+ ("npx_background", "Legacy: Use 'npx --background'"),
107
+ ("sql_query", "Legacy: Use 'sql' instead"),
108
+ ("sql_search", "Legacy: Use 'sql --action search'"),
109
+ ("sql_stats", "Legacy: Use 'sql --action stats'"),
110
+ ("graph_add", "Legacy: Use 'graph --action add'"),
111
+ ("graph_remove", "Legacy: Use 'graph --action remove'"),
112
+ ("graph_query", "Legacy: Use 'graph' instead"),
113
+ ("graph_search", "Legacy: Use 'graph --action search'"),
114
+ ("graph_stats", "Legacy: Use 'graph --action stats'"),
115
+ ("vector_index", "Legacy: Use 'vector --action index'"),
116
+ ("vector_search", "Legacy: Use 'vector' instead"),
117
+ ("dispatch_agent", "Legacy: Use 'agent' instead"),
118
+ ("todo_read", "Legacy: Use 'todo' instead"),
119
+ ("todo_write", "Legacy: Use 'todo --action add/update'"),
120
+ ("notebook_read", "Legacy: Use 'jupyter' instead"),
121
+ ("notebook_edit", "Legacy: Use 'jupyter --action edit'"),
122
+ ],
126
123
  }
127
124
 
128
125
  def __init__(self):
@@ -0,0 +1,10 @@
1
+ """Configuration tools for Hanzo MCP."""
2
+
3
+ from hanzo_mcp.tools.config.config_tool import ConfigTool
4
+ from hanzo_mcp.tools.config.index_config import IndexConfig, IndexScope
5
+
6
+ __all__ = [
7
+ "ConfigTool",
8
+ "IndexConfig",
9
+ "IndexScope",
10
+ ]