Execute commands in visible VSCode terminal tabs with output capture and session reuse.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
MCP server that executes commands in visible VSCode terminal tabs with full output capture. Unlike inline execution, every command runs in a real terminal you can see, scroll, and interact with.
run tool automatically reuses idle sessions, creating new terminals only when needed.waitForCompletion: false, then poll output incrementally with read.agentId to keep parallel agent workloads separated.Add to your .vscode/mcp.json:
Add to your .cursor/mcp.json:
Add to your claude_desktop_config.json:
After installation, try asking:
Run
ls -lain the terminal
You should see a new terminal tab open in VSCode with the command output.
run
exec

| Tool | Description |
|---|---|
run | Create (or reuse) a terminal and execute a command in one step. Returns clean output with exit code. |
| Tool | Description |
|---|---|
create | Create a new visible terminal session. Returns a sessionId. |
exec | Execute a command in an existing session and capture output. |
read | Read output from a session with pagination. Supports incremental reads and tail mode (offset: -N). |
input | Send text to an interactive terminal (prompts, REPLs, confirmations). |
list | List active sessions. Optionally filter by agentId. |
close | Close a terminal session and its VSCode tab. |
The run tool handles everything β creates a terminal if needed, executes, and returns clean output:
For builds, deployments, or any command that takes a while:
The agent will:
run with waitForCompletion: false β returns immediatelyread with offset: -10 to check the last 10 linesFor commands that need user input:
The agent will:
run with npm initread to see the promptinput to send the answerSubagents can work in isolated terminals using agentId:
Each subagent gets its own terminal tagged with its agentId, preventing output from mixing.
The extension reads configuration from VSCode settings under terminalMcp.*:
| Setting | Type | Default | Description |
|---|---|---|---|
terminalMcp.maxSessions | number | 10 | Maximum concurrent terminal sessions |
terminalMcp.commandTimeout | number | 30000 | Default command timeout in ms |
terminalMcp.maxOutputLines | number | 5000 | Max lines kept in output buffer per session |
terminalMcp.idleTimeout | number | 1800000 | Close idle sessions after this many ms (0 = disabled) |
terminalMcp.blockedCommands | string[] | ["rm -rf /"] | Commands that will be rejected |
LLM agents like Claude Code have a built-in Bash tool that executes commands inline within the chat. The output is embedded in the conversation and hard to read, especially for commands with verbose output. We recommend telling the agent to prefer this MCP over its built-in Bash tool.
Add the following to your project's CLAUDE.md (or equivalent instructions file):
Why this matters:
| Built-in Bash | BashTerm MCP | |
|---|---|---|
| Output visibility | Embedded in chat, hard to scroll | Visible in VSCode terminal tab |
| Real-time feedback | User sees nothing until command finishes | User watches output live |
| Long-running commands | Blocks the conversation until timeout | Fire-and-forget + polling |
| Session state | Each command is isolated | Persistent sessions with history |
| Interactive commands | Not supported | Send input to prompts/REPLs |
VSCode aggressively caches extensions in memory. When developing locally, code --install-extension and even "Developer: Reload Window" may not reload your changes. Use this workflow:
After modifying source files, build and copy directly into the installed extension directory:
Then run "Developer: Reload Window" (Ctrl+Shift+P).
If VSCode still uses old code:
When read returns output that exceeds the MCP client's token limit, the system automatically saves the full output to a temporary JSON file and returns the file path in the error message.
To extract the relevant content:
The file format is JSON: [{"type": "text", "text": "..."}]
This commonly happens with commands that produce heavy TUI output (progress bars, ANSI escape codes). Use smaller offset values (e.g., offset: -20 instead of offset: -100) to reduce the captured output size.
mcp-entry.js) is spawned by the MCP client and bridges JSON-RPC stdio with the IPC socketwaitForCompletion: false not workingSee CHANGELOG.md for full history.
MIT
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/vscode-terminal-mcp)<a href="https://allmcps.com/mcp/vscode-terminal-mcp"><img src="https://allmcps.com/api/badge/vscode-terminal-mcp?style=directory" alt="Vscode Terminal MCP on AllMCPs" /></a>