使用说明
MCP内存服务器
用于内存管理的MCP服务器,带有进程检查和清理工具。
工具
| 工具 | 说明 |
|---|---|
list_memory_usage |
系统内存摘要(如 free -h) |
list_top_processes |
前N位内存消费者详细信息 |
find_stale_processes |
按年龄、状态、名称模式查找休眠/空闲进程 |
kill_processes |
通过安全检查杀死PID |
安装
克劳德代码
添加到 ~/.config/claude-code/mcp.json:
{
"mcpServers": {
"mcp-memory": {
"command": "nix",
"args": ["run", "github:paolino/mcp-memory-server", "--refresh"]
}
}
}
这 --refresh flag确保您始终获得最新版本。删除它以使用缓存版本更快地启动。
来源
git clone https://github.com/paolino/mcp-memory-server
cd mcp-memory-server
nix develop
just install
just run
用法示例
显示内存使用情况
问克劳德:“显示当前内存使用情况”
查找过时的GHC流程
问克劳德:“查找使用超过100MB的旧GHC或阴谋集团流程”
这叫 find_stale_processes 与:
name_pattern:"ghc|cabal"min_memory_mb:100
终止进程
问克劳德:“杀死这些PID:12345678”
安全检查:
- 拒绝PID 0/1
- 拒绝root拥有的进程(除非以root身份运行)
- 可选的名称确认,以防止杀死错误的进程
- 默认SIGTERM,仅在显式时使用SIGKILL
发展
nix develop
just test # Run tests
just run # Start server
just format # Format code
just lint # Lint code
许可证
麻省理工学院
