envmgr-mcp-server
# envmgr-mcp-server
通过 SSH 和浏览器访问管理多套命名环境的 MCP 服务器,供 Claude 等 LLM 直接调用。
提供三个工具:
- `envmgr_list` — 列出所有已配置环境(支持按 `type` 过滤)
- `envmgr_ssh` — 在指定环境上通过 SSH 执行 shell 命令
- `envmgr_browser` — 返回指定环境的浏览器 URL 和登录凭据(供 Playwright / chrome-devtools-mcp 使用)
---
## 安装
```bash
npm install -g @kikilight/envmgr-mcp-server
claude mcp add -s user envmgr-mcp-server -- envmgr-mcp-server
```
完成后**重启 Claude Code** 即可使用。
> 升级到新版本:`npm install -g @kikilight/envmgr-mcp-server@latest`
---
## 配置环境
首次运行时,若未找到配置文件,服务会自动生成一份示例配置:
- Windows: `%USERPROFILE%\.config\envmgr\envs.json`
- macOS / Linux: `~/.config/envmgr/envs.json`
按需编辑该文件即可,格式如下:
```json
{
"envs": {
"prod": {
"type": "production",
"description": "生产环境",
"ssh": {
"host": "10.0.0.1",
"user": "root",
"password": "yourpassword",
"port": 22
},
"browser": {
"url": "https://admin.example.com",
"username": "admin",
"password": "yourpassword"
}
}
}
}
```
`ssh` 和 `browser` 均为可选,一个环境可同时拥有两者或只有其一。
---
## 开发 & 打包(开发者)
```bash
npm install
npm run build # tsc 编译 → dist/
npm run dev # tsx watch 模式,自动重载
```
发布到 npm:
```bash
npm run build
npm publish
```
TDQS
Scored across 3 tools
Each tool serves a distinct purpose: envmgr_list enumerates environments, envmgr_ssh executes commands, and envmgr_browser provides browser access credentials. The descriptions clearly separate these functions with no overlapping scope.
All tools share the envmgr_ prefix, making the namespace clear. The second part mixes a verb (list) with nouns (ssh, browser), which is a minor inconsistency, but the pattern remains predictable and readable.
With only three tools, the server is tightly scoped to its purpose of providing environmental access. Each tool is necessary and the count is not excessive or inadequate for the domain.
The server covers the primary lifecycle of listing environments and accessing them via SSH or browser. Minor gaps such as environment add/remove or update exist, but these are likely managed externally via config files, so the surface is sufficient for its intended use.