luzzy-tool 2.4.0__tar.gz

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.
Files changed (50) hide show
  1. luzzy_tool-2.4.0/.claude/skills/luzzy-tool-usage.md +78 -0
  2. luzzy_tool-2.4.0/.env.example +50 -0
  3. luzzy_tool-2.4.0/CLAUDE.md +14 -0
  4. luzzy_tool-2.4.0/LICENSE +21 -0
  5. luzzy_tool-2.4.0/MANIFEST.in +4 -0
  6. luzzy_tool-2.4.0/PKG-INFO +345 -0
  7. luzzy_tool-2.4.0/README.en.md +299 -0
  8. luzzy_tool-2.4.0/README.md +297 -0
  9. luzzy_tool-2.4.0/luzzy_tool.egg-info/PKG-INFO +345 -0
  10. luzzy_tool-2.4.0/luzzy_tool.egg-info/SOURCES.txt +48 -0
  11. luzzy_tool-2.4.0/luzzy_tool.egg-info/dependency_links.txt +1 -0
  12. luzzy_tool-2.4.0/luzzy_tool.egg-info/entry_points.txt +3 -0
  13. luzzy_tool-2.4.0/luzzy_tool.egg-info/requires.txt +26 -0
  14. luzzy_tool-2.4.0/luzzy_tool.egg-info/top_level.txt +2 -0
  15. luzzy_tool-2.4.0/pyproject.toml +92 -0
  16. luzzy_tool-2.4.0/requirements.txt +34 -0
  17. luzzy_tool-2.4.0/scripts/test_all_tools_boundaries.py +417 -0
  18. luzzy_tool-2.4.0/scripts/test_file_watcher.py +40 -0
  19. luzzy_tool-2.4.0/scripts/test_mcp_capabilities.py +46 -0
  20. luzzy_tool-2.4.0/scripts/test_mcp_startup_time.py +41 -0
  21. luzzy_tool-2.4.0/scripts/test_read_upgrade.py +79 -0
  22. luzzy_tool-2.4.0/server.json +24 -0
  23. luzzy_tool-2.4.0/setup.cfg +4 -0
  24. luzzy_tool-2.4.0/skills/luzzy-tool-usage/SKILL.md +78 -0
  25. luzzy_tool-2.4.0/src/__init__.py +0 -0
  26. luzzy_tool-2.4.0/src/config.py +96 -0
  27. luzzy_tool-2.4.0/src/database/__init__.py +22 -0
  28. luzzy_tool-2.4.0/src/database/chroma_manager.py +462 -0
  29. luzzy_tool-2.4.0/src/modules/__init__.py +27 -0
  30. luzzy_tool-2.4.0/src/modules/archive_manager.py +361 -0
  31. luzzy_tool-2.4.0/src/modules/code_searcher.py +306 -0
  32. luzzy_tool-2.4.0/src/modules/database_manager.py +356 -0
  33. luzzy_tool-2.4.0/src/modules/document_editor.py +504 -0
  34. luzzy_tool-2.4.0/src/modules/enhanced_file_manager.py +542 -0
  35. luzzy_tool-2.4.0/src/modules/enhanced_shell_executor.py +526 -0
  36. luzzy_tool-2.4.0/src/modules/file_manager.py +684 -0
  37. luzzy_tool-2.4.0/src/modules/file_watcher.py +282 -0
  38. luzzy_tool-2.4.0/src/modules/git_manager.py +363 -0
  39. luzzy_tool-2.4.0/src/modules/http_client.py +371 -0
  40. luzzy_tool-2.4.0/src/modules/local_retrieval_engine.py +382 -0
  41. luzzy_tool-2.4.0/src/modules/markdown_renderer.py +420 -0
  42. luzzy_tool-2.4.0/src/modules/network_diagnostics.py +397 -0
  43. luzzy_tool-2.4.0/src/modules/session_manager.py +486 -0
  44. luzzy_tool-2.4.0/src/modules/shell_executor.py +548 -0
  45. luzzy_tool-2.4.0/src/modules/structured_editor.py +381 -0
  46. luzzy_tool-2.4.0/src/modules/unified_file_writer.py +501 -0
  47. luzzy_tool-2.4.0/src/server.py +2545 -0
  48. luzzy_tool-2.4.0/src/utils/__init__.py +47 -0
  49. luzzy_tool-2.4.0/src/utils/path_security.py +421 -0
  50. luzzy_tool-2.4.0/src/utils/text_chunker.py +420 -0
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: luzzy-tool-usage
3
+ description: Guide for using the LuzzyTool MCP server effectively. Use this skill when the user wants to operate files, run shell commands, search code, watch files, manage archives, send HTTP requests, interact with Git/SQLite, diagnose networks, or render Markdown through MCP tools.
4
+ ---
5
+
6
+ # LuzzyTool Usage Skill
7
+
8
+ LuzzyTool is a local-system MCP server that exposes ~70 tools across file
9
+ operations, shell execution, structured editing, retrieval, code search,
10
+ file watching, archives, HTTP, Git, SQLite, network diagnostics, and Markdown
11
+ rendering.
12
+
13
+ ## When to use
14
+
15
+ Trigger this skill whenever the user asks for:
16
+
17
+ - Reading, writing, moving, copying, deleting, or searching local files
18
+ - Running shell commands or batch operations on Windows / macOS / Linux
19
+ - Editing documents by paragraph/heading or JSON/YAML fields
20
+ - Searching local documents or code with keywords / regex
21
+ - Watching directories for file changes
22
+ - Creating or extracting zip/tar archives
23
+ - Sending HTTP requests (GET/POST/PUT/DELETE with auth, JSON, forms, files)
24
+ - Git operations (status, diff, log, add, commit, push, pull, branch, stash,
25
+ remote)
26
+ - SQLite database queries and schema inspection
27
+ - Network ping, DNS, port scan, connectivity checks
28
+ - Markdown to HTML rendering, TOC generation, link extraction/validation
29
+
30
+ ## Core workflow
31
+
32
+ 1. Identify the task category from the list above.
33
+ 2. Prefer the dedicated tool over generic shell commands when one exists (e.g.
34
+ use `read_local_file` instead of `cat`, `git_status` instead of raw `git`).
35
+ 3. For destructive operations (delete, overwrite, restore), call
36
+ `backup_file` first unless the user explicitly waived it.
37
+ 4. Return structured results; if a tool fails, read its `error` field and
38
+ either retry with corrected arguments or fall back to a lower-level tool.
39
+
40
+ ## Tool selection cheatsheet
41
+
42
+ | Task | Recommended tool |
43
+ |------|------------------|
44
+ | Explore directory | `list_local_directory` |
45
+ | Read text file | `read_local_file` |
46
+ | Write/overwrite file | `file_write` |
47
+ | Move/rename file or dir | `move_file` / `rename_file` |
48
+ | Copy file(s) | `copy_file` / `copy_files` |
49
+ | Delete file(s) | `delete_file` / `delete_files` |
50
+ | Search by name/content | `search_files` |
51
+ | Run shell command | `execute_command` / `execute_batch` |
52
+ | Structured shell output | `execute_command_structured` |
53
+ | Edit document paragraph | `get_paragraphs` → `edit_paragraph` |
54
+ | Edit by Markdown heading | `edit_by_heading` |
55
+ | Edit JSON/YAML | `edit_json` / `edit_yaml` |
56
+ | Local keyword search | `retrieve_from_local_files` |
57
+ | Regex code search | `code_search` |
58
+ | Watch files | `watch_start` / `watch_events` / `watch_stop` |
59
+ | Archive | `archive_create` / `archive_extract` / `archive_list` |
60
+ | HTTP | `http_request` |
61
+ | Git | `git_status` / `git_diff` / `git_log` / `git_add` / ... |
62
+ | SQLite | `db_list_tables` / `db_describe_table` / `db_execute_query` |
63
+ | Network | `net_ping` / `net_dns_lookup` / `net_port_scan` |
64
+ | Markdown | `md_render_to_html` / `md_generate_toc` / `md_check_links` |
65
+
66
+ ## Safety reminders
67
+
68
+ - All paths must be absolute. Path traversal (`..`) is rejected.
69
+ - File reads support up to 100 MB. Files over 1 MB are auto-limited to 500
70
+ lines per call (max 5000); files over 100 MB must be read in chunks via
71
+ `offset` / `limit`.
72
+ - Shell commands must be non-interactive. On Windows, set `shell=true` to use
73
+ built-ins like `echo` / `dir`. Always set `timeout` for long tasks.
74
+ - `http_request` blocks private/loopback addresses by default. Set
75
+ `allow_private_network=true` only when targeting `127.0.0.1` / `localhost`.
76
+ - Database write/update tools are separated from read-only query tools.
77
+ - Subprocess-based tools (shell, git, network, code search) use
78
+ `stdin=DEVNULL` to avoid hangs; never pipe interactive input.
@@ -0,0 +1,50 @@
1
+ # LuzzyTool MCP Server 环境配置
2
+
3
+ # 项目根目录(默认为当前工作目录)
4
+ PROJECT_ROOT=.
5
+
6
+ # 服务器配置
7
+ SERVER_HOST=127.0.0.1
8
+ SERVER_PORT=8000
9
+
10
+ # 日志配置
11
+ LOG_LEVEL=INFO
12
+ LOG_FORMAT=json
13
+
14
+ # 安全配置
15
+ ALLOWED_EXTENSIONS=.txt,.md,.py,.js,.ts,.json,.yaml,.yml,.xml,.csv,.log,.html,.css,.sh,.bat,.cfg,.ini,.toml,.rst,.tex,.sql,.java,.c,.cpp,.h,.hpp,.go,.rs,.rb,.php,.swift,.kt
16
+ MAX_FILE_SIZE_MB=100
17
+ MAX_ARCHIVE_SIZE_MB=500
18
+ MAX_SEARCH_RESULTS=1000
19
+
20
+ # Shell 执行配置
21
+ SHELL_TIMEOUT=30
22
+ SHELL_MAX_OUTPUT=1048576
23
+
24
+ # 数据库配置
25
+ MAX_SQL_LENGTH=10000
26
+ MAX_RESULT_ROWS=1000
27
+
28
+ # HTTP 客户端配置
29
+ HTTP_TIMEOUT=30
30
+ HTTP_MAX_RESPONSE_SIZE=10485760
31
+
32
+ # 网络诊断配置
33
+ PING_COUNT=4
34
+ PING_TIMEOUT=10
35
+ DNS_TIMEOUT=10
36
+ TRACEROUTE_MAX_HOPS=30
37
+
38
+ # 文件监听配置
39
+ WATCH_RECURSIVE=true
40
+ WATCH_IGNORE_PATTERNS=.git,__pycache__,node_modules,.venv,*.pyc,*.pyo
41
+
42
+ # 代码搜索配置
43
+ SEARCH_CONTEXT_LINES=3
44
+ SEARCH_MAX_FILE_SIZE_MB=10
45
+
46
+ # 检索引擎配置
47
+ RETRIEVAL_CACHE_MAX_SIZE=100
48
+ RETRIEVAL_CACHE_TTL=3600
49
+ RETRIEVAL_CHUNK_SIZE=500
50
+ RETRIEVAL_CHUNK_OVERLAP=50
@@ -0,0 +1,14 @@
1
+ # LuzzyTool
2
+
3
+ MCP server providing 70+ tools for local system operations — file ops, shell,
4
+ code search, file watching, archives, HTTP, Git, SQLite, network diagnostics,
5
+ and Markdown rendering.
6
+
7
+ ## Skills
8
+
9
+ - [luzzy-tool-usage](.claude/skills/luzzy-tool-usage.md) — LuzzyTool 工具选择与使用指南
10
+
11
+ ## Links
12
+
13
+ - [LobeHub MCP](https://lobehub.com/mcp/LuzzyMeow-luzzy-tool)
14
+ - [GitHub Repository](https://github.com/LuzzyMeow/LuzzyTool)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 LuzzyTool Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include README.md README.en.md LICENSE requirements.txt .env.example server.json CLAUDE.md
2
+ recursive-include skills *.md
3
+ recursive-include .claude *.md
4
+ recursive-include scripts *.py
@@ -0,0 +1,345 @@
1
+ Metadata-Version: 2.4
2
+ Name: luzzy-tool
3
+ Version: 2.4.0
4
+ Summary: 基于MCP协议的本地系统工具集,为AI助手提供文件操作、Shell执行、代码搜索、文件监听、压缩解压、HTTP请求、Git操作、数据库操作、网络诊断、Markdown渲染和结构化数据处理
5
+ Author-email: LuzzyMeow <2170206661@qq.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/LuzzyMeow/LuzzyTool
8
+ Project-URL: Repository, https://github.com/LuzzyMeow/LuzzyTool
9
+ Project-URL: Issues, https://github.com/LuzzyMeow/LuzzyTool/issues
10
+ Project-URL: MCP Server, https://lobehub.com/mcp/LuzzyMeow-luzzy-tool
11
+ Keywords: mcp,mcp-server,tools,file-management,shell,git,database,network,markdown
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Classifier: Topic :: System :: Systems Administration
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: mcp>=1.0.0
24
+ Requires-Dist: chromadb>=0.4.0
25
+ Requires-Dist: pydantic>=2.0.0
26
+ Requires-Dist: pydantic-settings>=2.0.0
27
+ Requires-Dist: python-dotenv>=1.0.0
28
+ Requires-Dist: pyyaml>=6.0
29
+ Requires-Dist: structlog>=23.0.0
30
+ Requires-Dist: tqdm>=4.65.0
31
+ Requires-Dist: click>=8.1.0
32
+ Requires-Dist: typing-extensions>=4.5.0
33
+ Requires-Dist: watchdog>=3.0.0
34
+ Requires-Dist: markdown>=3.4.0
35
+ Requires-Dist: httpx>=0.25.0
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
38
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
39
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
40
+ Requires-Dist: black>=23.0.0; extra == "dev"
41
+ Requires-Dist: isort>=5.12.0; extra == "dev"
42
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
43
+ Provides-Extra: export
44
+ Requires-Dist: python-docx>=0.8.11; extra == "export"
45
+ Requires-Dist: ebooklib>=0.18; extra == "export"
46
+ Requires-Dist: markdown>=3.4.0; extra == "export"
47
+ Dynamic: license-file
48
+
49
+ # LuzzyTool
50
+
51
+ <div align="center">
52
+
53
+ [![MCP Badge](https://lobehub.com/badge/mcp/LuzzyMeow-luzzy-tool)](https://lobehub.com/mcp/LuzzyMeow-luzzy-tool)
54
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
56
+ [![MCP](https://img.shields.io/badge/MCP-1.0+-purple.svg)](https://modelcontextprotocol.io)
57
+ [![Tools](https://img.shields.io/badge/tools-70-orange.svg)](#工具概览)
58
+ [![Skills](https://img.shields.io/badge/skills-1-blue.svg)](#技能)
59
+
60
+ </div>
61
+
62
+ > [English version](README.en.md) also available · 也提供[英文版](README.en.md)
63
+
64
+ 基于 [MCP (Model Context Protocol)](https://modelcontextprotocol.io) 的本地系统工具集,为 AI 助手提供 **70+ 工具**,涵盖文件操作、Shell 执行、代码搜索、文件监听、压缩解压、HTTP 请求、Git 操作、SQLite 数据库、网络诊断和 Markdown 渲染。
65
+
66
+ ## 环境要求
67
+
68
+ - Python 3.10+
69
+ - Windows、macOS 或 Linux
70
+
71
+ ## 快速开始
72
+
73
+ ```bash
74
+ git clone https://github.com/LuzzyMeow/LuzzyTool.git
75
+ cd LuzzyTool
76
+ pip install -e .
77
+ ```
78
+
79
+ ## 接入 MCP 客户端
80
+
81
+ 将以下配置添加到你的 MCP 客户端。**必须使用绝对路径**,将示例路径替换为你的实际项目路径。
82
+
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "luzzy-tool": {
87
+ "command": "/home/user/LuzzyTool/venv/bin/python",
88
+ "args": ["-m", "src.server"],
89
+ "env": {
90
+ "LUZZY_TOOL_HOME": "/home/user/LuzzyTool"
91
+ }
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ Windows 用户(例如克隆到 `D:\\Projects\\`):
98
+
99
+ ```json
100
+ {
101
+ "mcpServers": {
102
+ "luzzy-tool": {
103
+ "command": "D:\\Projects\\LuzzyTool\\venv\\Scripts\\python.exe",
104
+ "args": ["-m", "src.server"],
105
+ "env": {
106
+ "LUZZY_TOOL_HOME": "D:\\Projects\\LuzzyTool"
107
+ }
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ > 将路径替换为你的实际项目位置。`command` 必须指向 venv 中的 `python`(Windows 为 `python.exe`),
114
+ > `LUZZY_TOOL_HOME` 指向项目根目录。
115
+
116
+ ### Claude Desktop
117
+
118
+ 参考 [MCP 安装指南](https://modelcontextprotocol.io/quickstart/user),使用上述配置。
119
+
120
+ ### VS Code / Cursor / Windsurf
121
+
122
+ 将上述配置添加到 MCP 设置中。
123
+
124
+ ## 配置
125
+
126
+ 在项目根目录创建 `.env` 文件(参考 `.env.example`):
127
+
128
+ ```ini
129
+ LOG_LEVEL=INFO # DEBUG | INFO | WARNING | ERROR
130
+ CHUNK_SIZE=500 # 检索文本分块大小
131
+ CHUNK_OVERLAP=100 # 分块重叠量
132
+ DEFAULT_TOP_K=5 # 默认返回结果数
133
+ ```
134
+
135
+ 也可通过 MCP 客户端 `env` 字段注入环境变量。
136
+
137
+ ## 工具概览
138
+
139
+ LuzzyTool 提供 **70 个 MCP 工具**,涵盖 14 个类别。工具名使用英文标识以保证跨客户端兼容性。
140
+
141
+ | 类别 | 工具 |
142
+ |------|------|
143
+ | **文件操作** | `list_local_directory`, `read_local_file`, `file_write`, `create_directory`, `move_file`, `copy_file`, `delete_file`, `search_files`, `get_file_info`, `rename_file`, `delete_files`, `copy_files`, `backup_file`, `restore_file`, `list_backups` |
144
+ | **Shell 执行** | `execute_command`, `execute_batch`, `execute_command_structured`, `get_system_info`, `set_env`, `get_env`, `get_command_history`, `clear_command_history`, `spawn_process`, `list_processes`, `kill_process` |
145
+ | **文档编辑** | `get_paragraphs`, `edit_paragraph`, `edit_by_heading` |
146
+ | **结构化编辑** | `edit_json`, `edit_yaml`, `validate_json`, `validate_yaml` |
147
+ | **检索** | `retrieve_from_local_files`, `clear_retrieval_cache` |
148
+ | **代码搜索** | `code_search` |
149
+ | **文件监听** | `watch_start`, `watch_stop`, `watch_list`, `watch_events` |
150
+ | **压缩解压** | `archive_create`, `archive_extract`, `archive_list`, `archive_test` |
151
+ | **HTTP** | `http_request` |
152
+ | **Git** | `git_status`, `git_diff`, `git_log`, `git_add`, `git_commit`, `git_push`, `git_pull`, `git_branch`, `git_stash`, `git_remote` |
153
+ | **数据库** | `db_list_tables`, `db_describe_table`, `db_execute_query`, `db_execute_update`, `db_get_table_data` |
154
+ | **网络诊断** | `net_ping`, `net_dns_lookup`, `net_port_scan`, `net_check_connectivity`, `net_reverse_dns` |
155
+ | **Markdown** | `md_render_to_html`, `md_generate_toc`, `md_extract_links`, `md_check_links` |
156
+ | **元工具** | `list_tools` |
157
+
158
+ <details>
159
+ <summary>📁 文件操作(15 个工具)</summary>
160
+
161
+ | 工具 | 说明 |
162
+ |------|------|
163
+ | `list_local_directory` | 列出目录内容,支持递归 |
164
+ | `read_local_file` | 读取文本文件(自动检测编码,最大 100MB) |
165
+ | `file_write` | 写入/覆盖文件 |
166
+ | `create_directory` | 创建目录(含父目录) |
167
+ | `move_file` | 移动文件或目录 |
168
+ | `copy_file` | 复制文件 |
169
+ | `delete_file` | 删除文件 |
170
+ | `search_files` | 按文件名模式或内容正则搜索 |
171
+ | `get_file_info` | 获取文件大小、修改时间、权限、编码 |
172
+ | `rename_file` | 重命名文件或目录 |
173
+ | `delete_files` | 批量删除(数组接口) |
174
+ | `copy_files` | 批量复制,可保持目录结构 |
175
+ | `backup_file` | 创建文件备份 |
176
+ | `restore_file` | 从备份恢复文件 |
177
+ | `list_backups` | 列出所有备份 |
178
+
179
+ </details>
180
+
181
+ <details>
182
+ <summary>💻 Shell 执行(11 个工具)</summary>
183
+
184
+ | 工具 | 说明 |
185
+ |------|------|
186
+ | `execute_command` | 执行单条命令,支持超时、工作目录、系统 Shell 模式 |
187
+ | `execute_batch` | 批量执行命令,可配置遇错停止 |
188
+ | `execute_command_structured` | 执行命令并自动解析输出 |
189
+ | `get_system_info` | 获取系统信息(OS、CPU、内存、磁盘) |
190
+ | `set_env` | 设置会话级环境变量 |
191
+ | `get_env` | 获取环境变量 |
192
+ | `get_command_history` | 查询命令执行历史 |
193
+ | `clear_command_history` | 清空命令历史 |
194
+ | `spawn_process` | 启动后台进程 |
195
+ | `list_processes` | 列出所有后台进程 |
196
+ | `kill_process` | 终止后台进程 |
197
+
198
+ </details>
199
+
200
+ <details>
201
+ <summary>🔀 Git 操作(10 个工具)</summary>
202
+
203
+ | 工具 | 说明 |
204
+ |------|------|
205
+ | `git_status` | 仓库状态(分支、暂存、未跟踪) |
206
+ | `git_diff` | 查看差异(暂存区/工作区/文件级统计) |
207
+ | `git_log` | 提交日志(结构化输出) |
208
+ | `git_add` | 暂存文件 |
209
+ | `git_commit` | 提交更改 |
210
+ | `git_push` | 推送远程(受保护分支防护) |
211
+ | `git_pull` | 拉取更新(支持 rebase) |
212
+ | `git_branch` | 分支管理(list/create/delete/rename) |
213
+ | `git_stash` | Stash 管理(list/save/pop/apply/drop/clear) |
214
+ | `git_remote` | 远程仓库管理(list/add/remove/get-url) |
215
+
216
+ </details>
217
+
218
+ <details>
219
+ <summary>🗄️ 数据库 — SQLite(5 个工具)</summary>
220
+
221
+ | 工具 | 说明 |
222
+ |------|------|
223
+ | `db_list_tables` | 列出所有表及行数 |
224
+ | `db_describe_table` | 查看表结构(列、索引、主键、DDL) |
225
+ | `db_execute_query` | 只读查询(SELECT/PRAGMA/EXPLAIN),参数化 |
226
+ | `db_execute_update` | 写入操作(INSERT/UPDATE/DELETE/CREATE/ALTER/DROP) |
227
+ | `db_get_table_data` | 分页获取表数据,支持 WHERE/ORDER BY |
228
+
229
+ </details>
230
+
231
+ <details>
232
+ <summary>🌐 网络诊断(5 个工具)</summary>
233
+
234
+ | 工具 | 说明 |
235
+ |------|------|
236
+ | `net_ping` | Ping 检测(跨平台,延迟/丢包统计) |
237
+ | `net_dns_lookup` | DNS 查询(A/AAAA/CNAME/MX/NS/TXT/SOA/SRV) |
238
+ | `net_port_scan` | TCP 端口扫描(最多 100 端口,服务名识别) |
239
+ | `net_check_connectivity` | TCP 连通性检测(可达性 + 延迟) |
240
+ | `net_reverse_dns` | 反向 DNS 查询(IP → 域名) |
241
+
242
+ </details>
243
+
244
+ <details>
245
+ <summary>📝 Markdown(4 个工具)</summary>
246
+
247
+ | 工具 | 说明 |
248
+ |------|------|
249
+ | `md_render_to_html` | Markdown → HTML(支持表格、代码块、脚注等扩展) |
250
+ | `md_generate_toc` | 生成目录(标题列表 + HTML) |
251
+ | `md_extract_links` | 提取链接和图片 |
252
+ | `md_check_links` | 检查链接有效性(本地 + 可选 HTTP) |
253
+
254
+ </details>
255
+
256
+ <details>
257
+ <summary>📦 其他类别</summary>
258
+
259
+ **压缩解压(4):** `archive_create`, `archive_extract`, `archive_list`, `archive_test`
260
+
261
+ **文件监听(4):** `watch_start`, `watch_stop`, `watch_list`, `watch_events`
262
+
263
+ **文档编辑(3):** `get_paragraphs`, `edit_paragraph`, `edit_by_heading`
264
+
265
+ **结构化编辑(4):** `edit_json`, `edit_yaml`, `validate_json`, `validate_yaml`
266
+
267
+ **检索(2):** `retrieve_from_local_files`, `clear_retrieval_cache`
268
+
269
+ **代码搜索(1):** `code_search`
270
+
271
+ **HTTP(1):** `http_request`
272
+
273
+ </details>
274
+
275
+ ## 提示词 (Prompts)
276
+
277
+ 4 个内置提示词模板:
278
+
279
+ | 提示词 | 参数 | 说明 |
280
+ |--------|------|------|
281
+ | `代码审查` | `file_path`(必填), `language`(可选) | 代码审查——bug、安全、风格、性能 |
282
+ | `项目概览` | `project_dir`(必填) | 项目结构概览和技术栈分析 |
283
+ | `Git 提交信息` | `repo_path`(必填) | 根据暂存区变更生成 Conventional Commits 提交信息 |
284
+ | `文件分析` | `file_path`(必填), `focus`(可选) | 深度分析文件内容,给出建议 |
285
+
286
+ ## 资源 (Resources)
287
+
288
+ 3 个资源端点:
289
+
290
+ | URI | 名称 | 类型 |
291
+ |-----|------|------|
292
+ | `project://readme` | 项目 README | text/markdown |
293
+ | `project://tools` | 工具列表 (JSON) | application/json |
294
+ | `project://config` | 项目配置 (pyproject.toml) | text/plain |
295
+
296
+ ## 技能 (Skills)
297
+
298
+ LuzzyTool 遵循 [Anthropic Skills 规范](https://docs.anthropic.com/en/docs/claude/skills)。
299
+ 技能文件位于 [`.claude/skills/`](.claude/skills/):
300
+
301
+ | 技能 | 文件 | 说明 |
302
+ |------|------|------|
303
+ | `luzzy-tool-usage` | [`.claude/skills/luzzy-tool-usage.md`](.claude/skills/luzzy-tool-usage.md) | LuzzyTool 工具选择与使用指南 |
304
+
305
+ ## 安全特性
306
+
307
+ - **路径穿越防护**:拒绝 `../` 越权访问
308
+ - **文件读取限制**:最大 100MB;超过 1MB 自动限制 500 行/次
309
+ - **参数校验**:单参数 10MB,总计 50MB
310
+ - **压缩解压防护**:Zip-slip 路径穿越检测
311
+ - **Git 保护分支**:master/main force push 拦截
312
+ - **HTTP 安全**:默认禁止内网/回环地址;响应体限制 10MB
313
+ - **数据库隔离**:读写工具分离;查询使用 `?mode=ro`;参数化 SQL
314
+ - **Shell 安全**:子进程使用 `stdin=DEVNULL` 防挂起
315
+
316
+ 详见 [SECURITY.md](SECURITY.md)。
317
+
318
+ ## 项目结构
319
+
320
+ ```
321
+ LuzzyTool/
322
+ ├── src/
323
+ │ ├── server.py # MCP 入口,工具注册与调度
324
+ │ ├── config.py # 全局配置
325
+ │ ├── modules/ # ~15 个工具模块
326
+ │ ├── utils/path_security.py # 路径安全校验
327
+ │ └── database/chroma_manager.py # Chroma 向量数据库
328
+ ├── .claude/skills/ # Claude 技能定义
329
+ ├── skills/ # Anthropic Skills 格式
330
+ ├── scripts/ # 测试与调试脚本
331
+ ├── tests/
332
+ ├── pyproject.toml
333
+ ├── server.json # MCP Registry 元数据
334
+ ├── CLAUDE.md
335
+ ├── README.md # 中文说明(本文件)
336
+ ├── README.en.md # English version
337
+ ├── SECURITY.md
338
+ ├── CONTRIBUTING.md
339
+ ├── CHANGELOG.md
340
+ └── LICENSE
341
+ ```
342
+
343
+ ## 许可证
344
+
345
+ MIT — 详见 [LICENSE](LICENSE)。