Menager MCP Server
Menager MCP Server

menager 是一个基于 TypeScript 的 Model Context Protocol (MCP) 服务器,专为会话间终端编排而设计。它使 AI 代理会话(或人工操作员)能够充当主控制平面,通过标准 POSIX 伪终端(pty)创建、监控、驱动并挂接子终端封装器(CLI 工具、辅助 AI 代理、交互式 Shell 或多语言运行时)。
目录
Related MCP server: pty-mcp
功能特性
多语言封装器多路复用: 通过标准 POSIX 伪终端驱动以任何语言编写的交互式进程。
模拟人工键入: 将文本、控制序列(
SIGINT、EOF、Ctrl+C)和原始按键无缝注入子进程stdin。可预测的事件拦截: 提供带超时保证的非阻塞正则表达式钩子,并支持可选的即时自动响应。
内存受限的可观测性: 为每个会话维护专用环形缓冲区(默认 5,000 行),并实时剥离 ANSI 转义序列,使 LLM 上下文消费更省 token。
严格异步与资源纪律: 事件处理保持纯事件驱动,使用 Node.js 事件发射器和 Promise,并严格执行缓冲区边界以防止内存泄漏。
安装
手动安装
# Clone the repository
git clone <your-repo-url>
cd menager
# Install dependencies (requires build-essential/g++ for node-pty native bindings)
npm install
# Build the project
npm run build使用说明
启动服务器
服务器通过 Stdio 传输方式运行,旨在由 MCP 客户端直接执行。
# Start the server (standard mode)
npm start
# Or run the built file directly
node build/index.js可用工具
session_spawn
创建新的子 PTY 会话。
command(string): 目标二进制文件或可执行程序(例如bash、python3)。必填。args(string[]): 命令行参数。cwd(string): 工作目录路径。env(object): 额外的环境变量。maxBufferLines(number): 内存缓冲区的滚动行数上限(默认 5000)。terminalType(string): 终端仿真类型("dumb"或"xterm-256color",默认"xterm-256color")。name(string): 会话的可选逻辑名称/标签。cols(number): 终端列数(默认 80)。rows(number): 终端行数(默认 24)。
session_wait
阻塞并等待会话正常退出,返回其最终退出码。
sessionId(string): 目标会话 ID。必填。timeoutMs(number): 可选的超时时间(毫秒)。
session_write
将按键、命令或转义序列注入会话的标准输入。
sessionId(string): 目标会话 ID。必填。payload(string): 字符串或控制字符序列。必填。pressEnter(boolean): 向载荷追加\n(默认 false - v4 中的破坏性变更)。pressKey(string): 特殊按键注入(Ctrl+C、Ctrl+D、Enter、Tab、Escape、ArrowUp、ArrowDown)。
session_read
读取目标会话的缓冲输出。
sessionId(string): 目标会话 ID。必填。tailLines(number): 要检索的末尾行数(默认 100)。stripAnsi(boolean): 返回不含 ANSI 码的净化文本(默认 true)。clearBuffer(boolean): 读取后刷新内部缓冲区(默认 false)。offsetLines(number): 从该绝对索引偏移处开始读取行(取代 tailLines)。grepPattern(string): 通过正则表达式字符串匹配预过滤缓冲区行。
session_hook
在会话流上等待特定的正则表达式模式,并支持可选的自动回复。
sessionId(string): 目标会话 ID。必填。pattern(string): 要观察的正则表达式字符串。必填。timeoutMs(number): 超时前的毫秒数(默认 30000)。autoResponse(string): 匹配时立即写入的可选字符串。triggerPayload(string): 在钩子注册 之后 写入载荷(防止并发死锁)。
session_resize
调整目标 PTY 终端的尺寸。
sessionId(string): 目标会话 ID。必填。cols(number): 终端列数。必填。rows(number): 终端行数。必填。
session_signal
向目标会话发送 POSIX 信号(并递归终止进程树)。
sessionId(string): 目标会话 ID。必填。signal(string): 要发送的信号(SIGINT、SIGTERM、SIGKILL)。必填。
session_close
强制终止会话的进程树并立即删除内存缓冲区。
sessionId(string): 目标会话 ID。必填。
session_prune
强制删除会话以释放内存。
status(string): 仅删除具有该状态的会话("running"或"exited")。默认为"exited"。
session_info
返回单个会话的实时元数据和指标。
sessionId(string): 目标会话 ID。必填。
session_list
列出服务器管理的所有活动会话和已结束会话。无需参数。
与 AI 助手集成配置
在 Roo Code 或 Cline 中配置
打开 MCP 设置文件(通常是
cline_mcp_settings.json或config.json)。为标准 stdio 模式添加以下配置:
{
"mcpServers": {
"menager-mcp": {
"command": "node",
"args": ["/path/to/menager/build/index.js"],
"env": {}
}
}
}在 Claude Desktop 中配置
打开
claude_desktop_config.json。添加以下配置:
{
"mcpServers": {
"menager-mcp": {
"command": "node",
"args": ["/path/to/menager/build/index.js"],
"env": {}
}
}
}This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with terminal environments through multiple concurrent PTY sessions. Supports cross-platform terminal operations including command execution, session management, and real-time communication.273MIT
- AlicenseNot gradedqualityDmaintenanceProvides a pseudo-terminal (PTY) interface that allows AI agents to interact with command-line tools requiring interactive prompts. It enables agents to autonomously spawn processes, read output, and send inputs for workflows like database migrations and project scaffolding.221MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI agents with fully interactive terminal sessions, including TUI support, keyboard control, and screen capture across Windows, Linux, and Mac.MIT
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Build, validate, and deploy multi-agent AI solutions from any AI environment.
Runtime permission, approval, and audit layer for AI agent tool execution.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/1999AZZAR/menager-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server