feat: add Shell Command MCP server with multi-stage validation#12919
feat: add Shell Command MCP server with multi-stage validation#12919Cristhianzl wants to merge 4 commits intorelease-1.10.0from
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Build successful! ✅ |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-1.10.0 #12919 +/- ##
==================================================
- Coverage 53.72% 53.71% -0.01%
==================================================
Files 2035 2059 +24
Lines 184926 187153 +2227
Branches 27922 27663 -259
==================================================
+ Hits 99350 100532 +1182
- Misses 84475 85508 +1033
- Partials 1101 1113 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
OBJECTIVE: Add a standalone MCP server that exposes a single
execute_commandtool, gated by a 5-stage validation pipeline (length cap, substitution refusal, subcommand split, per-subcommand destructive/classify/redirect/mode/path checks) so Langflow agents can run shell commands inside a sandboxed working directory on Linux, macOS, and Windows.CHANGES:
lfx.mcp.shellpackage (13 modules) with FastMCP server, validation pipeline, async subprocess executor, and config dataclasssetsid+killpg(SIGKILL)and UTF-8 decode; Windows usesCREATE_NEW_PROCESS_GROUP+taskkill /T /Fandlocale.getpreferredencoding()(fixes mojibake in cmd.exe output)RejectionReasonenum:destructive_pattern,mode_violation,path_traversal,unknown_classification,input_too_large,shell_substitution_not_allowed$(...)/backticks, write redirects in read_only mode, glob/brace expansion in destructive paths, PowerShellInvoke-Expressionevallfx-shell-mcp(registers viapython -m lfx.mcp.shelldue to Langflow MCP allowlist) pluspyproject.tomlconsole scriptsubprocess executor, and end-to-end pipeline
docs/features/shell-mcp-server.md(DDD-style with C4 diagrams) and QA guideCZL/QA_GUIDE_SHELL_MCP.mdwith 60+ test scenarios