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 8 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 |
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-1.10.0 #12919 +/- ##
===================================================
+ Coverage 41.71% 53.17% +11.45%
===================================================
Files 1909 2068 +159
Lines 175706 188686 +12980
Branches 10132 29433 +19301
===================================================
+ Hits 73297 100332 +27035
+ Misses 101298 87238 -14060
- Partials 1111 1116 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Build successful! ✅ |
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