Terminal MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Terminal MCP ServerList the files in my home directory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Terminal MCP Server
Gives Claude Desktop (or any MCP client) the ability to run shell commands, read/write files, and list directories on your machine.
⚠️ Read this first
This connects Claude to a real terminal on your computer. Claude will be able
to run whatever commands it decides to run, within the safety limits below.
Only install this if you're comfortable with that level of access — treat it
like handing someone a terminal, not like a sandboxed toy. See
SECURITY.md for the full threat model.
Built-in guardrails (not a full security boundary, just a basic net):
Refuses a short list of obviously destructive commands (
rm -rf /, fork bombs,mkfs, etc.)File operations are scoped to
BASE_DIR(defaults to your home directory) unless you pass an absolute path30-second default timeout per command (configurable per call)
Related MCP server: Local Dev Bridge MCP
Project structure
terminal-mcp/
├── server.py # the MCP server (tools: run_command, list_directory, read_file, write_file, get_cwd)
├── tests/
│ └── test_server.py # pytest suite (risky-command regex, path resolution, tool behavior)
├── pyproject.toml # deps (mcp[cli]) + dev extras (pytest, ruff) + packaging metadata + ruff config
├── install.sh # one-shot installer (uv + venv + deps + Claude Desktop config, cross-platform)
├── uninstall.sh # removes the "terminal" entry from Claude Desktop's config
├── .github/workflows/ci.yml # runs ruff + pytest on push/PR
├── .gitignore
├── LICENSE # MIT
├── SECURITY.md # threat model & guardrail limitations
├── 00_change.md # AI-assisted change log (what changed, why, by whom)
└── README.mdQuick install (recommended)
From inside this folder:
cd terminal-mcp
./install.shThe script will:
Detect your OS (macOS / Linux / Windows-git-bash)
Make sure
uvis installed (offering to install it for you if it isn't), then create avenv/here (if it doesn't exist yet) and install dependencies frompyproject.tomlAsk you for the base directory the terminal tool should be scoped to (defaults to your home directory — press Enter to accept)
Auto-detect this folder's absolute path and write the correct
commandandargsinto your Claude Desktop configBack up your existing
claude_desktop_config.jsonbefore touching it, and merge in theterminalentry (other MCP servers you already have configured are left untouched)
Then just restart Claude Desktop.
To remove it later:
./uninstall.shThis removes only the terminal entry from the config (backing it up first)
— it doesn't touch this repo or the venv.
Manual install
If you'd rather do it by hand:
1. Install dependencies
Requires uv
(curl -LsSf https://astral.sh/uv/install.sh | sh):
cd terminal-mcp
uv venv venv
uv pip install --python venv/bin/python . # Windows: venv\Scripts\python.exe2. Test it locally (optional but recommended)
The mcp package ships a dev inspector so you can try tools before wiring it
into Claude Desktop:
mcp dev server.pyThis opens a local web UI where you can call run_command, list_directory,
etc. and see the results.
3. Connect it to Claude Desktop
Find your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add (or merge in) this entry, using the absolute path to your server.py
and to the Python interpreter inside the venv you just created:
{
"mcpServers": {
"terminal": {
"command": "/absolute/path/to/terminal-mcp/venv/bin/python",
"args": ["/absolute/path/to/terminal-mcp/server.py"],
"env": {
"TERMINAL_MCP_BASE_DIR": "/absolute/path/to/wherever/you/want/it/scoped"
}
}
}
}On Windows, command would point at
...\\terminal-mcp\\venv\\Scripts\\python.exe.
4. Restart Claude Desktop
You should see a 🔌 / tools icon indicating the terminal server is
connected, with tools: run_command, list_directory, read_file,
write_file, get_cwd.
Try it
Ask Claude something like:
"List the files in my current project folder"
"Run
git statusin ~/projects/my-app""Read the contents of config.yaml and summarize it"
"Create a file called notes.txt with today's todo list"
Development
uv pip install --python venv/bin/python ".[dev]"
ruff check . # lint
pytest -v # run testsCI (.github/workflows/ci.yml) runs both on every push/PR to main across
Python 3.10–3.12.
Customizing
Scope it tighter: set
TERMINAL_MCP_BASE_DIRto a specific project folder instead of your home directory, so relative paths can't wander outside it.Add more guardrails: extend
RISKY_PATTERNSinserver.pyfor any other commands you never want run automatically.Add more tools: the pattern is
@mcp.tool()decorating a function with a docstring — Claude reads the docstring to know when/how to call it. You could add things likegit_diff,run_tests,curl, etc. as dedicated tools with tighter guardrails than rawrun_command.
Using with Claude Code instead
If you're using Claude Code rather than Claude Desktop, you likely don't need this at all — Claude Code already has built-in terminal access. This server is most useful for Claude Desktop or other MCP clients that don't have a terminal tool of their own.
Change log
See 00_change.md for a running log of AI-assisted
changes to this repo — what changed, why, and by which assistant.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceAllows Claude desktop app to execute terminal commands and edit files on your computer through MCP, with features including command execution, process management, and diff-based file editing.Last updated102699,4209,251MIT
- AlicenseAqualityDmaintenanceProvides Claude Desktop with direct access to your local file system for development tasks, enabling file operations (read, write, edit), directory browsing, command execution, and codebase search within a configured projects directory.Last updated6MIT
- Flicense-qualityDmaintenanceEnables GPT Desktop to interact with local file systems and execute shell commands. Supports file operations (read, write, edit, delete), directory management, file search, and git status checks through natural language.Last updated
- Flicense-qualityDmaintenanceProvides filesystem access to Claude via the MCP protocol, enabling local file operations through natural language.Last updated
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dha-aa/terminal-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server