shell-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
TL;DR
Your AI can write code but can't run it. shell-mcp gives it a terminal.
npx -y @shell-mcp/mcp-lite --initRestart your AI app. Done. Your AI can now run commands, install packages, use git, start servers, run tests — everything you do in a terminal.
Related MCP server: local-mcp
Demo
The Problem
You're using Claude Desktop and ask your AI to:
"Run my tests"
"Install that package"
"Check the git status"
"Start the dev server"
It can't. It has no terminal. You end up copy-pasting commands back and forth like it's 2005.
The Fix
npx -y @shell-mcp/mcp-lite --initThat's literally it. This one command:
Auto-detects which AI apps you have installed
Configures them automatically
No JSON to edit, no config files to find
Just restart your AI app. It now has a terminal.
shell-mcp -- init
-----------------
Claude Desktop + Added
Cursor + Added
Windsurf + Added
Restart your clients to activate.What can your AI do now?
Anything you can do in a terminal:
"Run npm install" ✓
"Start the dev server" ✓
"Run the test suite" ✓
"Check git status and commit" ✓
"List all running processes" ✓
"Create a new React project" ✓
"Build and deploy" ✓
"SSH into the server" (if you want) ✓State persists between commands — cd, environment variables, nvm use, conda activate all carry over. Just like a real terminal.
5 tools. That's all it needs.
Most MCP servers give AI 20+ tools. We give it 5. Here's why that's better.
Tool | Why it exists |
| The workhorse. Runs any shell command — git, npm, curl, docker, make, anything. Your AI already knows how to use a terminal. |
| Shell is terrible at writing files (quoting, escaping, multiline). This does it reliably. |
| Reads files without encoding headaches. Cleaner than |
| Every command is logged. Your AI can review what happened. |
| Shows active safety rules. Read-only — AI can't change them. |
Why not more? Your AI already knows git status, ls -la, ps aux, kill. Wrapping them in custom tools adds complexity without value. Give it a terminal and get out of the way.
Safety first
Your AI has a terminal, but it's not unsupervised. Commands are checked before they execute.
Blocked (never runs)
rm -rf / · DROP DATABASE · curl ... | bash
format C: · dd of=/dev/sda · :(){ :|:& };:Warned (runs with a flag)
sudo ... · rm -rf · git push --force
kill -9 · shutdown · chmod 777Every command — blocked or executed — is logged to ~/.shell-mcp/logs/audit.jsonl.
Lock it down
Want to restrict what your AI can run? Use allowlists:
{
"mcpServers": {
"shell-mcp": {
"command": "npx",
"args": ["-y", "@shell-mcp/mcp-lite"],
"env": {
"SHELL_MCP_ALLOWLIST": "npm.*,git.*,node.*",
"SHELL_MCP_DEFAULT_DENY": "true"
}
}
}
}Now only npm, git, and node commands are allowed. Everything else is blocked.
Smart timeout
Other tools kill npm install after 30 seconds because of a fixed timeout. We don't.
Others: |---- 30s fixed ---------| KILL (npm install dies mid-download)
shell-mcp: |-- 15s --| reset |-- 15s --| reset |-- 15s --| done
^ output ^ output ^ outputThe timeout resets every time output is produced. Your command only dies after 15 seconds of complete silence or a 5-minute absolute cap.
Works everywhere
Platform | Default Shell | Status |
macOS | zsh | Supported |
Linux | bash | Supported |
Windows | PowerShell | Supported |
Zero native dependencies. No build tools required. Just Node.js 20+.
Configuration (all optional)
shell-mcp works out of the box. Customize only if you want to.
Variable | Default | What it does |
| current dir | Starting directory for sessions |
| auto-detect | Force a shell ( |
|
| Max parallel sessions |
| built-in | Extra blocked patterns (comma-separated regex) |
| none | Only allow these commands (comma-separated regex) |
|
| Block everything not in allowlist |
|
| Enable/disable audit logging |
Pass them as environment variables in your MCP config:
{
"mcpServers": {
"shell-mcp": {
"command": "npx",
"args": ["-y", "@shell-mcp/mcp-lite"],
"env": {
"SHELL_MCP_CWD": "/path/to/project",
"SHELL_MCP_SHELL": "bash"
}
}
}
}Manual setup
If --init doesn't detect your client, or you prefer to configure manually:
Config file location:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add this to the file:
{
"mcpServers": {
"shell-mcp": {
"command": "npx",
"args": ["-y", "@shell-mcp/mcp-lite"]
}
}
}Config file: ~/.cursor/mcp.json
{
"mcpServers": {
"shell-mcp": {
"command": "npx",
"args": ["-y", "@shell-mcp/mcp-lite"]
}
}
}Config file: ~/.windsurf/mcp.json
{
"mcpServers": {
"shell-mcp": {
"command": "npx",
"args": ["-y", "@shell-mcp/mcp-lite"]
}
}
}How it works (for the curious)
You ask: "Run my tests"
|
v
AI calls run_command("npm test")
|
v
Safety check (blocked? warned? ok?)
|
v
Execute in persistent shell session
(state carries over between commands)
|
v
Smart timeout (auto-extends while output flows)
|
v
Log to audit trail --> return result to AI
|
v
AI reads output, decides what to do nextNo PTY. No native dependencies. Just clean stdin/stdout pipes.
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
git clone https://github.com/psdlabs/shell-mcp.git
cd shell-mcp
pnpm install
pnpm buildpackages/
core/ -- Session engine, safety, audit
mcp-lite/ -- MCP server (what users install)FAQ
Yes. Destructive commands are blocked before they execute. Every command is logged to an audit trail. You can lock it down further with allowlists and DEFAULT_DENY mode. The AI cannot modify safety rules — they're read-only.
If your client supports MCP (Model Context Protocol), yes. The --init command auto-detects Claude Desktop, Cursor, and Windsurf. For others, add the JSON config manually.
Smart timeout handles it. If a command produces no output for 15 seconds, it times out. There's also a 5-minute absolute cap. The AI gets a clear "TIMED OUT" status and can decide what to do.
It's designed for interactive AI use, but there's nothing stopping you from using it in automation. Just configure the safety rules for your use case.
No. npx downloads and runs it automatically. You just need Node.js 20 or later.
Star History
If this project helps you, consider giving it a star. It helps others find it.
License
MIT -- do whatever you want with it.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Persistent Linux computers for AI agents: desktop, signed-in browser, vault, apps and shell.
Run AI agent tasks in isolated sandboxes with a cost cap, saved workflows and scoped connections.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables AI coding agents to run shell commands, spawn persistent background tasks, and read/write files inside isolated remote container sandboxes on a VPS. It also provides project workspace listing, task attach/kill controls, and a searchable knowledge graph for memory continuity across sessions.-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to securely inspect, modify, and manage local projects with trusted filesystem access, safe Git operations, controlled task execution, and developer runtime process management over stdio or HTTP.4Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables local, permissioned development workflows from compatible AI clients, including filesystem editing, interactive terminals, durable jobs, Git operations, and semantic browser testing.53 npm1Apache 2.0
- AlicenseAqualityCmaintenanceEnables AI agents to run shell commands, perform sandboxed file operations, and make HTTP requests through zero-trust guards that block command injection, path traversal, and SSRF while redacting secrets from inputs and outputs. Circuit breakers, per-session rate limits, and an append-only audit ledger prevent runaway loops, excessive token spend, and provide post-hoc traceability.5MIT