Back to Home
kdspaul icon

command-runner-mcp-server

Verified Safe

by kdspaul

Overview

Provides a sandboxed command execution environment for AI coding assistants, enabling controlled directory listing and Git operations with robust output transformations and security features.

Installation

Run Command
npx @modelcontextprotocol/inspector ./target/debug/command-runner-mcp-server-rust

Environment Variables

  • BLOCKED_PATHS

Security Notes

The server implements comprehensive security measures to prevent common command execution vulnerabilities. This includes robust shell injection prevention (blocking a wide range of dangerous characters in arguments and environment variables), path traversal prevention ('..' blocked), configurable path blocking (via BLOCKED_PATHS environment variable with symlink resolution), flag injection prevention, restrictions on dangerous environment variables (e.g., LD_PRELOAD, PATH), and explicit whitelisting of allowed Git subcommands. Output transformations (grep, sort, head, tail, unique) are implemented natively in Rust using the regex crate, eliminating risks associated with piping to external shell utilities. The use of `std::process::Command::new` and its `arg`/`args` methods further ensures commands are not executed via a shell. Extensive unit tests for security components are also present.

Similar Servers

Stats

Interest Score0
Security Score10
Cost ClassLow
Avg Tokens2000
Stars0
Forks0
Last Update2025-12-31

Tags

Command ExecutionSecurity SandboxGit OperationsFile SystemAI Agent ToolOutput Transformation