客户端配置管理器
一个工具,帮助在不同的AI助手客户端(Cline、Roo Code、WindSurf、Claude)之间管理和同步MCP服务器配置,自动完成从客户端配置文件中获取、列出、添加和删除服务器配置的过程。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"mcp-client-configuration": {
"alwaysAllow": [],
"args": [
"-y",
"@landicefu/mcp-client-configuration-server"
],
"command": "npx",
"disabled": false,
"env": {}
}
}
}
可用工具 (6 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
get_configuration_path 1 个参数 需填 1 项
Get the path to the configuration file for a specific client
必填参数:client
get_configuration 1 个参数 需填 1 项
Get the entire configuration for a specific client
必填参数:client
list_servers 1 个参数 需填 1 项
List all server names configured in a specific client
必填参数:client
get_server_configuration 2 个参数 需填 2 项
Get the configuration for a specific server from a client configuration
必填参数:client、server_name
add_server_configuration 4 个参数 需填 3 项
Add or update a server configuration in a client configuration
必填参数:client、server_name、json_config
remove_server_configuration 2 个参数 需填 2 项
Remove a server configuration from a client configuration
必填参数:client、server_name
服务介绍
MCP 客户端配置服务器
此MCP服务器帮助管理不同MCP客户端的配置。它提供了检索、列出、添加和移除客户端配置文件中的服务器配置的工具。该服务器会根据操作系统(Windows或macOS)及指定的客户端自动检测合适的配置文件路径。
安装
# Install from npm
npm install -g @landicefu/mcp-client-configuration-server
# Or use npx to run without installing
npx @landicefu/mcp-client-configuration-server
配置
要在您的AI助手中使用此MCP服务器,请将其添加到您的MCP设置配置中:
{
"mcpServers": {
"mcp-client-configuration": {
"command": "npx",
"args": ["-y", "@landicefu/mcp-client-configuration-server"],
"env": {},
"disabled": false,
"alwaysAllow": []
}
}
}
支持的客户端
- Cline: 基于Claude的编码助手
- Roo Code: 具备AI能力的代码编辑器
- WindSurf: AI驱动的浏览器
- Claude应用: Claude AI的桌面应用程序
注意: Cursor不再被支持,因为它不使用标准的MCP设置配置文件。Cursor似乎以一种我们难以修改的方式存储其MCP配置,这使得它与本配置服务器基于文件的方法不兼容。
使用方法
此服务器特别适用于以下场景:
- 跨多个客户端管理MCP服务器:配置一次服务器,并部署到多个客户端
- 自动化配置:脚本可以使用此服务器程序化地管理MCP配置
- 故障排除:轻松检查已配置的服务器及其设置
示例:从Roo Code复制服务器配置到Claude应用
这是一个您可以使用的简单提示,通过AI助手将MCP服务器配置从Roo Code复制到Claude桌面应用程序:
Please copy the "brave-search" MCP server configuration from Roo Code to my Claude desktop app.
AI助手会在幕后执行以下步骤:
- 从Roo Code获取服务器配置:
// First, get the server configuration from Roo Code
{
"client": "roo_code",
"server_name": "brave-search"
}
- 然后将相同的配置添加到Claude:
// Then add it to Claude with the same settings
{
"client": "claude",
"server_name": "brave-search",
"json_config": {
// Configuration retrieved from previous step
},
"allow_override": true
}
这样就可以轻松地在不同的AI助手之间同步您的MCP服务器配置了。
工具
get_configuration_path
检索指定客户端的配置文件路径。
参数:
client(必需): 客户端名称 (cline, roo_code, windsurf, claude)
返回:
- 配置文件的绝对路径
get_configuration
检索指定客户端的整个配置。
参数:
client(必需): 客户端名称 (cline, roo_code, windsurf, claude)
返回:
- 来自客户端配置文件的完整JSON配置
list_servers
列出指定客户端配置中的所有服务器名称。
参数:
client(必需): 客户端名称 (cline, roo_code, windsurf, claude)
返回:
- 一个包含服务器名称的数组
get_server_configuration
从客户端配置中检索特定服务器的配置。
参数:
client(必需): 客户端名称 (cline, roo_code, windsurf, claude)server_name(必需): 要检索的服务器名称
返回:
- 指定服务器的 JSON 配置
add_server_configuration
在客户端配置文件中添加或更新服务器配置。
参数:
client(必需): 客户端名称 (cline, roo_code, windsurf, claude)server_name(必需): 要添加或更新的服务器名称json_config(必需): 服务器配置的 JSON 格式
示例:
{
"command": "npx",
"args": ["-y", "@landicefu/android-adb-mcp-server"],
"env": {},
"disabled": false,
"alwaysAllow": []
}
返回:
- 包含更新后配置的成功消息
remove_server_configuration
从客户端配置文件中移除服务器配置。
参数:
client(必需): 客户端名称 (cline, roo_code, windsurf, claude)server_name(必需): 要移除的服务器名称
返回:
- 已移除的配置或未找到服务器的消息
实现细节
- 服务器根据操作系统(Windows 或 macOS)和指定的客户端检测适当的配置文件路径。
- 修改后的所有配置文件都保持美化后的 JSON 格式。
- 提供错误处理,以应对配置文件不存在或无法访问的情况。
- 如果配置文件或目录不存在,服务器会自动创建它们。
- 每个客户端的配置路径:
- Windows:
- Cline:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json - Roo Code:
%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json - WindSurf:
%APPDATA%\WindSurf\mcp_settings.json - Claude:
%APPDATA%\Claude\claude_desktop_config.json
- Cline:
- macOS:
- Cline:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Roo Code:
~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json - WindSurf:
~/.codeium/windsurf/mcp_config.json - Claude:
~/Library/Application Support/Claude/claude_desktop_config.json
- Cline:
- Windows:
故障排除
常见问题
-
找不到配置文件
- 在添加新服务器时,如果配置文件不存在,将自动创建。
- 对于其他操作,如果配置文件不存在,您将收到错误消息。
-
服务器已存在
- 当添加一个已存在的服务器时,需要将
allow_override设置为true才能更新它。 - 示例:
{ "client": "cline", "server_name": "existing-server", "json_config": { /* 新配置 */ }, "allow_override": true }
- 当添加一个已存在的服务器时,需要将
-
不支持的平台
- 目前仅支持 Windows 和 macOS。
- 将来可能会增加对 Linux 的支持。
最佳实践
- 在尝试更新或移除服务器之前,始终检查该服务器是否存在。
- 在客户端中使用一致的服务器名称,以便于管理。
- 考虑在服务器配置中使用环境变量来存储敏感信息。