loading…
Search for a command to run...
loading…
Enables AI agents to launch, monitor, and manage long-running terminal processes with real-time log capture and search functionality. It features automatic log
Enables AI agents to launch, monitor, and manage long-running terminal processes with real-time log capture and search functionality. It features automatic log rotation and graceful process termination to ensure system stability.
MCP server for managing long-running processes and logs. Enables AI agents (Claude Code) to start, stop, and monitor processes with real-time log capture.
# Clone repository
git clone https://github.com/h004888/mcp_terminal_process.git
cd mcp-terminal
# Cài đặt dependencies
npm install
# Build
npm run build
Thêm vào file .claude.json của Claude Code:
Windows: %USERPROFILE%\.claude.json
macOS/Linux: ~/.claude.json
{
"mcpServers": {
"mcp-terminal": {
"command": "node",
"args": ["C:/đường-dẫn/đến/mcp-terminal/dist/index.js"]
}
}
}
Thêm vào file opencode.json của OpenCode:
Đường dẫn mặc định: ~/.config/opencode/opencode.json
{
"mcp": {
"mcp-terminal": {
"type": "local",
"command": ["node", "/đường-dẫn/đến/mcp-terminal/dist/index.js"],
"environment": {},
"timeout": 5000
}
}
}
# Clone the repository
git clone https://github.com/h004888/mcp_terminal_process.git
cd mcp-terminal
# Install dependencies
npm install
# Build
npm run build
Add to your Claude Code .claude.json:
Windows: %USERPROFILE%\.claude.json
macOS/Linux: ~/.claude.json
{
"mcpServers": {
"mcp-terminal": {
"command": "node",
"args": ["C:/path/to/mcp-terminal/dist/index.js"]
}
}
}
After configuration, restart Claude Code to load the MCP server.
Add to your OpenCode opencode.json:
Default location: ~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-terminal": {
"type": "local",
"command": ["node", "/path/to/mcp-terminal/dist/index.js"],
"environment": {},
"timeout": 5000,
"enabled": true
}
}
}
Example with full path (Windows):
{
"mcp": {
"mcp-terminal": {
"type": "local",
"command": ["node", "C:/Users/ADMIN/Downloads/mcp-terminal/dist/index.js"],
"environment": {},
"timeout": 5000,
"enabled": true
}
}
}
Example using npx (if published to npm):
{
"mcp": {
"mcp-terminal": {
"type": "local",
"command": ["npx", "-y", "mcp-terminal"],
"timeout": 5000,
"enabled": true
}
}
}
After configuration, restart OpenCode to load the MCP server.
Start a long-running process.
{
"id": "backend",
"command": "npm run dev",
"cwd": "C:/path/to/project"
}
Parameters:
id (required) - Unique process identifiercommand (required) - Command to executecwd (optional) - Working directoryStop a running process.
{
"id": "backend"
}
Retrieve logs from a process.
{
"id": "backend",
"lines": 100
}
Parameters:
id (required) - Process identifierlines (optional) - Return last N lines onlySearch logs for a keyword or regex.
{
"id": "backend",
"keyword": "ERROR",
"regex": false
}
Parameters:
id (required) - Process identifierkeyword (required) - Search termregex (optional) - Use regex search (default: false)List all running processes.
{}
Returns all currently running processes with their IDs, status, command, and log file paths.
/mcp start_process {"id": "backend", "command": "npm run dev", "cwd": "C:/my-project"}
/mcp get_logs {"id": "backend"}
/mcp search_logs {"id": "backend", "keyword": "Exception"}
/mcp list_processes {}
/mcp stop_process {"id": "backend"}
User (Claude Code) → MCP Protocol → MCP Server → Process Manager → logs/*.log
Components:
Logs are stored in the logs/ directory:
logs/{id}.log - Current active loglogs/{id}.1.log - Rotated log (oldest)Logs are rotated when they exceed 10MB. Maximum 5 rotated files kept per process.
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-terminal": {
"command": "npx",
"args": []
}
}
}