Mobb Vulnerabilities Fixer
Overview
Use Mobb MCP scan-and-fix behavior to identify security issues in a local repo and apply the generated patches. Follow the MCP workflow exactly, including file selection, pagination, and rescan rules.
Workflows
Scan and Fix (default)
- 1. Confirm target repository path.
Use an absolute path to the repository root. Reject paths with traversal patterns. If the user gives
. and a workspace root is known, use it.
- 2. Ensure Mobb authentication is available.
Prefer
API_KEY in the environment. If missing or invalid, inform the user a browser window will open for Mobb login and authorization, then proceed once authenticated. If the user has no account, instruct them to create one and generate an API key. See
references/mobb-auth.md.
- 3. Require MCP to be already running.
Do not install or launch MCP yourself. Ask the user to start the Mobb MCP server on their machine using their approved process and confirm it is running before you proceed.
- 4. Execute MCP scan-and-fix.
Invoke the MCP tool
scan_and_fix_vulnerabilities with the repository path. Use optional parameters only when the user explicitly asks.
Required parameter:
- -
path: absolute path to the repository root
Optional parameters:
- -
offset: pagination offset for additional fixes - INLINECODE6 : maximum number of fixes to return (default is 3)
- INLINECODE7 : scan up to N recently changed files (default is 10); setting this triggers a fresh scan
- INLINECODE8 : force a full rescan; only when user explicitly asks
- INLINECODE9 : when true and no git changes are found, scan recently changed files from history
- 5. Apply returned fixes only with explicit user consent.
If the tool returns patches, summarize what will change and ask the user to confirm before applying. Apply patches exactly as provided, modify nothing else, and explain after applying. If a patch cannot be applied, report the exact conflict and continue with others the user approved.
- 6. Never auto-rescan or auto-page.
Do not rescan or fetch additional pages of fixes unless the user explicitly asks. If more fixes are available, inform the user how to request the next page.
Fetch Available Fixes (summary only)
Use when the user wants a summary of available fixes without uploading/scanning or applying patches.
Call fetch_available_fixes with:
- -
path: absolute path to the repo root - INLINECODE12 and
limit: optional pagination - INLINECODE14 : optional list of relative paths to filter fixes
- INLINECODE15 : optional boolean to fetch fixes for all files
INLINECODE16 and fetchFixesFromAnyFile are mutually exclusive. If neither is provided, the tool filters to files with git status changes.
Check for New Available Fixes (monitoring)
Call check_for_new_available_fixes once at the end of a session after edits/tests, or when the user explicitly asks to check for fresh fixes.
Behavior notes:
- - Requires a local git repo with an
origin remote. - If auto-fix is enabled, fixes may be applied automatically; tell the user to review and commit changes.
- It may return "initial scan in progress" or "no fresh fixes" depending on timing.
File Selection Rules (scanandfix_vulnerabilities)
- - If the path is a valid git repo, scan only changed/staged files by default.
- If no changes are found and
scanRecentlyChangedFiles is true (or maxFiles is set), scan recently changed files from git history. - If not a git repo, scan recently changed files in the directory.
- Exclude files larger than 5 MB.
No-Changes Case
If no changed files are detected, explain the situation and offer a follow-up scan using
scanRecentlyChangedFiles and/or
maxFiles, but do not run it unless explicitly requested.
Resources
- -
references/mcp-scan-fix.md: MCP scan-and-fix, fetch, and monitoring tool details - INLINECODE25 : authentication and login flow details
Mobb 漏洞修复工具
概述
使用 Mobb MCP 扫描并修复功能来识别本地仓库中的安全问题,并应用生成的补丁。严格遵循 MCP 工作流程,包括文件选择、分页和重新扫描规则。
工作流程
扫描并修复(默认)
- 1. 确认目标仓库路径。
使用仓库根的绝对路径。拒绝包含路径遍历模式的路径。如果用户输入.且已知工作区根目录,则使用该目录。
- 2. 确保 Mobb 认证可用。
优先使用环境变量中的API_KEY。如果缺失或无效,告知用户将打开浏览器窗口进行 Mobb 登录和授权,认证通过后继续操作。如果用户没有账户,指导其创建账户并生成 API 密钥。参见references/mobb-auth.md。
- 3. 要求 MCP 已在运行中。
不要自行安装或启动 MCP。请用户按照其批准的流程在自己的机器上启动 Mobb MCP 服务器,并在继续操作前确认其正在运行。
- 4. 执行 MCP 扫描并修复。
调用 MCP 工具scan
andfix_vulnerabilities,传入仓库路径。仅当用户明确要求时才使用可选参数。
必需参数:
可选参数:
- - offset:获取额外修复的分页偏移量
- limit:返回的最大修复数量(默认为3)
- maxFiles:扫描最近修改的N个文件(默认为10);设置此参数将触发全新扫描
- rescan:强制完全重新扫描;仅当用户明确要求时
- scanRecentlyChangedFiles:当为true且未发现git变更时,扫描历史中最近修改的文件
- 5. 仅在获得用户明确同意后应用返回的修复。
如果工具返回补丁,总结将要修改的内容并请用户确认后再应用。严格按照提供的补丁应用,不修改其他任何内容,应用后进行说明。如果补丁无法应用,报告具体冲突并继续处理用户已批准的其他补丁。
- 6. 绝不自动重新扫描或自动翻页。
除非用户明确要求,否则不要重新扫描或获取更多页面的修复。如果有更多修复可用,告知用户如何请求下一页。
获取可用修复(仅摘要)
当用户想要获取可用修复的摘要而不上传/扫描或应用补丁时使用。
调用fetchavailablefixes,参数包括:
- - path:仓库根的绝对路径
- offset和limit:可选的分页参数
- fileFilter:可选的相对路径列表,用于过滤修复
- fetchFixesFromAnyFile:可选的布尔值,用于获取所有文件的修复
fileFilter和fetchFixesFromAnyFile互斥。如果两者都未提供,工具将过滤为具有git状态变更的文件。
检查新的可用修复(监控)
在编辑/测试后的会话结束时,或当用户明确要求检查新修复时,调用一次checkfornewavailablefixes。
行为说明:
- - 需要具有origin远程仓库的本地git仓库。
- 如果启用了自动修复,补丁可能会自动应用;告知用户审查并提交变更。
- 根据时机不同,可能返回初始扫描进行中或无新修复。
文件选择规则(scanandfix_vulnerabilities)
- - 如果路径是有效的git仓库,默认仅扫描已变更/暂存的文件。
- 如果未发现变更且scanRecentlyChangedFiles为true(或设置了maxFiles),则扫描git历史中最近修改的文件。
- 如果不是git仓库,则扫描目录中最近修改的文件。
- 排除大于5 MB的文件。
无变更情况
如果未检测到变更文件,解释情况并提供使用scanRecentlyChangedFiles和/或maxFiles进行后续扫描的建议,但除非用户明确要求,否则不执行扫描。
参考资料
- - references/mcp-scan-fix.md:MCP扫描修复、获取和监控工具详情
- references/mobb-auth.md:认证和登录流程详情