Skip to main content
Glama
sirlordt
by sirlordt

vscode-terminal-mcp

npm version

보이는 VSCode 터미널 탭에서 명령어를 실행하고 전체 출력을 캡처하는 MCP 서버입니다. 인라인 실행과 달리 모든 명령어는 직접 보고, 스크롤하고, 상호작용할 수 있는 실제 터미널에서 실행됩니다.

주요 기능

  • 보이는 터미널: 명령어는 숨겨진 프로세스가 아닌 실제 VSCode 터미널 탭에서 실행됩니다. 모든 것을 실시간으로 볼 수 있습니다.

  • 세션 재사용: run 도구는 유휴 세션을 자동으로 재사용하며, 필요할 때만 새 터미널을 생성합니다.

  • 장기 실행 지원: waitForCompletion: false로 실행 후 잊어버리는(fire-and-forget) 방식으로 실행하고, read로 출력을 증분 폴링합니다.

  • 서브에이전트 격리: 세션에 agentId를 태그하여 병렬 에이전트 작업을 분리할 수 있습니다.

Related MCP server: Terminal MCP

요구 사항

  • VS Code 1.93+ (Shell Integration API용)

  • Node.js 20+

시작하기

Claude Code

claude mcp add BashTerm -- npx vscode-terminal-mcp@latest

VS Code / Copilot

.vscode/mcp.json에 추가하세요:

{
  "servers": {
    "BashTerm": {
      "type": "stdio",
      "command": "npx",
      "args": ["vscode-terminal-mcp@latest"]
    }
  }
}

.cursor/mcp.json에 추가하세요:

{
  "mcpServers": {
    "BashTerm": {
      "command": "npx",
      "args": ["-y", "vscode-terminal-mcp@latest"]
    }
  }
}

claude_desktop_config.json에 추가하세요:

{
  "mcpServers": {
    "BashTerm": {
      "command": "npx",
      "args": ["-y", "vscode-terminal-mcp@latest"]
    }
  }
}

첫 번째 프롬프트

설치 후 다음을 시도해 보세요:

터미널에서 ls -la 실행

VSCode에 명령어 출력이 표시되는 새 터미널 탭이 열리는 것을 볼 수 있습니다.

스크린샷

run으로 명령어 실행

Run command output

exec 권한 대화상자

Exec permission dialog

깔끔한 출력의 Exec 결과

Exec finished

도구

빠른 실행

도구

설명

run

터미널을 생성(또는 재사용)하고 한 단계로 명령어를 실행합니다. 종료 코드와 함께 깔끔한 출력을 반환합니다.

세션 관리

도구

설명

create

새 보이는 터미널 세션을 생성합니다. sessionId를 반환합니다.

exec

기존 세션에서 명령어를 실행하고 출력을 캡처합니다.

read

페이지네이션으로 세션 출력을 읽습니다. 증분 읽기 및 꼬리 모드(offset: -N)를 지원합니다.

input

대화형 터미널(프롬프트, REPL, 확인 메시지)에 텍스트를 보냅니다.

list

활성 세션을 나열합니다. 선택적으로 agentId로 필터링할 수 있습니다.

close

터미널 세션과 해당 VSCode 탭을 닫습니다.

사용 패턴

간단한 명령어

run 도구가 모든 것을 처리합니다 — 필요 시 터미널을 생성하고, 실행하고, 깔끔한 출력을 반환합니다:

> Run npm test
$ npm test
PASS src/utils.test.ts (3 tests)
PASS src/index.test.ts (5 tests)

[exit: 0 | 1243ms | session-abc123]

장기 실행 프로세스

빌드, 배포 또는 시간이 걸리는 모든 명령어의 경우:

> Start `npm run build` without waiting, then check progress

에이전트는 다음을 수행합니다:

  1. waitForCompletion: falserun 호출 — 즉시 반환

  2. offset: -10으로 read 호출 — 마지막 10줄 확인

  3. 프로세스가 완료될 때까지 반복

대화형 명령어

사용자 입력이 필요한 명령어의 경우:

> Run npm init and answer the prompts

에이전트는 다음을 수행합니다:

  1. npm init으로 run 호출

  2. read 호출 — 프롬프트 확인

  3. input 호출 — 답변 전송

병렬 에이전트

서브에이전트는 agentId를 사용하여 격리된 터미널에서 작업할 수 있습니다:

> Have one agent run tests while another runs the linter

각 서브에이전트는 자체 agentId로 태그된 전용 터미널을 받아 출력이 섞이는 것을 방지합니다.

구성

확장 프로그램은 VSCode 설정의 terminalMcp.*에서 구성을 읽습니다:

설정

유형

기본값

설명

terminalMcp.maxSessions

number

10

최대 동시 터미널 세션 수

terminalMcp.commandTimeout

number

30000

기본 명령어 타임아웃(ms)

terminalMcp.maxOutputLines

number

5000

세션당 출력 버퍼에 유지되는 최대 줄 수

terminalMcp.idleTimeout

number

1800000

이 시간(ms) 후 유휴 세션 닫기 (0 = 비활성화)

terminalMcp.blockedCommands

string[]

["rm -rf /"]

거부될 명령어

권장: 기본 도구로 설정

Claude Code와 같은 LLM 에이전트에는 채팅 내에서 인라인으로 명령어를 실행하는 기본 제공 Bash 도구가 있습니다. 출력이 대화에 포함되어 특히 출력이 많은 명령어의 경우 읽기 어렵습니다. 에이전트가 기본 제공 Bash 도구보다 이 MCP를 선호하도록 지시하는 것을 권장합니다.

프로젝트의 CLAUDE.md(또는 이에 상응하는 지침 파일)에 다음을 추가하세요:

## Terminal Execution

Prefer the BashTerm MCP tools (`run`, `exec`, `read`, etc.) over the built-in Bash tool for executing commands.
BashTerm runs commands in visible VSCode terminal tabs where the user can see output in real time.
Only fall back to the built-in Bash tool for simple, non-interactive operations like reading environment variables.

For commands that may take longer than 30 seconds or produce large amounts of output (builds, test suites,
deployments, installs), use the pull mode pattern:
1. Call `run` with `waitForCompletion: false` to launch the command without blocking.
2. Call `read` with `offset: -10` to check the last 10 lines of output.
3. Repeat step 2 until you see the command has finished (look for exit messages, prompts, or "Done").
4. Report the final result to the user.

This prevents conversation timeouts and lets the user watch progress in the terminal in real time.

이것이 중요한 이유:

기본 제공 Bash

BashTerm MCP

출력 가시성

채팅에 포함되어 스크롤하기 어려움

VSCode 터미널 탭에서 볼 수 있음

실시간 피드백

명령어가 끝날 때까지 사용자는 아무것도 못 봄

사용자가 출력을 실시간으로 봄

장기 실행 명령어

타임아웃까지 대화를 차단

Fire-and-forget + 폴링

세션 상태

각 명령어가 격리됨

기록이 있는 영구 세션

대화형 명령어

지원되지 않음

프롬프트/REPL에 입력 전송 가능

개발: 확장 프로그램 업데이트

VSCode는 확장 프로그램을 메모리에 적극적으로 캐시합니다. 로컬에서 개발할 때 code --install-extension 및 "Developer: Reload Window"조차 변경 사항을 로드하지 못할 수 있습니다. 다음 워크플로우를 사용하세요:

빠른 업데이트 (재시작 불필요)

소스 파일을 수정한 후 빌드하고 설치된 확장 프로그램 디렉토리에 직접 복사하세요:

cd /path/to/vscode-terminal-mcp
npm run build
cp dist/extension.js ~/.vscode/extensions/sirlordt.vscode-terminal-mcp-<version>/dist/extension.js

그런 다음 "Developer: Reload Window" (Ctrl+Shift+P)를 실행하세요.

전체 재설치 (빠른 업데이트가 작동하지 않을 때)

VSCode가 여전히 이전 코드를 사용하는 경우:

# 1. Uninstall and remove all copies
code --uninstall-extension sirlordt.vscode-terminal-mcp
rm -rf ~/.vscode/extensions/sirlordt.vscode-terminal-mcp-*

# 2. Check for ghost entries with old publisher names
# Look in ~/.vscode/extensions/extensions.json for stale entries
# Remove any entries with old publisher IDs (e.g., "terminal-mcp.vscode-terminal-mcp")

# 3. Close VSCode completely (not just reload)

# 4. Rebuild and install
npm run build
npx vsce package --allow-missing-repository
code --install-extension vscode-terminal-mcp-<version>.vsix --force

# 5. Open VSCode

올바른 버전이 로드되었는지 확인

# Check which extension directories exist
ls ~/.vscode/extensions/ | grep terminal

# Verify your changes are in the installed extension
grep "YOUR_UNIQUE_STRING" ~/.vscode/extensions/sirlordt.vscode-terminal-mcp-*/dist/extension.js

# Compare checksums
md5sum dist/extension.js ~/.vscode/extensions/sirlordt.vscode-terminal-mcp-*/dist/extension.js

대용량 출력 처리

read가 MCP 클라이언트의 토큰 한도를 초과하는 출력을 반환하면, 시스템이 전체 출력을 임시 JSON 파일에 자동으로 저장하고 오류 메시지에 파일 경로를 반환합니다.

관련 콘텐츠를 추출하려면:

# Get the last 50 lines (most relevant for status)
tail -50 /path/to/saved/file.txt

# Or parse the JSON to extract the text content
python3 -c "import json; data=json.load(open('/path/to/file.txt')); print(data[0]['text'][-2000:])"

파일 형식은 JSON입니다: [{"type": "text", "text": "..."}]

이 문제는 진행률 표시줄, ANSI 이스케이프 코드 등 무거운 TUI 출력을 생성하는 명령어에서 흔히 발생합니다. 캡처되는 출력 크기를 줄이려면 더 작은 offset 값(예: offset: -100 대신 offset: -20)을 사용하세요.

작동 방식

  1. VSCode 확장 프로그램이 활성화되고 Unix 소켓에서 IPC 서버를 시작합니다

  2. MCP 진입점(mcp-entry.js)이 MCP 클라이언트에 의해 생성되고 JSON-RPC stdio를 IPC 소켓과 연결합니다

  3. 명령어는 Shell Integration API를 사용하여 실제 VSCode 터미널에서 실행되며, 안정적인 출력 캡처와 종료 코드 감지를 제공합니다

  4. 출력은 페이지네이션을 지원하는 순환 버퍼에 저장되어 효율적인 읽기가 가능합니다

최신 변경 사항 (0.1.6)

  • 마켓플레이스용 README 스크린샷

  • 모든 도구에 대한 깔끔한 출력 형식 — 더 이상 원시 JSON 없음

  • waitForCompletion: false가 작동하지 않던 문제 수정

  • 유휴 리퍼 비활성화 — 사용자가 수동으로 세션 닫기

  • 작업공간별 고유 IPC 소켓 (다중 인스턴스 지원)

  • 날짜 형식의 사용자 정의 터미널 탭 이름

  • 대용량 출력 처리 문서화

전체 기록은 CHANGELOG.md를 참조하세요.

라이선스

MIT

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables management of visible, interactive terminal sessions across platforms (macOS, Windows, Linux, WSL). Supports creating, executing commands, capturing output, and managing multiple terminal windows simultaneously.
    5
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to execute shell commands and manage long-running processes within persistent tmux sessions across isolated workspaces. It features a dual-window architecture to separate raw command execution from interactive terminal output.
    8
    9
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables interactive terminal sessions within Claude Code and Desktop, allowing users and AI to execute commands and manage multiple tabs.
    2

View all related MCP servers

Related MCP Connectors

  • Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.

  • Live browser debugging for AI assistants — DOM, console, network via MCP.

  • A paid remote MCP for AI agent browser DevTools MCP, built to return verdicts, receipts, usage logs,

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sirlordt/vscode-terminal-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server