Vscode Terminal MCP logo

Vscode Terminal MCP

Run and monitor commands in visible VS Code terminals with reusable sessions, interactive input, captured output, and exit codes.

Install Vscode Terminal MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "vscode-terminal-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "vscode-terminal-mcp@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y vscode-terminal-mcp@latest

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 10d ago.

Overview

The vscode-terminal-mcp MCP server lets AI agents run commands in visible VS Code terminal tabs and capture their output. It communicates through MCP over stdio, while a VS Code extension manages terminal sessions through the editor. Agents can reuse sessions, poll long-running commands, interact with prompts, and separate workloads with agent IDs. Reach for it when terminal visibility, persistent state, or interactive command handling matters.

Use cases

  • Run tests in a visible terminal and return their exit status
  • Monitor long-running builds with incremental output reads
  • Answer prompts from interactive installers or REPLs
  • Separate parallel agent workloads with tagged sessions

Key features

  • Visible VS Code terminal execution
  • Reusable persistent terminal sessions
  • Incremental and tail output reads
  • Interactive prompt and REPL input
  • Agent-specific session filtering
  • Configurable limits and blocked commands

Tools7

What Vscode Terminal MCP lets your agent do. Expand a tool for its parameters.

Self-reported~130 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 3d ago

Recent health check succeeded.

5/5 checks healthy over the last 51d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 15d ago via OSV.dev · vscode-terminal-mcp@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
Last commit7mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed7Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Vscode Terminal MCP works

What vscode-terminal-mcp does

The vscode-terminal-mcp MCP server exposes VS Code terminal tabs as MCP tools for command execution and session management. Commands run in terminals that remain visible in the editor, so users can watch output, scroll through logs, and interact with processes directly rather than receiving output only inside an agent conversation.

The run tool combines session creation or reuse with command execution and returns captured output plus an exit code. For more control, an agent can create a session, execute multiple commands in it, read buffered output, send input, list sessions, and close a session and its tab.

How it works

A VS Code extension activates an IPC server on a Unix socket. The MCP entry point communicates with that extension, which creates and manages the visible terminal sessions. The setup therefore requires VS Code to be available for the extension and Node.js to launch the MCP entry point.

Sessions preserve terminal state between commands. The run operation can reuse an idle session instead of opening a new tab. Long-running commands can be started without waiting for completion, then checked with read. Incremental reads support offsets, including negative offsets for retrieving the most recent lines. Interactive workflows use read to inspect a prompt and input to provide a response.

Sessions may be tagged with an agentId. The list tool can filter by that identifier, which helps keep output from parallel agent workloads separated.

Setup and configuration

The vscode-terminal-mcp MCP server requires VS Code 1.93 or newer for the Shell Integration API and Node.js 20 or newer. It can be launched with npx vscode-terminal-mcp@latest.

For Claude Code, add it with claude mcp add BashTerm -- npx vscode-terminal-mcp@latest. VS Code and Copilot use a .vscode/mcp.json entry with a stdio server whose command is npx and whose argument is vscode-terminal-mcp@latest. Cursor and Claude Desktop use their respective MCP configuration files with npx -y vscode-terminal-mcp@latest.

VS Code settings under terminalMcp.* control behavior:

  • terminalMcp.maxSessions limits concurrent sessions and defaults to 10.
  • terminalMcp.commandTimeout sets the default timeout in milliseconds and defaults to 30,000.
  • terminalMcp.maxOutputLines limits buffered lines per session and defaults to 5,000.
  • terminalMcp.idleTimeout closes idle sessions after the configured duration; its default is 1,800,000 ms, and 0 disables it.
  • terminalMcp.blockedCommands defines rejected commands and defaults to rm -rf /.

Tools and capabilities

  • run: Create or reuse a terminal, execute a command, and return output with an exit code.
  • create: Open a visible terminal session and return its sessionId.
  • exec: Run a command in an existing session and capture its output.
  • read: Retrieve session output with pagination, incremental reads, or tail-style offsets.
  • input: Send text to prompts, REPLs, and confirmation dialogs.
  • list: Show active sessions, optionally filtered by agentId.
  • close: End a session and close its VS Code terminal tab.

Limitations and notes

Output-heavy commands can exceed an MCP client’s token limit. In that case, the complete response is saved to a temporary JSON file and the error reports its path. Reading a smaller tail, such as the last 10 or 20 lines, reduces the amount returned to the client.

The visible-terminal behavior depends on the VS Code extension being active. Session limits, command timeouts, output retention, idle cleanup, and blocked commands are controlled by the VS Code settings rather than MCP tool arguments alone.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Vscode Terminal MCP

vscode-terminal-mcp is an MCP server that connects AI agents to visible VS Code terminal tabs. Its main tools run commands, create and reuse sessions, execute within existing sessions, read captured output, send interactive input, list sessions, and close terminals. It requires VS Code 1.93+ and Node.js 20+.

Install it by configuring an MCP stdio server that runs `npx vscode-terminal-mcp@latest`. Claude Code uses `claude mcp add BashTerm -- npx vscode-terminal-mcp@latest`; VS Code, Cursor, and Claude Desktop use their respective MCP configuration files.

Yes, vscode-terminal-mcp works with Cursor through `.cursor/mcp.json`. Configure a server with command `npx` and the argument `-y vscode-terminal-mcp@latest`, then run commands through the exposed MCP tools.

Start the command with `run` using `waitForCompletion: false`, then call `read` repeatedly to inspect progress. Use a negative offset such as `-10` to retrieve the latest lines while the process continues.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewVscode Terminal MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/vscode-terminal-mcp?style=directory)](https://allmcps.com/mcp/vscode-terminal-mcp)
HTML Embed
<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>