Bash 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., "@Bash MCP Serverlist all files in the current directory including hidden ones"
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.
Bash MCP Server
A Model Context Protocol (MCP) server that executes bash commands. Returns stdout, stderr, exit code, and execution duration for each command.
View on mpak registry | Built by NimbleBrain
Install
Install with mpak:
mpak install @nimblebraininc/bashClaude Code
claude mcp add bash -- mpak run @nimblebraininc/bashClaude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"bash": {
"command": "mpak",
"args": ["run", "@nimblebraininc/bash"]
}
}
}See the mpak registry page for full install options.
Related MCP server: MCP Terminal Tool Server
Tools
bash_exec
Execute a bash command and return stdout, stderr, exit code, and duration.
Parameter | Type | Required | Description |
|
| Yes | The bash command to execute |
|
| No | Working directory (defaults to server's cwd) |
|
| No | Timeout in seconds (default: |
|
| No | Additional environment variables to set |
Example call:
{
"name": "bash_exec",
"arguments": {
"command": "ls -la /tmp",
"timeout": 10
}
}Example response:
{
"stdout": "total 0\ndrwxrwxrwt 12 root wheel 384 Jan 15 12:00 .\ndrwxr-xr-x 6 root wheel 192 Jan 1 00:00 ..\n",
"stderr": "",
"exit_code": 0,
"duration_ms": 12
}Security Model
This server executes arbitrary bash commands. Security is secure-by-deployment: the server itself has no allowlist or sandbox. Instead, security is enforced by the deployment environment:
mpak: User approves MTF permissions (
subprocess: "full") at install timeContainers: Linux namespaces, cgroups, and network policies restrict what commands can do
Claude Desktop: Runs under the user's own OS permissions
The MTF permission declaration (subprocess: "full", filesystem: "full", network: "full") accurately reflects that bash commands can read/write files and make network calls.
Quick Start
Local Development
git clone https://github.com/NimbleBrainInc/mcp-bash.git
cd mcp-bash
# Install dependencies
uv sync
# Run the server (stdio mode)
uv run python -m mcp_bash.server
# Or run via FastMCP
uv run fastmcp run src/mcp_bash/server.pyThe server supports HTTP transport with:
Health check:
GET /healthMCP endpoint:
POST /mcp
Development
# Install with dev dependencies
uv sync --group dev
# Run unit tests
make test
# Run with coverage
make test-cov
# Run all checks (format, lint, typecheck, unit tests)
make check
# Format
uv run ruff format .
# Lint
uv run ruff check .E2E Tests
End-to-end tests validate the full MCPB bundle lifecycle: building the bundle, deploying it into a Docker container, and calling tools over HTTP.
Prerequisites: Docker running, mcpb CLI installed (npm install -g @anthropic-ai/mcpb)
make test-e2eThe tests:
Vendor dependencies for the Docker container's Linux architecture
Build a
.mcpbbundle withmcpb packServe the bundle over HTTP
Start a
nimbletools/mcpb-pythoncontainer that downloads and runs the bundleVerify the
/healthendpoint, MCP tool listing, and tool invocation via streamable HTTP
About
Bash MCP Server is published on the mpak registry and built by NimbleBrain. mpak is an open registry for Model Context Protocol servers.
License
MIT
Available Tools
1 toolbash_execA
Execute a bash command and return stdout, stderr, exit code, and duration.
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The bash command to execute | |
| cwd | No | Working directory (defaults to server's cwd) | |
| timeout | No | Timeout in seconds (default 30, max 600) | |
| env | No | Additional environment variables to set |
Output Schema
| Name | Required | Description |
|---|---|---|
| stdout | Yes | Command standard output |
| stderr | Yes | Command standard error |
| exit_code | Yes | Exit code (124 = timeout) |
| duration_ms | Yes | Execution time in milliseconds |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses the return values (stdout, stderr, exit code, duration), which is helpful. However, it omits behavioral details like side effects, error handling, permissions, or security implications, which are essential for a bash execution tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that front-loads the action and returns concise, relevant information. Every word serves a purpose with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that the output schema covers return values and the schema covers parameters, the description is minimally adequate. However, it lacks critical context about safety, side effects, and usage boundaries, which are important for a potentially dangerous tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description does not add any additional meaning about the parameters beyond what the schema already provides; it merely restates the action.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'execute' and the resource 'bash command', and lists the return values (stdout, stderr, exit code, duration). It is specific and leaves no ambiguity about the tool's purpose, even without sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, nor does it specify any prerequisites or exclusions. For a command execution tool, usage context is critical but absent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
- Changed
bash_exec4 fields changed- added
Input schema / properties / command / descriptionAdded value: +"The bash command to execute" - added
Input schema / properties / cwd / descriptionAdded value: +"Working directory (defaults to server's cwd)" - added
Input schema / properties / env / descriptionAdded value: +"Additional environment variables to set" - added
Input schema / properties / timeout / descriptionAdded value: +"Timeout in seconds (default 30, max 600)"
1 tool update
v0.1.0- First observed
bash_exec
TDQS
Only one tool exists, so there is no possibility of confusion between tools. The tool's purpose is uniquely defined.
The single tool name 'bash_exec' follows a clear verb_noun pattern, which is consistent and descriptive.
With only one tool, the server feels minimal for a bash execution service. While it covers the core operation, the count is at the borderline of being too thin.
The tool provides basic execution with stdout/stderr/exit code/duration, but lacks features like timeout control, environment variable setting, or working directory specification, leaving notable gaps.
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 Connectors
A MCP server built for developers enabling Git based project management with project and personal…
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
ArcAgent MCP server for bounty discovery, workspace execution, and verified coding submissions.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables coding agents to execute and manage long-running shell commands asynchronously with capabilities for process monitoring, interaction, and lifecycle management.713MIT
- FlicenseBqualityDmaintenanceAn MCP server that enables users to execute arbitrary shell commands on their local machine and receive the output. It provides a terminal tool for running system commands through MCP-compatible clients using the Python SDK.1-
- AlicenseAqualityCmaintenanceEnables execution of bash commands via MCP, allowing clients to run shell commands and set a working directory.233MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for spawning and managing bash commands asynchronously. Run multiple shell commands in parallel and check their progress independently.6MIT
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/NimbleBrainInc/mcp-bash'
If you have feedback or need assistance with the MCP directory API, please join our Discord server