Persistent Terminal MCP
P

Persistent Terminal MCP

A TypeScript-based persistent terminal MCP server that supports multi-session management, resume after disconnection, intelligent output compression, and Web visual management, specifically designed for AI assistants to execute long-time tasks
2 points
6.4K

What is the Persistent Terminal MCP Server?

This is a terminal management tool specifically designed for AI assistants, allowing AI assistants such as Claude and Cursor to create and manage long-running terminal sessions. Even if you close the AI conversation window, the commands in the terminal will continue to run in the background, making it ideal for time-consuming tasks such as compilation, downloading, and deployment.

How to use this service?

Simply configure it once in the supported AI client, and then you can directly operate the terminal through natural language commands. For example, tell the AI 'Please run npm install to install dependencies', and the AI will automatically create a terminal session and execute the command.

Applicable Scenarios

Scenarios that require long-running commands, such as project initialization, long-time compilation, file downloading, service deployment, database migration, and automated script execution.

Main Features

Persistent Sessions
Terminal sessions continue to run after the AI client is disconnected, supporting reconnection after disconnection and session recovery
Intelligent Output Management
Supports multiple output reading modes (full/start/end/start and end), automatically estimates the number of tokens, and avoids overly long contexts
Animation Compression
Automatically identifies and compresses progress animations, reducing the noisy output of commands such as npm install and keeping the logs clear
Web Visual Management
Provides a browser-based management interface to view terminal output in real-time and supports multi-session management simultaneously
Automatic Bug Fix
Integrates OpenAI Codex to automatically analyze and fix bugs in the code and generate detailed fix reports
Multi-Client Support
Compatible with mainstream AI assistants such as Claude Desktop, Claude Code, Cursor, and Cline
Advantages
๐Ÿš€ Hands-free: No need for manual supervision for long-time tasks
๐Ÿ”„ Resume after disconnection: Network interruption does not affect task execution
๐ŸŽฏ Intelligent output: Automatically optimizes output content to improve AI processing efficiency
๐ŸŒ Visualization: Intuitively manage all terminals through the Web interface
๐Ÿค– Automation: Integrates Codex to automatically fix bugs
๐Ÿ”ง Easy to configure: Configure once and use for a long time
Limitations
โš ๏ธ Basic terminal operation knowledge is required
โš ๏ธ Some interactive programs may require special handling
โš ๏ธ Codex automatic bug fixing requires OpenAI API access permission
โš ๏ธ Windows configuration is relatively more complex

How to Use

Installation and Configuration
Configure the MCP server in the supported AI client. It is recommended to use the npx method without installing dependencies.
Create a Terminal Session
Tell the AI assistant to create a new terminal session, and you can specify the working directory and Shell type.
Execute Commands
Let the AI run commands in the terminal, supporting all common Shell commands.
Manage Sessions
Perform management operations such as viewing running sessions, reading output, and terminating sessions.

Usage Examples

Project Initialization
After cloning a new project, quickly install all dependencies and start the development server
Long-Time Compilation Task
When compiling a large project, you don't need to wait and can continue with other work
Automatic Bug Fix
When a code bug is found, let Codex automatically analyze and fix it
File Download and Processing
When downloading large files or processing a large amount of data, run it in the background

Frequently Asked Questions

Will the terminal session run continuously? Will it consume too many resources?
Which AI clients are supported?
Can it be used on the Windows system?
Is Codex automatic bug fixing safe?
How to view the historical output of the terminal?
Are interactive programs supported? For example, vim or npm create?

Related Resources

Official Documentation
Complete technical documentation and API reference
Video Tutorial
Function demonstration and usage tutorial
Windows Configuration Guide
Detailed configuration steps for the Windows system
MCP Protocol Official Website
Official documentation of the Model Context Protocol
Problem Feedback
Submit usage problems and feature suggestions

Installation

Copy the following command to your Client for configuration
{
  "mcpServers": {
    "persistent-terminal": {
      "command": "npx",
      "args": ["-y", "persistent-terminal-mcp"],
      "env": {
        "MAX_BUFFER_SIZE": "10000",
        "SESSION_TIMEOUT": "86400000",
        "COMPACT_ANIMATIONS": "true",
        "ANIMATION_THROTTLE_MS": "100"
      }
    }
  }
}

{
  "mcpServers": {
    "persistent-terminal": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "persistent-terminal-mcp"],
      "env": {
        "MAX_BUFFER_SIZE": "10000",
        "SESSION_TIMEOUT": "86400000",
        "COMPACT_ANIMATIONS": "true",
        "ANIMATION_THROTTLE_MS": "100"
      }
    }
  }
}

{
  "mcpServers": {
    "persistent-terminal": {
      "command": "npx",
      "args": ["-y", "persistent-terminal-mcp"],
      "env": {
        "AUTO_START_REST_SERVER": "true",
        "REST_HOST": "0.0.0.0",
        "AUTO_START_TERMINAL_UI": "true",
        "WEB_UI_HOST": "0.0.0.0",
        "WEB_UI_PORT": "3000",
        "AUTO_OPEN_BROWSER": "false",
        "MAX_BUFFER_SIZE": "10000",
        "SESSION_TIMEOUT": "86400000"
      }
    }
  }
}
Note: Your key is sensitive information, do not share it with anyone.

Alternatives

R
Rsdoctor
Rsdoctor is a build analysis tool specifically designed for the Rspack ecosystem, fully compatible with webpack. It provides visual build analysis, multi - dimensional performance diagnosis, and intelligent optimization suggestions to help developers improve build efficiency and engineering quality.
TypeScript
7.6K
5 points
N
Next Devtools MCP
The Next.js development tools MCP server provides Next.js development tools and utilities for AI programming assistants such as Claude and Cursor, including runtime diagnostics, development automation, and document access functions.
TypeScript
8.2K
5 points
T
Testkube
Testkube is a test orchestration and execution framework for cloud-native applications, providing a unified platform to define, run, and analyze tests. It supports existing testing tools and Kubernetes infrastructure.
Go
5.1K
5 points
M
MCP Windbg
An MCP server that integrates AI models with WinDbg/CDB for analyzing Windows crash dump files and remote debugging, supporting natural language interaction to execute debugging commands.
Python
9.4K
5 points
R
Runno
Runno is a collection of JavaScript toolkits for securely running code in multiple programming languages in environments such as browsers and Node.js. It achieves sandboxed execution through WebAssembly and WASI, supports languages such as Python, Ruby, JavaScript, SQLite, C/C++, and provides integration methods such as web components and MCP servers.
TypeScript
7.3K
5 points
N
Netdata
Netdata is an open-source real-time infrastructure monitoring platform that provides second-level metric collection, visualization, machine learning-driven anomaly detection, and automated alerts. It can achieve full-stack monitoring without complex configuration.
Go
8.4K
5 points
M
MCP Server
The Mapbox MCP Server is a model context protocol server implemented in Node.js, providing AI applications with access to Mapbox geospatial APIs, including functions such as geocoding, point - of - interest search, route planning, isochrone analysis, and static map generation.
TypeScript
6.7K
4 points
U
Uniprof
Uniprof is a tool that simplifies CPU performance analysis. It supports multiple programming languages and runtimes, does not require code modification or additional dependencies, and can perform one-click performance profiling and hotspot analysis through Docker containers or the host mode.
TypeScript
8.2K
4.5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
21.4K
4.3 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
17.7K
4.5 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
30.7K
5 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
61.3K
4.3 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
56.8K
4.5 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
27.7K
5 points
C
Context7
Context7 MCP is a service that provides real-time, version-specific documentation and code examples for AI programming assistants. It is directly integrated into prompts through the Model Context Protocol to solve the problem of LLMs using outdated information.
TypeScript
85.3K
4.7 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
41.2K
4.8 points