PowerShell MCP Server

by posidron

Integrations

  • Offers a Node.js-based server for executing PowerShell commands, with support for system information retrieval, module management, and script execution through Node.js runtime.

  • Enables interaction with PowerShell, providing tools for executing commands, retrieving system information, managing modules, getting command help, finding commands, and running scripts.

PowerShell MCP 서버

PowerShell과 상호 작용하기 위한 모델 컨텍스트 프로토콜 서버입니다. 이 서버는 PowerShell 명령 실행, 시스템 정보 검색, 모듈 관리 등의 도구를 제공합니다.

요구 사항

  • 노드.js 18+
  • PowerShell 5.1 또는 PowerShell Core 7+

설치

  1. 종속성 설치:지엑스피1
  2. 프로젝트를 빌드하세요:
    npm run build

구성

클로드 데스크탑용

구성 편집: $HOME/Library/Application\ Support/Claude/claude_desktop_config.json

mcpServers에 추가:

{ "mcpServers": { "mcp-powershell": { "command": "node", "args": [ "/absolute/path/to/mcp-powershell/dist/index.js" ] } } }

VS 코드의 경우

구성 편집: $HOME/Library/Application\ Support/Code/User/settings.json

설정에 추가:

"mcp": { "servers": { "mcp-powershell": { "command": "node", "args": [ "/absolute/path/to/mcp-powershell/dist/index.js" ] } } }

커서 IDE용

구성 편집: $HOME/.cursor/mcp.json

mcpServers에 추가:

{ "mcpServers": { "mcp-powershell": { "command": "node", "args": [ "/absolute/path/to/mcp-powershell/dist/index.js" ] } } }

사용 가능한 도구

이 PowerShell MCP 서버는 다음과 같은 도구를 제공합니다.

실행_ps

PowerShell 명령을 실행하고 결과를 얻습니다.

Parameters: - command (string): PowerShell command to execute

사용 예:

execute_ps(command: "Get-Process | Select-Object -First 5")

시스템 정보 가져오기

OS 세부 정보, 프로세서, 메모리, PowerShell 버전을 포함한 자세한 시스템 정보를 검색합니다.

Parameters: None

사용 예:

get_system_info()

목록_모듈

이름, 버전, 유형 등의 세부 정보와 함께 설치된 모든 PowerShell 모듈을 나열합니다.

Parameters: None

사용 예:

list_modules()

get_command_help

구문, 매개변수, 예제를 포함하여 특정 PowerShell 명령에 대한 자세한 도움말을 받으세요.

Parameters: - command (string): PowerShell command to get help for

사용 예:

get_command_help(command: "Get-Process")

찾기_명령

이름이나 패턴으로 PowerShell 명령을 검색합니다.

Parameters: - search (string): Search term for PowerShell commands

사용 예:

find_commands(search: "Process")

실행 스크립트

선택적 매개변수를 사용하여 PowerShell 스크립트 파일을 실행합니다.

Parameters: - scriptPath (string): Path to the PowerShell script file - parameters (string, optional): Optional parameters to pass to the script

사용 예:

run_script(scriptPath: "/path/to/script.ps1", parameters: "-Name 'Test' -Value 123")

개발

개발 모드에서 실행하려면:

npm run dev

서버 확장

자체 PowerShell 도구를 추가하려면:

  1. src/index.ts 편집하세요
  2. registerTools() 메서드에 새 도구 추가
  3. 일관된 오류 처리를 위해 기존 패턴을 따르세요.
  4. npm run build 로 빌드하세요

도구 예제 추가

// In the registerTools() method: this.server.tool( "my_ps_tool", { param1: z.string().describe("Description of parameter 1"), param2: z.number().optional().describe("Optional numeric parameter"), }, async ({ param1, param2 }) => { try { // Your PowerShell command const command = `Your-PowerShell-Command -Param1 "${param1}" ${param2 ? `-Param2 ${param2}` : ''}`; const { stdout, stderr } = await execAsync(`powershell -Command "${command.replace(/"/g, '\\"')}"`); if (stderr) { return { isError: true, content: [ { type: "text" as const, text: `Error in my_ps_tool: ${stderr}`, }, ], }; } return { content: [ { type: "text" as const, text: stdout, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text" as const, text: `Error in my_ps_tool: ${(error as Error).message}`, }, ], }; } } );

보안 고려 사항

  • 이 서버는 PowerShell 명령을 사용자 시스템에서 직접 실행합니다.
  • 명령은 MCP 서버를 실행하는 프로세스와 동일한 권한으로 실행됩니다.
  • 파괴적인 작업을 노출할 때는 주의하세요
  • 민감한 명령에 대한 추가 검증 구현을 고려하세요

문제 해결

일반적인 문제

  1. PowerShell 실행 정책 제한
    • 스크립트 실행을 허용하려면 PowerShell 실행 정책을 조정해야 할 수도 있습니다.
    • 로컬 스크립트를 허용하려면 Set-ExecutionPolicy RemoteSigned -Scope CurrentUser 사용하세요.
  2. 경로를 찾을 수 없음 오류
    • 파일 경로가 절대 경로인지 또는 작업 디렉토리에 대한 상대 경로인지 확인하십시오.
    • OS에 맞는 경로 구분 기호를 사용하세요.
  3. 명령을 찾을 수 없음 오류
    • 일부 명령에는 특정 모듈을 설치해야 할 수도 있습니다.
    • Install-Module ModuleName 사용하여 필요한 모듈을 설치합니다.

특허

MIT

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

AI 어시스턴트가 PowerShell 명령을 실행하고, 시스템 정보를 검색하고, 모듈을 관리하고, Windows 시스템에서 스크립트를 실행할 수 있도록 하는 모델 컨텍스트 프로토콜 서버입니다.

  1. 요구 사항
    1. 설치
      1. 구성
        1. 클로드 데스크탑용
        2. VS 코드의 경우
        3. 커서 IDE용
      2. 사용 가능한 도구
        1. 실행_ps
        2. 시스템 정보 가져오기
        3. 목록_모듈
        4. get_command_help
        5. 찾기_명령
        6. 실행 스크립트
      3. 개발
        1. 서버 확장
          1. 도구 예제 추가
        2. 보안 고려 사항
          1. 문제 해결
            1. 일반적인 문제
          2. 특허

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that provides programmatic access to the Windows terminal, enabling AI models to interact with the Windows command line through standardized tools for writing commands, reading output, and sending control signals.
              Last updated -
              3
              JavaScript
              MIT License
            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol server that allows secure execution of pre-approved commands, enabling AI assistants to safely interact with the user's system.
              Last updated -
              1
              3
              18
              JavaScript
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
              Last updated -
              1
              Python
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              A comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.
              Last updated -
              16
              TypeScript

            View all related MCP servers

            ID: fjhi52pfdt