MCP PowerShell Exec Server

MCP PowerShell Exec Server

site icon
2025.03.19 29
PythonPowerShell 脚本执行AI 辅助开发开发效率
MCP PowerShell Exec Server 是一个轻量级的服务器,用于接收、执行 PowerShell 脚本并返回输出结果。它使得 AI 助手能够理解并操作 PowerShell 脚本。
View on GitHub

Overview

基本能力

产品定位

MCP PowerShell Exec Server 是一个用于执行 PowerShell 脚本的工具,旨在帮助开发者和 AI 助手高效地运行和管理 PowerShell 脚本。

核心功能

  • 通过字符串输入接收 PowerShell 脚本
  • 在 MCP Server 环境中安全执行脚本
  • 实时返回执行结果

适用场景

  • 开发者需要快速测试和执行 PowerShell 脚本
  • AI 助手需要与 PowerShell 脚本交互
  • 自动化任务和脚本管理

工具列表

  • GitHub Copilot 扩展:用于与 VSCode Insiders 集成,提供 AI 辅助功能
  • VSCode Insiders:提供开发环境和 Copilot 支持

常见问题解答

  • 问题:如何配置 MCP Server 与 GitHub Copilot 集成? 解答:在 .vscode/mcp.json 中配置服务器路径和参数。
  • 问题:系统要求是什么? 解答:需要 Python 3.10 或更高版本,以及 PowerShell 5.1。

使用教程

使用依赖

  • Python:版本 3.10 或更高 bash python --version
  • PowerShell:版本 5.1 powershell $PSVersionTable.PSVersion

安装教程

  1. 克隆仓库 powershell git clone https://github.com/yourusername/mcp-powershell-exec.git cd mcp-powershell-exec
  2. 配置 VSCode Insiders 和 GitHub Copilot
  3. 安装 VSCode Insiders
  4. 安装 GitHub Copilot 扩展
  5. 配置 .vscode/mcp.json 文件

调试方式

  1. 启动 MCP Server bash python server.py
  2. 在 VSCode Insiders 中启用 Agent 模式
  3. 打开 Copilot 聊天
  4. 选择 "Agent mode"
  5. 刷新聊天输入以加载可用工具

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。