Terminal MCP Server

v1.0.0Developer Toolsstable

Enables safe execution of terminal commands across different shells (bash, cmd, PowerShell) with configurable timeouts, working directories, and resource limits for command-line operations through AI assistants.

claude-desktopdockermcp-serverterminal
Share:
83
Stars
0
Downloads
0
Weekly
0/5

What is Terminal MCP Server?

Terminal MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables safe execution of terminal commands across different shells (bash, cmd, powershell) with configurable timeouts, working directories, and resource limits for command-line operations through ai ...

Enables safe execution of terminal commands across different shells (bash, cmd, PowerShell) with configurable timeouts, working directories, and resource limits for command-line operations through AI assistants.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables safe execution of terminal commands across different

Use Cases

Safe terminal command execution
Cross-shell support (bash, cmd, PowerShell)
Resource-limited command execution
theailanguage

Maintainer

LicenseNOASSERTION
Languagepython
Versionv1.0.0
UpdatedMay 11, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx terminal-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Terminal MCP Server

Terminal MCP Server is a Python MCP server that enables AI assistants to safely execute terminal commands across multiple shell environments — bash, cmd, and PowerShell — with configurable timeouts, working directory scoping, and resource limits. Built with FastMCP and deployable via local Python, Docker (stdio or SSE), or Google Cloud Platform, it exposes a `run_command` tool that runs shell commands in a sandboxed workspace directory and returns the output to the AI. It is designed for developers who want to give AI assistants controlled access to their system's command line without unrestricted filesystem access.

Prerequisites

  • Python 3.10 or higher and the `uv` package manager installed
  • Git to clone the repository
  • Docker (optional, for containerized or SSE deployment modes)
  • An MCP-compatible client such as Claude Desktop
  • A designated workspace directory for command execution (default: `~/mcp/workspace`)
1

Clone the repository

Download the terminal server source code from GitHub.

git clone https://github.com/theailanguage/terminal_server.git
cd terminal_server
2

Install dependencies

Install the Python dependencies using uv. The pyproject.toml specifies all required packages including fastmcp.

uv sync
3

Create the workspace directory

The server executes commands inside `~/mcp/workspace` by default. Create this directory. All commands run by the AI will be scoped to this location.

mkdir -p ~/mcp/workspace
4

Configure Claude Desktop

Add the terminal server to your claude_desktop_config.json. Use the absolute path to the cloned repository. The server runs via uv to ensure the correct virtual environment is used.

{
  "mcpServers": {
    "terminal": {
      "command": "uv",
      "args": [
        "--directory", "/absolute/path/to/terminal_server",
        "run",
        "terminal_server.py"
      ]
    }
  }
}
5

Optional: Deploy with Docker

For an isolated deployment, build the Docker image and update your config to use the containerized server. The workspace directory is mounted as a volume.

docker build -t terminal_server_docker .
# Then use this config:
# {
#   "mcpServers": {
#     "terminal_server": {
#       "command": "docker",
#       "args": ["run", "-i", "--rm", "--init",
#         "-e", "DOCKER_CONTAINER=true",
#         "-v", "/Users/yourname/mcp/workspace:/root/mcp/workspace",
#         "terminal_server_docker"]
#     }
#   }
# }
6

Restart Claude Desktop and verify

Restart Claude Desktop after saving the configuration. Ask Claude to run a simple command to confirm the terminal server is connected.

Terminal MCP Server Examples

Client configuration

Claude Desktop configuration for running terminal_server.py with uv, scoped to a workspace directory.

{
  "mcpServers": {
    "terminal": {
      "command": "uv",
      "args": [
        "--directory", "/Users/yourname/terminal_server",
        "run",
        "terminal_server.py"
      ]
    }
  }
}

Prompts to try

Ask Claude to execute shell commands through the terminal server's run_command tool.

- "Run the command ls in my workspace"
- "Execute echo Hello from Claude"
- "Check what Python version is installed with python3 --version"
- "Create a file called notes.txt in the workspace with the content 'test'"
- "List all files in the workspace directory including hidden files"

Troubleshooting Terminal MCP Server

Server fails to start and Claude Desktop shows a connection error

Verify the `--directory` path in the config is an absolute path pointing to where you cloned the repo. Run `which uv` in a terminal to confirm uv is installed. If uv is not found, install it with `curl -LsSf https://astral.sh/uv/install.sh | sh`.

Commands run but return empty output or 'No such file or directory'

The server scopes all commands to `~/mcp/workspace`. Ensure this directory exists (`mkdir -p ~/mcp/workspace`). If you need a different working directory, edit the `DEFAULT_WORKSPACE` variable at the top of `terminal_server.py`.

Docker container exits immediately without running commands

Ensure the `-i` flag is present in the docker run args (it keeps stdin open for stdio transport). Also verify the volume mount path exists on your host and that the image was built successfully with `docker build -t terminal_server_docker .`.

Frequently Asked Questions about Terminal MCP Server

What is Terminal MCP Server?

Terminal MCP Server is a Model Context Protocol (MCP) server that enables safe execution of terminal commands across different shells (bash, cmd, powershell) with configurable timeouts, working directories, and resource limits for command-line operations through ai assistants. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Terminal MCP Server?

Follow the installation instructions on the Terminal MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Terminal MCP Server?

Terminal MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Terminal MCP Server free to use?

Yes, Terminal MCP Server is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "terminal-mcp-server": { "command": "npx", "args": ["-y", "terminal-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Terminal MCP Server?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides