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
4.2K

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

A
Acemcp
Acemcp is an MCP server for codebase indexing and semantic search, supporting automatic incremental indexing, multi-encoding file processing, .gitignore integration, and a Web management interface, helping developers quickly search for and understand code context.
Python
8.1K
5 points
B
Blueprint MCP
Blueprint MCP is a chart generation tool based on the Arcade ecosystem. It uses technologies such as Nano Banana Pro to automatically generate visual charts such as architecture diagrams and flowcharts by analyzing codebases and system architectures, helping developers understand complex systems.
Python
7.4K
4 points
M
MCP Agent Mail
MCP Agent Mail is a mail - based coordination layer designed for AI programming agents, providing identity management, message sending and receiving, file reservation, and search functions, supporting asynchronous collaboration and conflict avoidance among multiple agents.
Python
9.4K
5 points
M
MCP
The Microsoft official MCP server provides search and access functions for the latest Microsoft technical documentation for AI assistants
11.7K
5 points
A
Aderyn
Aderyn is an open - source Solidity smart contract static analysis tool written in Rust, which helps developers and security researchers discover vulnerabilities in Solidity code. It supports Foundry and Hardhat projects, can generate reports in multiple formats, and provides a VSCode extension.
Rust
10.5K
5 points
D
Devtools Debugger MCP
The Node.js Debugger MCP server provides complete debugging capabilities based on the Chrome DevTools protocol, including breakpoint setting, stepping execution, variable inspection, and expression evaluation.
TypeScript
9.9K
4 points
S
Scrapling
Scrapling is an adaptive web scraping library that can automatically learn website changes and re - locate elements. It supports multiple scraping methods and AI integration, providing high - performance parsing and a developer - friendly experience.
Python
11.5K
5 points
M
Mcpjungle
MCPJungle is a self-hosted MCP gateway used to centrally manage and proxy multiple MCP servers, providing a unified tool access interface for AI agents.
Go
0
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
28.0K
5 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.4K
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
19.0K
4.3 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
53.8K
4.3 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#
22.4K
5 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
51.2K
4.5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
18.1K
4.5 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
36.7K
4.8 points