sonirico/mcp-shell
Give hands to AI. MCP server to run shell commands securely, auditably, and on demand.
b358b02bcad8Paths from tool input into commands, SQL, files and URLs
How much power the tools give an agent over the machine
Hidden instructions and poisoning in text for the model
Known vulnerabilities in the packages the server uses
How the server reads credentials and where they can go
Whether the tools do only what their descriptions say
How far the analysis went
The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.
- In 16 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
Top risks in plain words
- HIGH4 security advisories have been published for this server itself (worst: high). 1 of them lists no fixed version.
- HIGHTool with a name computed at run time runs programs by design: an agent steered by prompt injection can use it that way.
- MEDIUM2 production dependencies have known vulnerabilities (worst: medium).
How to use it safely
Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.
- Run it in a container or a virtual machine
handler.go:26can start programs or run code they are given. Keep it away from your home folder, keys and other projects. - Turn off the tools you do not use
Most MCP clients let you disable single tools. If you do not need
handler.go:26, switch them off. - Update its vulnerable packages
Use
github.com/mark3labs/mcp-go1.5.1-0.20261109144041-2f5b9637ea84 or later,golang.org/x/text0.41.0 or later. - Read its open advisories before installing
GHSA-573w-fmhg-vxq2 (medium) lists no fixed version. Check whether the version you install is affected.
- Use a fixed version
Versions before
github.com/sonirico/mcp-shell0.6.0 have a published vulnerability that is fixed in 0.6.0. - Keep confirmations on
Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.
What its tools can do on your machine
The server offers 30 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.
shellHandler.handlediff_files, edit_file, read_file, stat, write_fileNo tool was seen to: connect to the internet or other hosts; read passwords, tokens or keys; read environment variables; touch sensitive locations.
Where its requests and secrets go
Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.
The literal addresses the tools' requests name.
- None: no request names a fixed host.
Constants or settings that start an address; the value comes from configuration.
- None seen.
Credential-like environment variables. Give the server a key with the least access it needs.
- None: no credential-like variable is read by the tools.
Text it brings in from outside
Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.
- files5 tools · diff_files, edit_file, read_file +2
Tool annotations
No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.
Tools, prompts and resources (30: 30 tools)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
deletetool Delete a file or directory
Delete a file or directory
diff_filestool Show a unified diff between two filesFilesoutside text
Show a unified diff between two files
edit_filetool Replace an exact string in a fileFilesoutside text
Replace an exact string in a file
git_addtool Stage files
Stage files
git_blametool Show what revision and author last modified each line of a file
Show what revision and author last modified each line of a file
git_branchestool List branches
List branches
git_committool Create a commit
Create a commit
git_difftool Show changes between commits, the working tree, or the index
Show changes between commits, the working tree, or the index
git_logtool Show commit logs
Show commit logs
git_ls_filestool List tracked (or untracked) files
List tracked (or untracked) files
git_remotestool List remotes and their URLs
List remotes and their URLs
git_restoretool Restore working tree or staged files
Restore working tree or staged files
git_rev_parsetool Resolve a ref to a commit hash
Resolve a ref to a commit hash
git_showtool Show a commit or a file at a given ref
Show a commit or a file at a given ref
git_stashtool Stash, pop, or drop local changes
Stash, pop, or drop local changes
git_stash_listtool List the stash entries
List the stash entries
git_statustool Show the working tree status
Show the working tree status
git_switchtool Switch to a branch
Switch to a branch
git_tagstool List tags
List tags
globtool Find files matching a glob pattern
Find files matching a glob pattern
greptool Search file contents with a regular expression
Search file contents with a regular expression
list_dirtool List directory entries up to a given depth
List directory entries up to a given depth
mkdirtool Create a directory, including parent directories
Create a directory, including parent directories
movetool Move or rename a file or directory
Move or rename a file or directory
read_filetool Read a text file, optionally by line offset/limit or tailFilesoutside text
Read a text file, optionally by line offset/limit or tail
run_scripttool
No description.
shellHandler.handletool Processes
No description.
stattool Show metadata for a file or directoryFilesoutside text
Show metadata for a file or directory
system_infotool Show information about the host and workspace
Show information about the host and workspace
write_filetool Write content to a file, creating parent directories as neededFilesoutside text
Write content to a file, creating parent directories as needed
Text the model reads (30)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
shellHandler.handle tool
read_file tool
Read a text file, optionally by line offset/limit or tail
list_dir tool
List directory entries up to a given depth
glob tool
Find files matching a glob pattern
grep tool
Search file contents with a regular expression
stat tool
Show metadata for a file or directory
diff_files tool
Show a unified diff between two files
system_info tool
Show information about the host and workspace
write_file tool
Write content to a file, creating parent directories as needed
edit_file tool
Replace an exact string in a file
mkdir tool
Create a directory, including parent directories
move tool
Move or rename a file or directory
delete tool
Delete a file or directory
git_status tool
Show the working tree status
git_log tool
Show commit logs
git_diff tool
Show changes between commits, the working tree, or the index
git_show tool
Show a commit or a file at a given ref
git_blame tool
Show what revision and author last modified each line of a file
git_branches tool
List branches
git_tags tool
List tags
git_rev_parse tool
Resolve a ref to a commit hash
git_ls_files tool
List tracked (or untracked) files
git_stash_list tool
List the stash entries
git_remotes tool
List remotes and their URLs
git_add tool
Stage files
git_commit tool
Create a commit
git_switch tool
Switch to a branch
git_restore tool
Restore working tree or staged files
git_stash tool
Stash, pop, or drop local changes
run_script tool
What we checked
The same checks run on every server. Each line below has one of these marks:
- 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injectionChecked on every scan. Results in this category are published only after a person has verified them.
- Runs programs the caller chooses1 finding the scanner could not decide; see the findings below
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 30 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Reads or writes any file pathNo tool works on a file path the caller supplies without a root check — 30 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Requests any addressNo tool sends a request to an address the caller supplies — 30 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Runs caller-supplied SQLNo tool executes a query the caller supplies — 30 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Tools that start processes1 of 30 capabilities start processes; 29 more call code the scanner could not follow, where it may happen
- Tools that touch files5 of 30 capabilities touch files; 25 more call code the scanner could not follow, where it may happen
- Tools that call the networkNot seen in the traced code of 30 capabilities; 30 more call code the scanner could not follow, where it may happen
Where the code is: 30 handlers in 4 files at commit b358b02bcad8
handler.goshellHandler.handletools_fs.goread_file, list_dir, glob, grep, stat, diff_files, system_info, write_file, edit_file, mkdir, move, deletetools_git.gogit_status, git_log, git_diff, git_show, git_blame, git_branches, git_tags, git_rev_parse, git_ls_files, git_stash_list, git_remotes, git_add +4tools_script.gorun_script
- 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrityChecked on every scan. Results in this category are published only after a person has verified them.
- Dependency manifests1 manifest: go.mod
- Lockfiles checked against OSV1 file resolved and checked against the OSV database
- Known vulnerabilities in production dependencies MEDIUM2 production packages with known advisories
- Known vulnerabilities in other dependenciesNo package used only for development, tests or examples has a known advisory
- MCP SDK versiongithub.com/mark3labs/mcp-go v0.54.1
- 3 checks: credential harvesting, undeclared credential access, credentials sent over the networkChecked on every scan. Results in this category are published only after a person has verified them.
- Tools that read credentialsNot seen in the traced code of 30 capabilities; 30 more call code the scanner could not follow, where it may happen
- Authentication declaredNot checked: needs the live server's tools/list (a remote server declares how clients authenticate)
- 3 checks: undeclared network access, undeclared file access, undeclared process executionChecked on every scan. Results in this category are published only after a person has verified them.
- Tool descriptions presentEvery tool has a description the model and the user can read (2 only in code no tool reaches)
- Statically known namesEvery tool's name could be read from the code
- Input schemasNot checked: needs the live server's tools/list (every tool declares an input schema)
- Destructive tools annotatedNot checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)
Dependencies with known vulnerabilities (2 in production)
golang.org/x/textGo v0.38.0 MEDIUM 2 advisories 0.39.00.41.0
- MEDIUMGO-2026-6629 CVE-2026-56851Panic parsing crafted input in x/text/secure/precis in golang.org/x/text
- MEDIUMGO-2026-5970 CVE-2026-56852Infinite loop on invalid input in golang.org/x/text
github.com/mark3labs/mcp-goGo v0.54.1 MEDIUM 1 advisory 2026-11-09
- MEDIUMGO-2026-6911SSRF and credential leak via unvalidated redirects and SSE endpoint origin in github.com/mark3labs/mcp-go
Past security advisories
Vulnerabilities published for this server itself, from the GitHub Advisory Database.
- HIGH GHSA-f5pj-2738-996mCVE-2026-55580mcp-shell — Security Disabled by Default in Bare-Binary Deploy Path + Shell Interpreter in Secure-Mode Allowlist
- HIGH GHSA-3x77-wg38-92r3CVE-2026-55581mcp-shell has a Secure Mode Allowlist Bypass via Default `/bin/bash` Executable
- HIGH GHSA-74hp-mggr-hv58CVE-2026-55582mcp-shell has a Secure Mode Allowlist Bypass via Git Shell Alias
- MEDIUM GHSA-573w-fmhg-vxq2CVE-2025-61489A command injection vulnerability in the shell_exec function of sonirico mcp-shell v0.3.1 allows ...
How it runs
| Where it runs | On your machine, started by your MCP client from this repository or its package |
|---|---|
| Transport | stdio |
| Sign-in | not checked needs the live server |
| MCP SDK | github.com/mark3labs/mcp-go v0.54.1 |
| Servers in the code | 20 (t) |
The project's own security
| Security policy | yes SECURITY.md |
|---|---|
| Private reporting | mentioned the policy names a private channel |
| Past advisories | 4 · 3 with a fixed version released |
| Last push | 2026-09-25 |
| Signed releases | not checked yet |
Where it is published
| Listed in | 5 catalogs (awesome_punkpeye, github_search, glama, mcp_toplist, mcpservers_org) |
|---|---|
| License | GPL-3.0 |
| Created | 2025-05-24 |
| Topics | ai bash go llm mcp model-context-protocol os-exec shell terminal |
Attack map
How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.