原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

bash-mcp

作者:nickw8版本 5.0.1i★ –i在你的电脑上运行
注册名称io.github.nickw8/bash-mcp

安装

概览

作者提供的说明(英文原文)

Structured JSON wrappers for git, kubectl, terraform, helm, argocd, gh, glab and other CLIs.

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 开发者工具

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 需要你自己填写: BASH_MCP_MODE, BASH_MCP_PROFILE, BASH_MCP_RESPONSE_MODE

你需要

  • npm已安装 Node.js(用于 npx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "bash": {
      "command": "npx",
      "args": [
        "-y",
        "@nickw8/bash-mcp"
      ],
      "env": {
        "BASH_MCP_MODE": "your-value",
        "BASH_MCP_PROFILE": "your-value",
        "BASH_MCP_RESPONSE_MODE": "your-value"
      }
    }
  }
}

在终端中运行这条命令

claude mcp add bash --env BASH_MCP_MODE=your-value --env BASH_MCP_PROFILE=your-value --env BASH_MCP_RESPONSE_MODE=your-value -- npx -y @nickw8/bash-mcp

运行前请先填写空着的值。

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "bash": {
      "command": "npx",
      "args": [
        "-y",
        "@nickw8/bash-mcp"
      ],
      "env": {
        "BASH_MCP_MODE": "your-value",
        "BASH_MCP_PROFILE": "your-value",
        "BASH_MCP_RESPONSE_MODE": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "bash": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@nickw8/bash-mcp"
      ],
      "env": {
        "BASH_MCP_MODE": "your-value",
        "BASH_MCP_PROFILE": "your-value",
        "BASH_MCP_RESPONSE_MODE": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

需要你填写的值

  • BASH_MCP_MODE env
    Write gate for run/batch: readOnly (default), confirmWrites, off
  • BASH_MCP_PROFILE env
    Tool set to register: core, development, infrastructure, all (default)
  • BASH_MCP_RESPONSE_MODE env
    Response budget: auto (default), summary, compact, full

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 nickw8 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“开发者工具”中的其他服务器比较i

  • 星标数多于此分类中其他 1392 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 1392 个服务器的 76% 更新
  • 基础检查结果等于或优于此分类中其他 1392 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

bash-mcp 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(5.0.1)于14天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:GitHub, Desktop Commander, Cloudflare MCP

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

GitHub

作者:github

Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

电脑或云端★ 34,245MIT3天前更新
安装

Desktop Commander

作者:wonderwhy-er

MCP server for terminal commands, file operations, and process management

在你的电脑上运行★ 10,225MIT15天前更新
安装

Cloudflare MCP

作者:cloudflare

Cloudflare MCP servers

在云端运行★ 4,446Apache-2.014个月前更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

bash-mcp

An MCP server that wraps common CLI tools (kubectl, terraform, helm, git, argocd, jq, yq, ripgrep, etc.) and returns structured JSON instead of raw text output.

Designed for AI agents and LLM-powered workflows where parsing human-readable CLI output wastes tokens and breaks easily.

Created with the help of Claude since it is the main consumer of the structured data.

Quick Start

Option 1: Zero-install with npx

No installation needed — just add the MCP config and npx will fetch it on first use.

Option 2: Global install
npm install -g @nickw8/bash-mcp
Option 3: Install from source
git clone https://github.com/nickw8/bash-mcp.git

cd bash-mcp npm install && npm run build npm link

Verify your setup

Run the built-in preflight check before wiring bash-mcp into a client:

npx -y @nickw8/bash-mcp --doctor   # or: bash-mcp --doctor (global install)

It reports your Node version, whether the MCP SDK loads, which CLIs are available (versions included), and the resolved BASH_MCP_MODE — then exits non-zero if a critical check fails (Node too old or the SDK can't load). Missing CLIs are advisory, not failures. Without --doctor, the binary starts the MCP server as usual.

Claude Code Setup

Add bash-mcp to your Claude Code settings. For all projects (recommended), edit ~/.claude/settings.json. For a single project, edit .claude/settings.json in the project root.

With npx (no install required):

{

"mcpServers": { "bash-mcp": { "command": "npx", "args": ["-y", "@nickw8/bash-mcp"], "env": { "BASH_MCP_MODE": "readOnly" } } } }

Safe by default: an unset BASH_MCP_MODE resolves to readOnly, which

blocks mutating run/batch commands. The examples set it explicitly for

clarity. For trusted local use, set BASH_MCP_MODE=off to allow writes.

With global install:

{

"mcpServers": { "bash-mcp": { "command": "bash-mcp", "env": { "BASH_MCP_MODE": "readOnly" } } } }

To verify it's working, start Claude Code and check that bash-mcp tools (like cat, rg, git_status) appear in the tool list.

You can also add it from the CLI:

claude mcp add bash-mcp -e BASH_MCP_MODE=readOnly -- npx -y @nickw8/bash-mcp
Steer agents toward the structured tools (optional)

Registering the server exposes the tools, but agents still reach for raw Bash out of habit. Two assets fix that: a rules file (~/.claude/rules/bash-mcp-tools.md, auto-loaded into every session — the tool inventory) and a PreToolUse(Bash) redirect hook. Install both with:

npx -y @nickw8/bash-mcp --install-claude        # copy into ~/.claude

npx -y @nickw8/bash-mcp --install-claude --check # report drift, write nothing

It prints the settings.json hook block to paste in (the rules file needs no settings — Claude Code auto-loads ~/.claude/rules/*.md). See hooks/README.md for details and the clone-time npm run claude:install equivalent. --uninstall-claude removes both files again.

Or install the Claude Code plugin, which bundles the server and the hook (in warn mode — it never blocks unless BASH_MCP_HOOK=block):

/plugin install bash-mcp --marketplace nickw8/bash-mcp

Every other client (VS Code/Copilot, Codex, generic stdio) and pinned versions: docs/guides/installation.md.

Claude Desktop Setup

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\) and add the same mcpServers entry:

{

"mcpServers": { "bash-mcp": { "command": "npx", "args": ["-y", "@nickw8/bash-mcp"], "env": { "BASH_MCP_MODE": "readOnly" } } } }

Restart Claude Desktop after editing.

Cursor Setup

Add bash-mcp to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):

{

"mcpServers": { "bash-mcp": { "command": "npx", "args": ["-y", "@nickw8/bash-mcp"], "env": { "BASH_MCP_MODE": "readOnly" } } } }

(Use "command": "bash-mcp" with no args if you installed globally.) Any MCP-aware client works the same way — point it at the bash-mcp binary or npx -y @nickw8/bash-mcp.

Recommended Hooks

Optional Claude Code hooks in hooks/ steer agents toward the structured tools by blocking raw shell commands (git status, kubectl get, cat, …) that have a bash-mcp equivalent, while letting write commands (git commit, kubectl apply) pass through. BASH_MCP_HOOK=warn makes every block advisory; off disables the hook.

See docs/runbooks/hooks-setup.md for setup.

Why Structured Output?

Raw CLI tools return text meant for humans. AI agents waste tokens parsing tables, aligning columns, and guessing field boundaries. bash-mcp runs the same CLI tools but returns structured JSON with typed schemas, so the agent gets exactly the data it needs.

# Raw kubectl output: 148 tokens to parse a table

NAME READY STATUS RESTARTS AGE nginx-7c5b8d6c88-abc12 1/1 Running 0 3d

bash-mcp output: typed, compact, ready to use

{ "name": "nginx-7c5b8d6c88-abc12", "status": "Running", "age": "3d", ... }

See docs/guides/token-benchmarks.md for measured savings (e.g. kubectl describe pod → kube_diagnose_pod is ~64% fewer tokens).

Philosophy: structured tools first, run is the escape hatch

  1. Reach for a structured tool first. Every wrapper returns typed JSON the agent can use directly — no column-counting, no re-parsing on a format change.
  2. Prefer a diagnostic over a chain of raw commands. Tools like kube_diagnose_pod, helm_release_triage, and argo_app_health_summary answer an *operational question* in one call — { status, likelyCauses, suggestedNextCommands, evidence } — instead of making the agent run get, then logs, then reason across both.
  3. `run` / `batch` are the escape hatch. For commands without a dedicated wrapper, run executes anything with smart truncation. Optional hooks actively steer agents back to the structured tool when a raw equivalent is invoked.

Read-only tools carry the MCP readOnlyHint annotation. run/batch can be gated with BASH_MCP_MODE (see Configuration).

Which tool should I use?

Pick the structured tool that matches your intent instead of reaching for a raw command. The list_guidance tool returns this same index as JSON (filter by intent or category), so agents can self-select without the README.

I want to…Use thisInstead of
diagnose a crashing or failing Kubernetes podkube_diagnose_podkubectl describe pod, kubectl logs
find all not-ready or failing pods in a namespacekube_pod_failure_summarykubectl get pods, `kubectl get pods \grep`
check a deployment's rollout healthkube_deployment_statuskubectl rollout status, kubectl get deployment
understand recent cluster eventskube_events_summarykubectl get events
summarize the changes in a Terraform plantf_plan_summaryterraform plan, terraform show
review the current feature branch before a PRgit_pr_contextgit diff, git log, git status
understand the overall state of a repositoryrepo_health_summarygit status, git log --oneline
read a file's structure without loading the full bodyoutlinecat (entire file), cat
read one region of a large filecatcat (whole file), sed -n '10,40p'
keep a broad search from flooding the contextrg`rg \head`
search for exact code references or symbolsrggrep -r, rg
check whether a pull request's CI checks passgh_pr_checksgh pr checks, gh pr view
find out why a CI / GitHub Actions run failedgh_run_failure_summarygh run view --log-failed, gh run list
check whether a GitLab pipeline or merge request's jobs passglab_ci_statusglab ci get, glab ci status
find out why a GitLab CI pipeline failedglab_pipeline_failure_summaryglab ci trace, glab ci view
triage why a Helm release is unhealthyhelm_release_triagehelm status, helm get values
check whether an ArgoCD app is healthy and in syncargo_app_health_summaryargocd app get, argocd app list
validate a Liquibase changelog for errorsliquibase_validateliquibase validate
preview the SQL Liquibase would run for pending changesetsliquibase_update_sqlliquibase updateSQL, `liquibase updateSQL \grep`
list Liquibase changesets not yet applied to the databaseliquibase_statusliquibase status --verbose
lint a shell script for bugs and quoting issuesbash_lintshellcheck, shellcheck -f json1
run a bats or shell test suitebash_testbats, bash test.sh
discover which CLIs are installed before calling a toolcheck_environmentwhich, --version

Tools

📖 [Full tool reference → `docs/tools.md`](docs/tools.md) — generated from the

registered tools (inputs, outputs, and the raw command each one approximates).

Regenerate with npm run docs:tools.

Environment
ToolDescription
check_environmentReport which CLIs are installed (and their versions) so you can pick the right tool before calling it.
list_guidanceReturn an intent → preferred-tool index so you can pick the right bash-mcp tool for a goal.
Filesystem
ToolDescription
lsList files in a directory.
treeShow directory structure as a compact tree.
duShow disk usage for paths.
find_filesFind files by name pattern, type, or modification time.
Search
ToolDescription
rgSearch file contents with ripgrep.
globFind files matching a glob pattern.
File
ToolDescription
catRead one or more files with line numbers and smart truncation.
outlineShow the structural outline of a file — function/class names, top-level comments, imports.
Git
ToolDescription
git_statusStructured git status: branch, staged/unstaged/untracked files.
git_logStructured git log: commit hash, author, date, message.
git_diffStructured git diff: files changed with insertions/deletions counts.
git_branchesList git branches.
repo_health_summaryOne-call snapshot of a git working tree: branch, ahead/behind vs upstream, staged/unstaged/untracked counts, recent commits, and the uncommitted diffstat.
git_pr_contextCollect the commits and file changes of a branch vs a base ref (for writing a PR description): commit list, changed files with status, and a diffstat over base...head.
git_diff_contentShow git diff with structured patch content.
GitHub
ToolDescription
gh_pr_checksReport a pull request's CI checks as counts per state plus the failing and pending checks.
gh_run_failure_summaryDiagnose a GitHub Actions run in one call: status, the failed jobs and steps, and the ##[error] lines from the failed log as evidence.
GitLab
ToolDescription
glab_ci_statusReport a GitLab pipeline's jobs as counts per status plus the failed, running and pending jobs.

| glab_pipeline_failure_summary | Diagnose a GitLab pipeline in one call: status, the failed jobs and why GitLab says they failed, and the last script li

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx