Token导航 LogoToken导航TokenDH.com
Quiet Shell MCP logo
开发工具stdio官方级别未说明来源级核验

Quiet Shell MCP

MCP Server

@codemcp/quiet-shell

quiet-shell是一款智能过滤Shell命令输出的工具,通过可配置模板减少AI代理的上下文消耗,适用于开发测试和构建场景。

工具数

2

提示词数

0

GitHub Stars

3

资源数

0
TypeScriptClaude开发工具Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

mrsimpson

提供方

mrsimpson

最后核验

2026/5/17 20:21

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx @modelcontextprotocol/inspector npx @codemcp/quiet-shell

详细介绍

安静的外壳

MCP服务器,执行带有智能输出过滤的shell命令,以减少AI代理上下文消耗。

问题

当AI编码助手执行shell命令(特别是测试和构建)时,他们会收到数千行详细的输出,这些输出:

  • 消耗有价值的上下文窗口令牌
  • 在噪音中隐藏重要信息(错误、故障)
  • 难以专注于可操作的反馈

示例:运行50个通过和2个失败的测试会生成2000多行输出,但代理只需要显示失败和摘要的约20行。

解决方案

quiet shell使用可配置模板执行命令并智能过滤输出:

  • 正则表达式过滤:仅保留与错误模式匹配的行
  • 尾部段落:始终包括摘要部分
  • 结果解释:快速成功/失败状态
  • 内置模板:为常用工具(tsc、vitest、maven、pulumi)预配置
  • 自定义模板:为每个存储库定义自己的筛选器

安装

npm install -g @codemcp/quiet-shell

或者使用pnpm:

pnpm add -g @codemcp/quiet-shell

MCP客户端配置

克劳德桌面版

添加 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "quiet-shell": {
      "command": "npx",
      "args": ["-y", "@codemcp/quiet-shell"]
    }
  }
}

其他MCP客户端

使用以下命令: npx @codemcp/quiet-shell

服务器按照模型上下文协议规范通过stdio进行通信。

用法

可用工具

execute_command

执行带有可选输出过滤的shell命令。

参数:

  • command (必需):要执行的Shell命令
  • template (可选):筛选器模板名称(使用 list_templates 查看可用)
  • suppress_output_on_success (可选,默认值: true):命令成功时抑制输出(退出代码0)。吃起来 false 即使成功,也要始终展示成果

答复:

{
  "result": "success",
  "exit_code": 0,
  "output": "filtered output here",
  "template_used": "vitest"
}

示例:

// Run tests with filtering
execute_command("npm test", "vitest");
// Returns: only failed tests + summary (~20 lines instead of 2000+)
// If tests pass: output suppressed (default behavior)

// TypeScript compilation
execute_command("tsc --noEmit", "tsc");
// Returns: only type errors + summary
// If compilation succeeds: output suppressed (default behavior)

// Always show output even on success
execute_command("npm test", null, false); // suppress_output_on_success = false
// Returns: complete output regardless of exit code

// Raw output with default suppression
execute_command("echo hello");
// If successful: "Command completed successfully (output suppressed - exit code 0)"

list_templates

列出所有可用的过滤模板及其说明。

答复:

{
  "templates": [
    {
      "name": "vitest",
      "description": "Use when running tests with Vitest - returns failed tests and test summary",
      "include_regex": "(FAIL|ERROR|✖|❯.*failed)",
      "tail_paragraphs": 2
    },
    ...
  ],
  "count": 4
}

内置模板

  • tsc:TypeScript编译器-返回类型错误和摘要
  • 请柬:Vitest测试-返回测试失败和总结
  • maven构建:Maven build-返回构建错误和摘要
  • maven测试:Maven测试-返回测试失败和摘要
  • 膨胀:Pulumi部署-抑制详细的资源进度,仅显示错误、警告、失败和最终摘要

自定义模板

创建 .quiet-shell/config.yaml 在您的存储库中:

templates:
  jest:
    description: "Use when running tests with Jest - returns failed tests and test summary"
    include_regex: "(FAIL|●|✕)"
    tail_paragraphs: 2

  eslint:
    description: "Use when running ESLint - returns linting errors and summary"
    include_regex: "(error|warning|✖)"
    tail_paragraphs: 1

  # Template that always shows success output
  build-with-stats:
    description: "Build command that shows statistics even on success"
    include_regex: "(error|warning|built|compiled)"
    tail_paragraphs: 2
    suppress_output_on_success: false # Override default suppression

特征:

  • 自定义模板扩展了内置模板
  • 自定义模板可以覆盖内置模板(同名)
  • 配置受版本控制,并与团队共享
  • 服务器通过从当前目录向上搜索来发现配置

运作原理

模板结构

每个模板定义:

  • include_regex:匹配重要行的模式(错误、失败)
  • tail_paragraphs:从末尾开始包括的段落数(摘要)
  • description:何时使用此模板(用于代理发现)

过滤算法

  1. 解析 输出为段落(用空行分隔的行组)
  2. 过滤器 线条匹配 include_regex
  3. 提取 最后N段(摘要)
  4. 合并 重复数据删除(保持顺序)
  5. 返回 滤波输出

示例

输入 (2000行):

✓ test 1 passed
✓ test 2 passed
... (48 more passing tests)
✖ test 51 failed
  Expected: true
  Received: false
✖ test 52 failed
  Error: timeout

Tests: 50 passed, 2 failed, 52 total
Time: 5.2s

输出与 vitest 模板 (约10行):

✖ test 51 failed
  Expected: true
  Received: false
✖ test 52 failed
  Error: timeout
Tests: 50 passed, 2 failed, 52 total
Time: 5.2s

发展

Monorepo结构

packages/
  core/          # @codemcp/quiet-shell-core
                 # Reusable filtering logic

  mcp-server/    # @codemcp/quiet-shell
                 # MCP protocol implementation

构建

pnpm install
pnpm build

测试

pnpm test

使用MCP检查员进行测试

npx @modelcontextprotocol/inspector npx @codemcp/quiet-shell

建筑

  • 日志记录器:依赖注入记录器(仅stderr,从不stdout)
  • 模板管理器:使用60s缓存TTL加载配置
  • 令执行器:生成命令,捕获stdout/stderr
  • 输出滤波器:基于段落的正则表达式过滤
  • MCP 服务器:stdio传输,结构化JSON响应

需求

  • Node.js>=18
  • pnpm>=9(用于开发)

许可证

麻省理工学院

贡献

欢迎投稿!本项目使用:

  • 具有严格模式的TypeScript
  • Vitest用于测试
  • ESLint+代码质量预处理
  • 用于monorepo构建的Turbo

学分

模型上下文协议 SDK。

目录标签

目录标签

TypeScriptClaude开发工具Shell命令过滤本地部署开发效率工具AI辅助开发输出优化测试构建

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@codemcp/quiet-shell

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP