MCP客户端功能
此软件包致力于成为最新的数据库 全部 模型上下文协议(MCP) 客户及其能力, 使MCP服务器了解MCP客户端支持哪些功能以及如何响应 以提供最佳的用户和代理体验。 遗憾的是,在初始握手过程中,MCP协议的能力协商 这还不够——见 背景 详情请见下文。
换句话说,这个包是 这 社区MCP客户端 桌子。
运作原理
此包提供了一个JSON文件,名为 mcp-clients.json 它列出了所有已知的MCP客户端、它们的元数据和功能。 它是一个单一的JSON文件,使多种编程语言能够轻松访问数据,同时启用TypeScript类型安全 对于NPM包。
JSON文件包含一个对象,其中键是客户端名称,值是一个包含MCP客户端信息的对象:
{
// Client name corresponds to `params.clientInfo.name` from the MCP client's `initialize` request, e.g. "ExampleClient"
"": {
// Display name of the MCP client, e.g. "Example Client"
title: string,
// URL to the homepage of the client
url: string,
// Corresponds to `params.protocolVersion` from the MCP client's `initialize` request, e.g. "2024-11-05"
protocolVersion: string,
// Present if the client supports accessing server resources,
// whether it can handle their dynamic changes, and whether it can subscribe to resource updates
resources?: { listChanged?: boolean, subscribe?: boolean },
// Present if the client supports accessing server prompts,
// and whether it can handle their dynamic changes
prompts?: { listChanged?: boolean },
// Present if the client supports accessing server tools,
// and whether it can handle their dynamic changes.
tools?: { listChanged?: boolean },
// Present if the client supports elicitation from the server.
elicitation?: object,
// Present if the client supports sampling from an LLM.
sampling?: object,
// Present if the client supports listing its roots,
// and whether it can notify the server about their dynamic changes
roots?: { listChanged?: boolean },
// Present if the client can handle server's argument autocompletion suggestions.
completions?: object,
// Present if the client supports reading log messages from the server.
logging?: object,
},
"": { ... },
...
}请注意,客户端对象的灵感来自MCP ClientCapabilites 和 ServerCapabilites 物体, 并且各个字段类型是兼容的。将来可能会添加其他字段。
重要:MCP服务器必须始终对从MCP客户端接收到的信息进行优先级排序 initalize 请求 通过 params.capabilities 字段(类型 ClientCapabilites) 此软件包提供的功能信息,因为它总是更准确!
客户端版本控制
对于每个唯一的客户端名称,JSON文件只包含一条记录,表示有关 最新公开发布。 这是假设大多数用户将升级到MCP客户端的最新版本, 尤其是如果事情不顺利的话。
这 protocolVersion 仅用作粗略检查: 如果从MCP客户端收到版本 与JSON文件中提供的版本不匹配, MCP服务器应该忽略JSON文件提供的任何信息,因为它显然已经过时。
此时,软件包完全忽略了 clientInfo.version 场,因为 关于客户端版本和功能的信息非常稀少,并且 大多数客户端无论如何都不使用版本。这在未来可能会改变。
支持的客户
| 显示名称 | 资源 | 提示 | 工具 | 发现 | 采样 | 任务 | 根 | 引出 |
|---|---|---|---|---|---|---|---|---|
| Alpic游乐场 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| Amazon Q开发者命令行界面 | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| AmpCode | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
| 指定MCP客户端 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 街机 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| ChatGPT | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 樱桃工作室 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 克劳德代码 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
| Claude.ai | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 克莱恩 | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 继续CLI客户端 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 心动 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
| 光标 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ |
| 灰尘 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 工厂CLI | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Gemini CLI | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| GitGuardian 的 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | |
| ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | |
| 格拉玛 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| 谷歌反重力 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
| 鹅 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Jan AI | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| JetBrains AI 助手 | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ | ✅ |
| ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ | ✅ | |
| 基洛代码 | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Librechat | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| LobeHub | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 制作MCP客户端 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Mistral AI:在线聊天 | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ | ✅ |
| N8N MCP客户端 | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| OpenAI Codex | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| 开放代码 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 邮递员 | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ |
| 光线投射 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
| 鲁代码 | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Visual Studio Code | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Windsurf编辑器 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Zed编辑 | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
栏目说明
- 资源:客户端是否支持访问服务器资源。资源允许客户端浏览文件、数据库或MCP服务器提供的其他数据并与之交互。
- 提示:客户端是否支持访问服务器提示。提示是可重用的提示模板,客户端可以调用这些模板从服务器获取结构化响应。
- 工具:客户端是否支持访问服务器工具。工具是客户端可以调用以在服务器端执行操作的函数。
- 发现:客户端是否支持通过以下方式进行动态工具发现
notifications/tools/list_changed通知。这允许在连接处于活动状态时添加/删除工具。 - 采样:客户端是否支持从LLM采样。这允许服务器请求客户端使用其语言模型生成文本。
- 任务:客户端是否支持任务增强工具调用。这使得异步执行成为可能,服务器可以在任务完成后轮询任务状态并检索结果,这对于昂贵或长时间运行的操作非常有用。
- 根:客户端是否支持管理根目录。根定义了客户端希望服务器访问的工作区或目录。
- 引出:客户端是否支持从服务器获取。这允许服务器在交互过程中向客户端请求其他信息或澄清。
用法
Node.js
安装 通过运行:
npm install mcp-client-capabilitiesTypeScript示例
import { mcpClients } from 'mcp-client-capabilities';
const claudeClient = mcpClients['claude-ai'];
console.log('Claude AI metadata and capabilities:', claudeClient);
console.log('Display name:', claudeClient.title);
// List all available clients
console.log('Available clients:', Object.keys(mcpClients));JavaScript示例
const { mcpClients } = require('mcp-client-capabilities');
const claudeClient = mcpClients['claude-ai'];
console.log('Claude AI metadata and capabilities:', claudeClient);
console.log('Display name:', claudeClient.title);
// List all available clients
console.log('Available clients:', Object.keys(mcpClients));python
安装 PyPI包 通过运行:
pip install mcp-client-capabilitiesPython示例
from mcp_client_capabilities import mcp_clients
claude_client = mcp_clients['claude-ai']
print('Claude AI metadata and capabilities:', claude_client)
print('Display name:', claude_client['title'])
# List all available clients
print('Available clients:', mcp_clients.keys())其他语言
你可以把生的拿来 mcp-clients.json 文件来自以下URL:
https://raw.githubusercontent.com/apify/mcp-client-capabilities/refs/heads/master/src/mcp_client_capabilities/mcp-clients.json
背景
当MCP客户端 连接 到MCP服务器, 它必须发送一个 initialize 请求例如:
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {
"roots": { "listChanged": true },
"sampling": {},
"elicitation": {}
},
"clientInfo": {
"name": "ExampleClient",
"title": "Example Client Display Name",
"version": "1.0.0"
}
}
}然后,MCP服务器必须用以下消息进行响应:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2024-11-05",
"capabilities": {
"logging": {},
"prompts": { "listChanged": true },
"resources": { "subscribe": true, "listChanged": true },
"tools": { "listChanged": true }
},
"serverInfo": {
"name": "ExampleServer",
"title": "Example Server Display Name",
"version": "1.0.0"
},
"instructions": "Optional instructions for the client"
}
}不幸的是,这 能力协商 对于MCP服务器来说,完全理解客户端支持的功能是不够的。 例如,服务器将不知道客户端是否支持通过 notifications/tools/list_changed 通知, 或者它是否应用了初始服务器 instructions 模型上下文。但这些信息对于服务器来说至关重要 了解他们可以向客户端提供什么接口,例如他们是否应该提供用于动态发现和调用的替代工具, 或者将指令填入工具描述中。
MCP的这种局限性导致了“最低公分母”方法,其中服务器仅采用基本的MCP 他们可以肯定大多数客户支持的功能。最终这导致MCP协议的停滞, 其中服务器和客户端都没有采用最新协议特征的动机。
虽然有MCP标准提案,如 1981年9月13日 为了在协议层面解决这个问题,这些需要时间才能被MCP客户端批准和广泛采用。 因此,我们发布此软件包,希望加快MCP生态系统的发展。
贡献者
我们非常感谢社区为MCP客户名单及其能力所做的贡献 完整且最新。要添加新客户端或更新现有客户端,只需编辑 src/mcp-clients.json 文件 并提交拉取请求:
- 拉取请求应包含一些证据来支持MCP客户端功能的存在,例如屏幕截图
从用法、源代码链接或官方文档。
- 理想情况下,每个拉取请求只添加或更新一个MCP客户端,使其更易于管理。
- 按客户姓名的字母顺序排列。
多亏了 Alpic 用于从日志中贡献客户端列表。
发展
构建过程包括验证,以确保JSON与TypeScript接口匹配。
# Validate the JSON file structure
npm run test
# Build the project (includes validation)
npm run build
# Run example
npm run example正在检索客户端信息
为了从MCP初始化请求中轻松检索客户端名称和版本以添加或更新客户端功能,您可以使用netcat和ngrok的简单设置:
- 生成一个netcat监听器:
nc -lvp 3001 - 通过ngrok将其暴露在互联网上:
ngrok http 3001 - 运行MCP客户端并连接到您的ngrok URL
在netcat终端中,您将看到 initialize 包含客户端信息的请求,例如:
{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {
"sampling": {},
"elicitation": {},
"roots": { "listChanged": true }
},
"clientInfo": {
"name": "mcp-inspector",
"version": "0.16.5"
}
}
}API
类型
McpClientRecord-MCP客户端的完整功能集,具有强制性title和url领域ClientsIndex-客户端对象结构的类型
出口
mcpClients-包含按客户端名称索引的所有客户端功能的对象- 来自的所有TypeScript接口
types.ts
今后的工作
- 添加来自的所有客户端https://modelcontextprotocol.io/clients#feature-具有精确细节的支持矩阵
- 为Python添加SDK
- 创建一个公共测试MCP服务器来探测客户端功能
