- Home
- MCP servers
- Terminal
Terminal
- typescript
4
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can securely run shell commands and manage npm tasks inside your MCP environment with the terminal server. It provides controlled execution, environment isolation, and convenient npm operations, making it easy to automate workflows without giving up safety or predictability.
How to use
You interact with the terminal MCP capabilities through your MCP client by requesting command execution or npm-related actions. Use executeCommand to run a shell command with optional working directory and environment settings. Use install to add npm packages, and runScript to execute npm scripts defined in your project. You can also run common npm helpers such as dev and build to start development servers or build assets. All actions are governed by a whitelist of allowed commands and configurable timeouts to maintain security and reliability.
How to install
npm install @modelcontextprotocol/server-terminal
# Then configure the MCP terminal server following the configuration example below
Additional sections
Configuration is designed to restrict what you can run and to provide sensible defaults for common scenarios.
Key configuration options include a list of allowed commands, a default timeout, a default working directory, and environment variables that apply to the terminal session.
You can verify and adapt these settings to match your project needs, ensuring you can run necessary commands while keeping the environment secure and predictable.
Below is a representative configuration you can adapt for your MCP setup. It enables core npm operations and restricts commands to a safe set while providing a reasonable timeout and working directory.
{
"terminal": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-terminal"],
"autoApproveScope": ["execute_command", "npm_install", "npm_run"],
"config": {
"allowedCommands": ["npm", "node", "git"],
"defaultTimeout": 30000,
"defaultCwd": "/your/project/path",
"environmentVariables": {
"NODE_ENV": "development"
}
}
}
}
Available tools
executeCommand
Execute a shell command with optional working directory and environment settings, returning stdout, stderr, and exit code.
install
Install an npm package and return installation details, including version and resolution.
runScript
Run a defined npm script from your project's package.json and capture output and status.
dev
Run the development script for the project, typically mapping to npm run dev.
build
Run the build script for the project, typically mapping to npm run build.