Integrations
Creates and manages terminal sessions within Electron windows, enabling command execution and output retrieval through a programmatic API
Uses an Express HTTP server to facilitate communication between the MCP server and the Electron backend for terminal operations
Provides a bridge between the MCP protocol and Node.js to manage terminal sessions, execute commands, and retrieve terminal output
Electron Terminal MCP 서버
1. 설명
이상적인 환경에서는 공급업체가 자체적으로 터미널용 MCP 통합을 제공하겠지만, 현재 이 프로젝트는 클라이언트가 Electron 애플리케이션 내에서 실행되는 시스템 터미널과 상호 작용할 수 있도록 하는 모델 컨텍스트 프로토콜(MCP) 서버를 제공합니다. 이를 통해 명령 실행, 터미널 세션 관리, 프로그래밍 방식으로 출력 검색이 가능합니다.
이 시스템은 두 가지 주요 부분으로 구성됩니다.
- MCP 서버(
index.js
): 표준 입출력(stdio)을 통해 MCP 요청을 수신하는 Node.js 스크립트입니다.@modelcontextprotocol/sdk
를 사용하며 Electron 백엔드와의 연결 역할을 합니다. Electron 백엔드가 실행 중이 아니면 자동으로 시작합니다.mcp-package.json
에"type": "module"
지정해야 합니다. - Electron 백엔드(
main.js
): Electron 애플리케이션의 주요 프로세스입니다. Express HTTP 서버(기본 포트 3000)를 실행하며, MCP 서버(index.js
)는 상태 확인 및 API 호출을 위해 이 서버와 통신합니다. 이 백엔드는 숨겨진BrowserWindow
인스턴스 내에서node-pty
사용하여 실제 터미널 프로세스를 관리하며, 이 인스턴스는terminal.html
로드합니다.
2. 스크린샷
Claude Desktop과 같은 클라이언트 내에서 터미널 상호 작용은 다음과 같습니다.
터미널 출력이 있는 Claude 데스크톱 창:
개별 전자 단자 창:
3. 설치
- 필수 조건: Node.js와 npm이 설치되어 있는지 확인하세요.
- 복제: 아직 저장소를 복제하지 않았다면 복제하세요.지엑스피1
- 종속성 설치: MCP 서버와 Electron 앱 모두에 대한 Node 모듈을 설치합니다.Copy
- 네이티브 모듈 다시 빌드: Electron용 네이티브 모듈(예:
node-pty
)을 다시 빌드합니다.(자세한 내용은Copyrebuild.js
참조하세요)
3. 사용법
- MCP 서버 시작: Node.js를 사용하여
index.js
스크립트를 실행합니다. 이렇게 하면 stdio에서 MCP 명령을 수신하고, Electron 백엔드 프로세스(main.js
)가 이미 실행 중이 아니고 예상 HTTP 포트에서 수신 대기 중이 아니면 자동으로 시작합니다.참고: Electron 프로세스는 백그라운드에서 숨겨져 실행되며 필요할 때마다 자동으로 (다시) 시작되고 가능한 경우 항상 재사용됩니다.Copy - MCP를 통한 상호작용: 클라이언트는 stdio를 통해
node index.js
프로세스에 연결하고use_mcp_tool
명령을 사용합니다. 서버 이름은index.js
에 "Electron Terminal"로 정의되어 있습니다.사용 가능한 도구:terminal_start
: 새로운 터미널 세션을 생성하고 초기 명령을 실행합니다.- 입력:
{ "command": "string" }
- 출력:
{ "content": [...], "sessionId": "string" }
GXP5
- 입력:
terminal_execute
: 기존 세션에서 명령을 실행합니다.- 입력:
{ "command": "string", "sessionId": "string" }
- 출력:
{ "content": [...] }
(세션 ID는 텍스트 콘텐츠에 포함됩니다) GXP6
- 입력:
terminal_get_output
: 세션에 대한 누적된 출력을 검색합니다.- 입력:
{ "sessionId": "string" }
- 출력:
{ "content": [...] }
GXP7
- 입력:
terminal_stop
: 특정 터미널 세션 프로세스를 종료합니다.- 입력:
{ "sessionId": "string" }
- 출력:
{ "content": [...] }
GXP8
- 입력:
terminal_get_sessions
: Electron 백엔드에서 관리하는 현재 활성화된 모든 세션을 나열합니다.- 입력:
{}
- 출력:
{ "content": [...] }
(콘텐츠에는 활성 세션의 JSON 문자열이 포함되어 있음) GXP9
- 입력:
5. 파일 시스템 MCP 서버와의 시너지
이 Electron Terminal MCP 서버는 파일 시스템 MCP 서버 와 함께 매우 효과적으로 작동합니다. 파일 시스템 서버를 사용하여 디렉터리를 탐색하고, 파일을 읽고 쓰고, 이 터미널 서버를 사용하여 해당 디렉터리 또는 해당 파일과 관련된 명령을 실행할 수 있습니다. 이를 통해 Claude Desktop에 내장된 인터넷 검색 기능과 원활하게 연동되는 포괄적인 원격 개발 및 상호작용 환경을 제공합니다.
6. 요구 사항
- Node.js(v20 이상 권장, 저는 Node 22를 사용합니다)
- 엔피엠
- Electron과 호환되는 운영 체제(Windows, macOS, Linux)
7. 구성
Claude Desktop MCP 서버 구성
위치
claude_desktop_config.json
파일은 사용자의 AppData 디렉토리에 있어야 합니다.
- Windows:
C:\Users\<username>\AppData\Roaming\Claude\claude_desktop_config.json
이 파일은 Claude Desktop에서 외부 MCP 서버를 검색하고 구성하는 데 사용됩니다.
목적과 구조
구성 파일은 Claude Desktop이 실행하고 연결할 수 있는 MCP 서버를 정의합니다. 각 서버 항목은 서버 프로세스를 시작하는 방법을 지정합니다.
mcpServers
: 각 키가 서버 이름이고 값이 시작 구성인 객체입니다.- 서버 구성 예(
command-terminal
) :command
: 실행할 실행 파일(예: Node.js 서버의 경우node
).args
: 명령에 전달되는 인수 배열(예: MCP 서버 스크립트의 경로).
예
현장 설명
mcpServers
: 서버 이름을 해당 구성에 매핑하는 최상위 개체입니다.command-terminal
: 서버 이름 예시입니다. 이 객체에 여러 서버를 정의할 수 있습니다.command
: MCP 서버를 시작하는 데 사용되는 실행 파일입니다.args
: 서버 스크립트의 경로와 같은 명령에 전달되는 인수입니다.
8. 라이센스
이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 라이선스 파일을 참조하세요.
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Electron 애플리케이션에서 실행되는 시스템 터미널과 클라이언트가 상호 작용할 수 있도록 하는 모델 컨텍스트 프로토콜 서버로, 명령을 실행하고, 터미널 세션을 관리하고, 프로그래밍 방식으로 출력을 검색할 수 있습니다.
Related Resources
Related MCP Servers
- -securityFlicense-qualityThis server enables running a Model Context Protocol in a web browser with functionalities including arithmetic operations and session-based key-value storage.Last updated -2TypeScript
- -securityFlicense-qualityA Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.Last updated -Python
- AsecurityAlicenseAqualityA secure terminal execution server that enables controlled command execution with security features and resource limits via the Model Context Protocol (MCP).Last updated -1121JavaScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.Last updated -2PythonMIT License