Token导航 LogoToken导航

MCP Server · 运维云端

Must Gather Code Execution MCP

一个基于渐进式披露模式的OpenShift must-gather分析工具,通过智能搜索和按需发现功能,显著减少AI上下文开销并实现无限扩展。

未说明官方级别未说明来源级核验工具 2
代码执行TypeScriptClaude

快速开始

公开资料没有提供安装命令,按仓库或官方文档接入。
作者 / 组织
Prashanth684
提供方
Prashanth684

工具数量

2

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

Must Gather Code Execution MCP 属于运维云端类 MCP Server,公开资料标注 2 个工具,通过传输方式未标注接入,适配 Claude,没有现成的安装命令;接入前要先准备 访问 Token。

分类

运维云端

传输方式

未说明

认证方式

访问 Token

部署方式

公开资料未说明

安装与配置

公开目录没有给出安装命令,需要按仓库 README安装;下面按同类条目的通用流程说明。

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    先确认运行方式

    公开资料没有标注传输方式,先看仓库 README,确认是本地进程还是远程地址。

  2. 2

    获取服务

    公开目录没有给出安装命令,按仓库 README里的步骤安装或获取服务。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 2 个工具,随便调一个只读工具确认能返回结果。

接入前确认

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

公开资料仍需确认:安装命令

详细介绍

必须收集渐进式披露MCP服务器

高效的OpenShift必须使用 Anthropic的渐进式披露模式 用于模型上下文协议(MCP)。

概述

该项目实施 渐进式披露 -该模式将AI上下文开销降低了92%,同时实现了无限的可扩展性。代理通过智能搜索按需发现功能,而不是预先加载所有分析工具。

进化

传统MCP (v1.0):

  • ❌ 直接暴露的11个工具
  • ❌ ~6000个令牌仅用于工具定义
  • ❌ 难以扩展到20-30个工具之外
  • ✅ 代码执行模式(本地数据处理)

渐进呈现 (v2.0-此版本):

  • ✅ 2元工具 为了发现
  • ✅ 约500个代币 用于工具定义(减少92%!)
  • ✅ 扩展到100多种方法 没有上下文惩罚
  • ✅ 智能搜索 按组件、严重性、关键字
  • ✅ 按需型探索
  • ✅ 代码执行模式(本地数据处理)

问题

传统的人工智能代理在必须收集的分析中挣扎:

  • 539MB 数据跨越 5245张图片
  • 加载所有工具会消耗宝贵的上下文
  • 代理商必须提前知道确切的工具名称
  • 无法扩展到全面的分析能力

解决方案

渐进呈现 + 代码执行:

  1. 发现 -按意图(严重性、成分、关键字)搜索分析方法
  2. 探索 -按需获取类型定义
  3. 执行 -编写在本地处理数据的代码
  4. 总结 -只返回见解,不返回原始数据

结果:98%+令牌减少,无限可扩展性,更好的代理体验

建筑

┌─────────────────────────────────────────────────────┐
│  AI Agent (Claude)                                  │
│  ├─ Searches for methods: "degraded operators"     │
│  ├─ Gets type definitions: ClusterOperator         │
│  ├─ Writes analysis code                           │
│  └─ Receives compact results                       │
└─────────────────────────────────────────────────────┘
                      ↓
┌─────────────────────────────────────────────────────┐
│  Progressive Disclosure Layer (2 Meta-Tools)        │
│  ├─ mustGather_searchAnalysis()                    │
│  │  → Returns: method signatures, examples         │
│  │  → Tokens: ~200 per search                      │
│  │                                                  │
│  └─ mustGather_getTypeDefinition()                 │
│     → Returns: TypeScript interfaces               │
│     → Tokens: ~150 per type lookup                 │
└─────────────────────────────────────────────────────┘
                      ↓
┌─────────────────────────────────────────────────────┐
│  Analysis Method Index (11+ methods)                │
│  ├─ getDegradedOperators()                         │
│  ├─ getFailingPods()                               │
│  ├─ getEtcdHealth()                                │
│  └─ ... 8 more (easily extensible to 100+)        │
└─────────────────────────────────────────────────────┘
                      ↓
┌─────────────────────────────────────────────────────┐
│  Code Execution Environment                         │
│  ├─ MustGatherAnalyzer (helper library)            │
│  ├─ Process data locally (no token overhead)       │
│  ├─ Cross-correlate events, logs, resources        │
│  └─ Return only summaries                          │
└─────────────────────────────────────────────────────┘
                      ↓
┌─────────────────────────────────────────────────────┐
│  Must-Gather Data (539MB)                           │
│  ├─ cluster-scoped-resources/                      │
│  ├─ namespaces/                                    │
│  ├─ etcd_info/                                     │
│  └─ host_service_logs/                             │
└─────────────────────────────────────────────────────┘

安装

1.克隆和安装

git clone https://github.com/Prshanth684/must-gather-code-execution-mcp.git
cd must-gather-code-execution-mcp
npm install
npm run build

2.获取必须收集的数据

Collect必须从OpenShift集群收集数据:

oc adm must-gather

这将创建一个类似的目录 must-gather.local.XXXXX/ 包含您的群集诊断。

用法

MCP服务器(推荐)

启动渐进式披露MCP服务器:

export MUST_GATHER_PATH=/path/to/must-gather
npm run start

在Claude桌面中配置(claude_desktop_config.json):

{
  "mcpServers": {
    "must-gather": {
      "command": "node",
      "args": ["/absolute/path/to/must-gather-code-execution-mcp/dist/mcp-server.js"],
      "env": {
        "MUST_GATHER_PATH": "/absolute/path/to/must-gather.local.xxxxx"
      }
    }
  }
}

渐进式披露工作流程

代理交互示例:

User: "What's wrong with my cluster?"

Agent thinks: "I need to discover critical cluster health methods"

Step 1: SEARCH FOR METHODS
→ Uses: mustGather_searchAnalysis({ severity: "critical", scope: "cluster" })
→ Returns:
  - getDegradedOperators(): ClusterOperator[]
  - getEtcdHealth(): EtcdHealth[]
  - usage: "CODE EXECUTION PATTERN: (1) READ library resource, (2) WRITE script, (3) EXECUTE with tsx"
→ Tokens: ~200

Step 2: READ LIBRARY RESOURCE
→ Uses: ReadMcpResourceTool({ server: "must-gather", uri: "file:///must-gather-lib.ts" })
→ Returns: Complete TypeScript library code
→ Tokens: ~1,500 (one-time cost)

Step 3: WRITE ANALYSIS SCRIPT
→ Agent writes must-gather-lib.ts to current directory (from resource)
→ Agent writes analysis script (e.g., analyze-cluster.ts):
  import { MustGatherAnalyzer } from './must-gather-lib.js';
  const analyzer = new MustGatherAnalyzer({ basePath: '/path' });

  const degraded = analyzer.getDegradedOperators();
  const etcd = analyzer.getEtcdHealth().filter(e => !e.health);

  console.log({
    status: degraded.length === 0 && etcd.length === 0 ? 'Healthy' : 'Degraded',
    issues: {
      degradedOperators: degraded.length,
      unhealthyEtcd: etcd.length
    }
  });
→ Tokens: ~100

Step 4: EXECUTE ANALYSIS
→ Uses: Bash({ command: "tsx analyze-cluster.ts" })
→ Returns: Only the concise result object
→ Tokens: ~50

Total: ~1,850 tokens first time, ~350 tokens subsequent (vs ~11,000 with traditional approach!)

关键洞察:图书馆资源只需读取一次,即可用于所有后续分析,这使得多步骤调查非常高效。

代码执行模式详解

MCP服务器使用 嵌入式指令 在工具描述中,指导AI代理完成代码执行工作流程:

  1. 工具说明:The mustGather_searchAnalysis 工具描述明确地告诉代理:

- 先搜索方法 - 读取库资源(uri:file:///must-gather-lib.ts) - 编写一个从导入的TypeScript脚本。/must-father-lib.js - 使用tsx执行脚本

  1. 结果使用说明:当发现方法时,响应包括 usage 带有分步说明的字段:
   CODE EXECUTION PATTERN:
   1. READ the library: Use ReadMcpResourceTool with server="must-gather" and uri="file:///must-gather-lib.ts"
   2. WRITE a TypeScript script in the current directory
   3. EXECUTE with: tsx your-script.ts
  1. 资源描述说明:库资源描述告诉代理:

- 读取资源内容 - 写下来。/must-father-lib.ts - 在分析脚本中从中导入

这种方法将执行指令直接嵌入到工具描述中,以指导LLM完成复杂的工作流程。

可用元工具

1. mustGather_searchAnalysis

按组件、严重性、范围、类别或关键字搜索分析方法。

参数:

  • component (可选):“etcd”、“运算符”、“pod”、“节点”、“事件”、“命名空间”
  • severity (可选):“严重”、“警告”、“信息”
  • scope (可选):“集群”、“命名空间”、“pod”、“节点”、“容器”
  • category (可选):“健康”、“性能”、“配置”、“日志”
  • keyword (可选):自由文本搜索(例如,“降级”、“失败”、“错误”)
  • limit (可选):最大结果(默认10,最大50)

退货:

{
  summary: string,
  totalMethods: number,
  methods: [{
    name: string,
    signature: string,
    description: string,
    component: string,
    severity: string,
    scope: string,
    category: string,
    parameters: Parameter[],
    returns: string,
    example: string  // TypeScript code example
  }],
  usage: string  // How to import and use
}

示例:

// Find critical cluster health methods
searchAnalysis({ severity: "critical", scope: "cluster" })
→ Returns: getDegradedOperators, getEtcdHealth

// Find pod-related methods
searchAnalysis({ component: "pods" })
→ Returns: getPods, getFailingPods, getPodLogs

// Find methods by keyword
searchAnalysis({ keyword: "degraded" })
→ Returns: getDegradedOperators (exact match)

// Find all log-related methods
searchAnalysis({ category: "logs" })
→ Returns: getPodLogs

2. mustGather_getTypeDefinition

获取必须收集的数据结构的TypeScript类型定义。

参数:

  • typeNames (必填):类型名称数组
  • depth (可选):嵌套类型的扩展深度(默认1,最大3)
  • includeExamples (可选):包括示例值

可用类型:

  • Node -群集节点信息
  • Pod -Pod详细信息
  • Container -集装箱信息
  • Event -Kubernetes事件
  • EtcdHealth -Etcd健康状况
  • ClusterOperator -OpenShift操作员状态
  • Condition -标准Kubernetes条件
  • MustGatherAnalyzer -帮助程序库API

退货:

{
  types: [{
    name: string,
    definition: string,  // TypeScript interface
    source: string,      // Source location
    examples?: any       // Sample data (if requested)
  }],
  availableTypes: string[]
}

示例:

// Get Pod type definition
getTypeDefinition({ typeNames: ["Pod"] })

// Get multiple types with nested expansion
getTypeDefinition({
  typeNames: ["Pod", "ClusterOperator"],
  depth: 2
})

// Get types with examples
getTypeDefinition({
  typeNames: ["Node"],
  includeExamples: true
})

帮助程序库API

这 MustGatherAnalyzer 类提供对必须收集的数据的编程访问:

class MustGatherAnalyzer {
  constructor(config: { basePath: string, dataDir?: string });

  // Namespace operations
  listNamespaces(): string[]

  // Node operations
  getNodes(): Node[]

  // Pod operations
  getPods(namespace?: string): Pod[]
  getFailingPods(): Pod[]
  getPodLogs(namespace: string, podName: string, container?: string): string | null

  // Event operations
  getEvents(namespace?: string): Event[]
  getWarningEvents(): Event[]

  // Cluster health
  getEtcdHealth(): EtcdHealth[]
  getEtcdStatus(): any
  getClusterOperators(): ClusterOperator[]
  getDegradedOperators(): ClusterOperator[]
}

所有11种方法都可以通过以下方式进行索引和发现 searchAnalysis.

例子

运行渐进式披露演示

npm run example:progressive-disclosure

这表明:

  1. 按严重程度和范围搜索方法
  2. 按需获取类型定义
  3. 基于关键字的搜索
  4. 特定组件搜索
  5. 令牌使用情况比较

传统分析示例

# Find failing pods with errors
npm run example:failing-pods

# Comprehensive cluster health
npm run example:health

# Correlate pod failures with events
npm run example:correlate

渐进式披露的好处

代币效率

方法初始负载每个查询总计(10个查询)
传统(11种工具)6,00050011,000
传统(50种工具)30,0001,00040,000
渐进呈现5002002,500
减少92%60%77%

可扩展性

  • 传统:每个新工具在初始上下文中添加约500个令牌
  • 渐进呈现:每个新方法向初始上下文添加0个令牌
  • 结果:可以添加100多种方法而不会受到惩罚

更好的代理体验

传统:

Agent: Uses get_degraded_operators()
       ↑ Must know exact name

渐进式披露:

Agent: Searches for "degraded"
       ↓ Discovers getDegradedOperators()
       ↓ Sees example usage
       ↓ Executes with confidence

发现示例

// Intent-based discovery
"find broken components" → getDegradedOperators
"failing pods" → getFailingPods
"etcd problems" → getEtcdHealth

// Component exploration
component: "operators" → getClusterOperators, getDegradedOperators
component: "pods" → getPods, getFailingPods, getPodLogs

// Severity filtering
severity: "critical" → getDegradedOperators, getEtcdHealth
severity: "warning" → getFailingPods, getWarningEvents

建筑细部

方法索引

所有分析方法均已编入索引 src/analysis/methodIndex.ts:

export interface AnalysisMethod {
  name: string;           // Method name
  signature: string;      // TypeScript signature
  description: string;    // What it does
  component: string;      // "etcd", "operators", "pods", etc.
  severity: string;       // "critical", "warning", "info"
  scope: string;          // "cluster", "namespace", "pod", etc.
  category: string;       // "health", "logs", etc.
  parameters: Parameter[];
  returns: string;
  example: string;        // TypeScript code example
  keywords: string[];     // For search
}

搜索算法

位于 src/analysis/search.ts:

  1. 过滤器 按确切的成分、严重程度、范围、类别
  2. 得分 按关键字匹配:

- 姓名匹配:100分 - 名称包含关键字:80分 - 关键字数组匹配:每个20分 - 描述匹配:10分

  1. 排名 按分数(最高者优先)
  2. 限制 结果(默认10,最大50)

发电机类型

位于 src/codegen/typeGenerator.ts:

  • 从库代码生成TypeScript接口
  • 支持嵌套类型扩展(可配置深度)
  • 可选示例值
  • 循环参考预防

添加新的分析方法

渐进式披露使得添加新功能变得轻而易举:

步骤1:将方法添加到库中

// must-gather-lib.ts
export class MustGatherAnalyzer {
  getNetworkPolicies(namespace?: string): NetworkPolicy[] {
    // Implementation
  }
}

第二步:为方法建立索引

// src/analysis/methodIndex.ts
{
  name: 'getNetworkPolicies',
  signature: 'getNetworkPolicies(namespace?: string): NetworkPolicy[]',
  description: 'Get network policies from a namespace or all namespaces',
  component: 'networking',
  severity: 'info',
  scope: 'namespace',
  category: 'configuration',
  parameters: [
    { name: 'namespace', type: 'string', optional: true }
  ],
  returns: 'NetworkPolicy[]',
  example: `const policies = analyzer.getNetworkPolicies('default');`,
  keywords: ['network', 'policy', 'firewall', 'security', 'ingress', 'egress']
}

第三步:完成!

  • 方法可自动发现
  • 可按组件搜索:“网络”
  • 可按关键字搜索:“网络”、“策略”、“安全”
  • 无需更改MCP服务器
  • 无上下文开销

逐步披露实施

此实现使用渐进式披露模式进行必须收集的分析:

特性详细信息
模式渐进式披露
元工具2(搜索分析,获取类型定义)
领域必须收集快照
数据源YAML/JSON文件
方法11+分析方法(可扩展)
代币减少92%(初始),77%(总)
发现按组件、严重性、关键字

从v1.0迁移

突破性变化

v1.0 暴露了11个直接工具:

  • list_namespaces()
  • get_nodes()
  • get_pods(namespace?)
  • …8更多

v2.0 公开了2个元工具:

  • mustGather_searchAnalysis(...)
  • mustGather_getTypeDefinition(...)

迁移路径

之前(v1.0):

// Agent directly calls tool
const pods = await get_pods({ namespace: 'default' });

在(v2.0)之后:

// Agent discovers method
const methods = await searchAnalysis({ component: 'pods' });
// → finds getPods

// Agent writes code
import { MustGatherAnalyzer } from './must-gather-lib.js';
const analyzer = new MustGatherAnalyzer({ basePath: '/path' });
const pods = analyzer.getPods('default');

优点:

  • 代理学会发现能力
  • 更适合复杂的多步分析
  • 扩展到更多方法

注: v1.0服务器另存为 mcp-server.traditional.ts 以供参考。

演出

  • 初始上下文:约500个代币(而传统代币约6000个)
  • 搜索查询:每次搜索约200个令牌
  • 类型查找:每种类型约150个令牌
  • 总工作流程:10个查询约2500个令牌(传统约11000个)

贡献

要添加新的分析方法,请执行以下操作:

  1. 添加实现 must-gather-lib.ts
  2. 将索引条目添加到 src/analysis/methodIndex.ts
  3. 将类型定义添加到 src/codegen/typeGenerator.ts (如果是新类型)
  4. 构建和测试: npm run build && npm run example:progressive-disclosure

许可证

麻省理工学院

相关

引用

如果你在工作中使用这种模式,请引用:

@software{must_gather_progressive_disclosure,
  title = {Must-Gather Progressive Disclosure MCP Server},
  author = {Prashanth Sundararaman},
  year = {2025},
  url = {https://github.com/Prshanth684/must-gather-code-execution-mcp},
  note = {Based on Anthropic's progressive disclosure pattern for MCP}
}

工具与能力

工具数量

2

资源数量

0

提示词数量

0

能力标签

OpenShift分析TypeScript本地部署渐进式披露AI工具集群诊断代码执行

支持客户端

Claude

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

看服务状态

查询容器、日志和监控指标,定位异常。

执行部署变更

在权限范围内触发发布、回滚和环境切换。

核对资源用量

汇总用量,找出闲置和超额的部分。

选择建议

值得选的地方

  • 只提供 2 个工具,职责集中,接入后不容易误操作。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • 公开资料没有可直接复制的安装命令,第一次接入要自己找入口。
  • 需要自备访问 Token,没有凭据没法直接试。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 愿意照着官方文档一步步配环境的人。

不太适合

  • 暂时拿不到访问 Token的人。
  • 希望一条命令就装好、不想看文档的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Must Gather Code Execution MCP

MCP World · 本页

2未说明未标注1 个2026-05-17
Ui Tars Desktop 8a825770

MCP World

0stdio有1 个2026-05-17
Elie222 MCP

MCP World

0未说明未标注1 个2026-05-17
Arizeai Phoenix MCP

MCP World

0stdio有3 个2026-05-17
Unity MCP 87ee506e

MCP World

42HTTP有2 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Must Gather Code Execution MCP 怎么安装?

公开目录没有给出可以直接复制的安装命令,需要按仓库 README里的步骤安装;装好后写进客户端的 MCP 配置再重启。

Must Gather Code Execution MCP 怎么在 Claude Desktop、Cursor 里配置?

它是传输方式未标注,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

Must Gather Code Execution MCP 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Must Gather Code Execution MCP 需要 API Key 吗?

公开资料标注的认证方式是访问 Token,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

Must Gather Code Execution MCP 支持哪些客户端?

公开资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP