Runs terminal commands for LLMs restricted to predefined paths.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add terminal --env ALLOWED_PATHS='<ALLOWED_PATHS>' -- npx @dillip285/mcp-terminal --allowed-paths /path/to/allowed/directory~/.codex/config.toml
[mcp_servers.terminal]
command = "npx"
args = ["@dillip285/mcp-terminal", "--allowed-paths", "/path/to/allowed/directory"]
env = { ALLOWED_PATHS = "<ALLOWED_PATHS>" }
# codex mcp add terminal --env ALLOWED_PATHS='<ALLOWED_PATHS>' -- npx @dillip285/mcp-terminal --allowed-paths /path/to/allowed/directory~/.cursor/mcp.json
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": [
"@dillip285/mcp-terminal",
"--allowed-paths",
"/path/to/allowed/directory"
],
"env": {
"ALLOWED_PATHS": "<ALLOWED_PATHS>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"terminal": {
"type": "stdio",
"command": "npx",
"args": [
"@dillip285/mcp-terminal",
"--allowed-paths",
"/path/to/allowed/directory"
],
"env": {
"ALLOWED_PATHS": "<ALLOWED_PATHS>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": [
"@dillip285/mcp-terminal",
"--allowed-paths",
"/path/to/allowed/directory"
],
"env": {
"ALLOWED_PATHS": "<ALLOWED_PATHS>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": [
"@dillip285/mcp-terminal",
"--allowed-paths",
"/path/to/allowed/directory"
],
"env": {
"ALLOWED_PATHS": "<ALLOWED_PATHS>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": [
"@dillip285/mcp-terminal",
"--allowed-paths",
"/path/to/allowed/directory"
],
"env": {
"ALLOWED_PATHS": "<ALLOWED_PATHS>"
}
}
}
}Environment variables
ALLOWED_PATHS
Replace the placeholders with your own credentials and keep them out of version control.