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

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

V
Vestige
Vestige is an AI memory engine based on cognitive science. By implementing 29 neuroscience modules such as prediction error gating, FSRS - 6 spaced repetition, and memory dreaming, it provides long - term memory capabilities for AI. It includes a 3D visualization dashboard and 21 MCP tools, runs completely locally, and does not require the cloud.
Rust
9.6K
4.5 points
M
Moltbrain
MoltBrain is a long-term memory layer plugin designed for OpenClaw, MoltBook, and Claude Code, capable of automatically learning and recalling project context, providing intelligent search, observation recording, analysis statistics, and persistent storage functions.
TypeScript
10.2K
4.5 points
B
Bm.md
A feature-rich Markdown typesetting tool that supports multiple style themes and platform adaptation, providing real-time editing preview, image export, and API integration capabilities
TypeScript
14.9K
5 points
S
Security Detections MCP
Security Detections MCP is a server based on the Model Context Protocol that allows LLMs to query a unified security detection rule database covering Sigma, Splunk ESCU, Elastic, and KQL formats. The latest version 3.0 is upgraded to an autonomous detection engineering platform that can automatically extract TTPs from threat intelligence, analyze coverage gaps, generate SIEM-native format detection rules, run tests, and verify. The project includes over 71 tools, 11 pre-built workflow prompts, and a knowledge graph system, supporting multiple SIEM platforms.
TypeScript
6.7K
4 points
P
Paperbanana
Python
10.0K
5 points
B
Better Icons
An MCP server and CLI tool that provides search and retrieval of over 200,000 icons, supports more than 150 icon libraries, and helps AI assistants and developers quickly obtain and use icons.
TypeScript
8.7K
4.5 points
A
Assistant Ui
assistant - ui is an open - source TypeScript/React library for quickly building production - grade AI chat interfaces, providing composable UI components, streaming responses, accessibility, etc., and supporting multiple AI backends and models.
TypeScript
10.0K
5 points
A
Apify MCP Server
The Apify MCP Server is a tool based on the Model Context Protocol (MCP) that allows AI assistants to extract data from websites such as social media, search engines, and e-commerce through thousands of ready-to-use crawlers, scrapers, and automation tools (Apify Actors). It supports OAuth and Skyfire proxy payment and can be integrated into MCP clients such as Claude and VS Code through HTTPS endpoints or local stdio.
TypeScript
8.9K
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
28.5K
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
81.7K
4.3 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
38.2K
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
23.9K
4.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
69.7K
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#
37.5K
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
56.5K
4.8 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
106.3K
4.7 points