stop_preview
Stop the local preview server for a Hexo blog to free system resources or prepare for deployment.
Instructions
停止正在运行的 Hexo 本地预览服务器
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "stop_preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/hexo-tools.ts:50-66 (handler)Handler implementation for the stop_preview tool which kills the preview process.
server.tool( "stop_preview", "停止正在运行的 Hexo 本地预览服务器", {}, async () => { if (previewProcess) { previewProcess.kill(); previewProcess = null; return { content: [{ type: "text" as const, text: "✅ 预览服务器已停止。" }], }; } return { content: [{ type: "text" as const, text: "ℹ️ 当前没有正在运行的预览服务器。" }], }; } ); - src/tools/hexo-tools.ts:50-66 (registration)Registration of the stop_preview tool within the McpServer.
server.tool( "stop_preview", "停止正在运行的 Hexo 本地预览服务器", {}, async () => { if (previewProcess) { previewProcess.kill(); previewProcess = null; return { content: [{ type: "text" as const, text: "✅ 预览服务器已停止。" }], }; } return { content: [{ type: "text" as const, text: "ℹ️ 当前没有正在运行的预览服务器。" }], }; } );