Decide the directory for command execution
- Determine which directory on your machine should be accessible for CLI operations. You will set this as the value for
ALLOWED_DIR
.
Choose which commands and flags are permitted
- List the commands you wish to allow (for example:
ls,cat,pwd,echo
). This will be your value for ALLOWED_COMMANDS
.
- List the command-line flags you wish to allow (for example:
-l,-a,--help,--version
). This will be your value for ALLOWED_FLAGS
.
(Optional) Set advanced restrictions
- If needed, set a maximum command length with
MAX_COMMAND_LENGTH
.
- Set the number of seconds before a command times out with
COMMAND_TIMEOUT
.
- If you want to allow shell operators like
&&
, set ALLOW_SHELL_OPERATORS
to true
. By default, it should be false
for security.
Open the FastMCP connection interface
- Click the “Install Now” button to add ENV values for your MCP server.
Fill each required environment variable in the FastMCP interface:
- Enter your desired directory for
ALLOWED_DIR
.
- Input your selected allowed commands for
ALLOWED_COMMANDS
.
- Enter your chosen allowed flags for
ALLOWED_FLAGS
.
- Set
MAX_COMMAND_LENGTH
, COMMAND_TIMEOUT
, and ALLOW_SHELL_OPERATORS
as needed, based on your preference or use the defaults.
Save and apply your configuration
- After entering the values, save the configuration to enable the server with your chosen security settings.
Note: The environment variables are required for correct operation and security. Review your selections to ensure they match your intended restrictions and permissions.