Token导航 LogoToken导航

MCP Server · 开发工具

MCP Client Base

为VSCode扩展提供统一的模型上下文协议客户端基础功能,包括超时处理、自动重新同步和连接状态管理。

未说明官方级别未说明来源级核验工具 0
VSCode扩展错误处理TypeScript

快速开始

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

工具数量

0

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

MCP Client Base 属于开发工具类 MCP Server,公开资料标注 0 个工具,通过传输方式未标注接入,客户端适配情况以官方文档为准,没有现成的安装命令;接入前先确认权限范围。

分类

开发工具

传输方式

未说明

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

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

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

上手步骤

  1. 1

    先确认运行方式

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

  2. 2

    获取服务

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

  3. 3

    写入客户端配置

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

  4. 4

    验证是否可用

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

接入前确认

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

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

详细介绍

@人工智能功能套件/mcp客户群

共享MCP(模型上下文协议)客户端基类为VSCode扩展提供一致的超时处理、自动重新同步和连接状态管理。

特性

  • 可配置超时:初始化与标准请求的超时值不同
  • 自动重新同步:发生超时时的指数回退重试逻辑
  • 连接状态管理:跟踪并通知侦听器连接状态更改
  • 一致的错误处理:统一的错误消息和恢复选项
  • 可扩展架构:扩展可以自定义的抽象基类
  • 综合录井:带有时间戳和请求ID的结构化日志记录
  • 诊断命令:用于解决连接问题的内置命令

安装

npm install @ai-capabilities-suite/mcp-client-base

快速开始

import {
  BaseMCPClient,
  MCPClientConfig,
} from "@ai-capabilities-suite/mcp-client-base";
import * as vscode from "vscode";

// 1. Extend BaseMCPClient
export class MyMCPClient extends BaseMCPClient {
  protected getServerCommand() {
    return { command: "npx", args: ["-y", "@my-org/my-mcp-server"] };
  }

  protected getServerEnv() {
    return { ...process.env };
  }

  protected async onServerReady() {
    // Extension-specific initialization
  }
}

// 2. Create and start the client
const outputChannel = vscode.window.createOutputChannel("My Extension", {
  log: true,
});
const client = new MyMCPClient(outputChannel);
await client.start();

// 3. Use the client
const result = await client.callTool("my_tool", { param: "value" });

文档

关键概念

连接状态

客户端通过状态机跟踪连接状态:

  • DISCONNECTED -未连接到服务器
  • CONNECTING -正在尝试建立连接
  • CONNECTED -已成功连接并准备就绪
  • TIMEOUT_RETRYING -发生超时,正在尝试重新同步
  • ERROR -发生不可恢复的错误

超时处理

不同的请求类型具有不同的超时值:

  • 初始化:60秒(服务器启动可能很慢)
  • 标准请求:30秒(正常操作)
  • 工具列表:60秒(可能涉及发现)

重新同步

当初始化过程中发生超时时,客户端会自动尝试使用指数退避重新同步:

  1. 2秒后首次重试
  2. 3秒后第二次重试(2×1.5)
  3. 4.5秒后第三次重试(3×1.5)

使用示例

基本扩展

import { BaseMCPClient } from "@ai-capabilities-suite/mcp-client-base";
import * as vscode from "vscode";

export class MyMCPClient extends BaseMCPClient {
  constructor(outputChannel: vscode.LogOutputChannel) {
    super(outputChannel, {
      timeout: {
        initializationTimeoutMs: 60000,
        standardRequestTimeoutMs: 30000,
        toolsListTimeoutMs: 60000,
      },
      reSync: {
        maxRetries: 3,
        retryDelayMs: 2000,
        backoffMultiplier: 1.5,
      },
      logging: {
        logLevel: "info",
        logCommunication: true,
      },
    });
  }

  protected getServerCommand() {
    return {
      command: "npx",
      args: ["-y", "@my-org/my-mcp-server"],
    };
  }

  protected getServerEnv() {
    return { ...process.env };
  }

  protected async onServerReady() {
    // Verify server is working
    await this.callTool("health_check", {});
  }

  // Extension-specific methods
  async doSomething(params: any): Promise {
    return await this.callTool("my_tool", params);
  }
}

监控连接状态

const client = new MyMCPClient(outputChannel);

// Subscribe to state changes
const disposable = client.onStateChange((status) => {
  console.log(`State: ${status.state}`);
  console.log(`Message: ${status.message}`);
  console.log(`Server Running: ${status.serverProcessRunning}`);

  if (status.state === "ERROR") {
    vscode.window.showErrorMessage(`Connection error: ${status.message}`);
  }
});

await client.start();

// Later: cleanup
disposable.dispose();
client.stop();

使用诊断命令

import { diagnosticCommands } from "@ai-capabilities-suite/mcp-client-base";

// Register your extension
diagnosticCommands.registerExtension({
  name: "my-extension",
  displayName: "My Extension",
  client: myClient,
});

// Reconnect to server
await diagnosticCommands.reconnectToServer("my-extension");

// Restart server
await diagnosticCommands.restartServer("my-extension");

// Get diagnostics
const diag = diagnosticCommands.getDiagnostics("my-extension");
console.log(diagnosticCommands.formatDiagnostics(diag));

// Get all extensions status
const allDiag = diagnosticCommands.getAllDiagnostics();
console.log(diagnosticCommands.formatAllDiagnostics());

配置

默认配置

{
  timeout: {
    initializationTimeoutMs: 60000,  // 60 seconds
    standardRequestTimeoutMs: 30000,  // 30 seconds
    toolsListTimeoutMs: 60000,        // 60 seconds
  },
  reSync: {
    maxRetries: 3,                    // 3 retry attempts
    retryDelayMs: 2000,               // 2 second initial delay
    backoffMultiplier: 1.5,           // 1.5x backoff multiplier
  },
  logging: {
    logLevel: 'info',                 // info level logging
    logCommunication: true,           // log all communication
  },
}

自定义配置

const client = new MyMCPClient(outputChannel, {
  timeout: {
    initializationTimeoutMs: 120000, // 2 minutes for slow servers
    standardRequestTimeoutMs: 45000, // 45 seconds for slow operations
  },
  reSync: {
    maxRetries: 5, // More retry attempts
    retryDelayMs: 1000, // Faster initial retry
    backoffMultiplier: 2.0, // Aggressive backoff
  },
  logging: {
    logLevel: "debug", // Verbose logging
    logCommunication: true,
  },
});

建筑

该包由四个主要部分组成:

  1. BaseMCP客户端 -具有核心功能的抽象基类
  2. 超时管理器 -可配置的超时处理
  3. 连接状态管理器 -连接状态跟踪和通知
  4. 无效的管理器 -具有指数回退的自动重新同步
┌─────────────────────────────────────────────────────────────┐
│              @ai-capabilities-suite/mcp-client-base         │
│                                                              │
│  ┌────────────────────────────────────────────────────────┐ │
│  │              BaseMCPClient (Abstract)                   │ │
│  │  ┌──────────────┐  ┌────────────────┐  ┌───────────┐ │ │
│  │  │   Timeout    │  │ Re-sync Logic  │  │  Request  │ │ │
│  │  │   Manager    │  │                │  │   Queue   │ │ │
│  │  └──────────────┘  └────────────────┘  └───────────┘ │ │
│  │  ┌──────────────────────────────────────────────────┐ │ │
│  │  │        ConnectionStateManager                     │ │ │
│  │  └──────────────────────────────────────────────────┘ │ │
│  └────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
                            ▲
                            │ extends
          ┌─────────────────┼─────────────────┐
          │                 │                  │
┌─────────┴──────┐  ┌──────┴───────┐  ┌──────┴───────┐
│ MCPProcessClient│  │MCPScreenshot │  │MCPDebugger   │
│                 │  │   Client     │  │   Client     │
└─────────────────┘  └──────────────┘  └──────────────┘

测试

该包包括全面的测试:

  • 单元测试 -单独测试单个组件
  • 基于属性的测试 -验证所有输入的正确性属性
  • 集成测试 -测试完整的客户端生命周期

运行测试:

npm test

贡献

欢迎投稿!请确保:

  1. 所有测试均通过
  2. 新功能包括测试
  3. 文档已更新
  4. 代码遵循现有样式

许可证

麻省理工学院

工具与能力

工具数量

0

资源数量

0

提示词数量

0

能力标签

VSCode扩展TypeScript本地部署客户端基础库连接管理自动重试错误处理

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

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

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

先想清楚的地方

  • 公开资料没有可直接复制的安装命令,第一次接入要自己找入口。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 愿意照着官方文档一步步配环境的人。

不太适合

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

同类对比

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

MCP World · 本页

0未说明未标注1 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17

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

常见问题

5 条

MCP Client Base 怎么安装?

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

MCP Client Base 怎么在 Claude Desktop、Cursor 里配置?

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

MCP Client Base 收费吗?

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

MCP Client Base 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

MCP Client Base 支持哪些客户端?

公开资料没有标注具体客户端;能配置本地 MCP 命令的客户端都能接,配置方式参照官方文档。

来源信息

继续浏览同类 MCP