基本能力
产品定位
mcp-server-restart 是一个专为 Claude Desktop for Mac 设计的 MCP 服务器,用于简化重启 Claude Desktop 的流程。
核心功能
- 状态查询:
- 提供
claude://status
资源,返回 Claude Desktop 的当前状态(包括运行状态、PID 和时间戳)。 -
返回格式为 JSON,MIME 类型为
application/json
。 -
重启工具:
- 实现
restart_claude
工具,用于安全地重启 Claude Desktop 应用程序。 - 功能包括终止现有进程、启动新实例,并在重启过程中提供进度通知。
适用场景
- 开发调试:在安装或更新 MCP 工具后,需要重启 Claude Desktop 以使更改生效。
- 自动化流程:通过指令或脚本触发 Claude Desktop 的重启,无需手动操作。
工具列表
restart_claude
:- 功能:重启 Claude Desktop 应用程序。
- 特点:安全终止现有进程,启动新实例,并提供进度通知。
常见问题解答
- 如何安装?
- 需要编辑 Claude Desktop 的配置文件
~/Library/Application Support/Claude/claude_desktop_config.json
,添加mcp-server-restart
的配置。 -
可以选择单独安装
mcp-server-restart
或与mcp-installer
一起安装。 -
如何使用?
-
在 Claude Desktop 中发送指令如 "restart Claude" 或 "Hey Claude, install the MCP server named mcp-server-fetch then restart Claude"。
-
如何测试?
- 运行测试套件:
pytest
。
使用教程
使用依赖
- 确保已安装 Node.js 和 npm(用于运行
npx
或uvx
)。 - 确保已安装 Claude Desktop for Mac。
安装教程
选项 1:安装 mcp-installer
和 mcp-server-restart
- 编辑配置文件
~/Library/Application Support/Claude/claude_desktop_config.json
,添加以下内容:
json
{
"mcpServers": {
"mcp-installer": {
"command": "npx",
"args": [
"@anaisbetts/mcp-installer"
]
},
"mcp-server-restart": {
"command": "uvx",
"args": [
"mcp-server-restart"
]
}
}
}
选项 2:仅安装 mcp-server-restart
- 编辑配置文件
~/Library/Application Support/Claude/claude_desktop_config.json
,添加以下内容:
json
{
"mcpServers": {
"mcp-server-restart": {
"command": "uvx",
"args": [
"mcp-server-restart"
]
}
}
}
调试方式
- 运行测试套件:
bash
pytest - 在 Claude Desktop 中发送指令测试重启功能,例如:
- "restart Claude"
- "Hey Claude, install the MCP server named mcp-server-fetch then restart Claude"