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 命令、检索系统信息、管理模块等的工具。
要求
- Node.js 18+
- PowerShell 5.1 或 PowerShell Core 7+
安装
- 安装依赖项:Copy
- 构建项目:Copy
配置
对于克劳德桌面
编辑配置: $HOME/Library/Application\ Support/Claude/claude_desktop_config.json
添加到 mcpServers:
对于 VS Code
编辑配置: $HOME/Library/Application\ Support/Code/User/settings.json
添加到设置:
对于 Cursor IDE
编辑配置: $HOME/.cursor/mcp.json
添加到 mcpServers:
可用工具
此 PowerShell MCP 服务器提供以下工具:
执行_ps
执行 PowerShell 命令并获取结果。
使用示例:
获取系统信息
检索详细的系统信息,包括操作系统详细信息、处理器、内存和 PowerShell 版本。
使用示例:
列表模块
列出所有已安装的 PowerShell 模块,包括名称、版本和类型等详细信息。
使用示例:
获取命令帮助
获取特定 PowerShell 命令的详细帮助,包括语法、参数和示例。
使用示例:
查找命令
按名称或模式搜索 PowerShell 命令。
使用示例:
运行脚本
运行带有可选参数的 PowerShell 脚本文件。
使用示例:
发展
要在开发模式下运行:
扩展服务器
要添加您自己的 PowerShell 工具:
- 编辑
src/index.ts
- 在
registerTools()
方法中添加新工具 - 遵循现有的模式以实现一致的错误处理
- 使用
npm run build
进行构建
添加工具示例
安全注意事项
- 该服务器直接在您的系统上执行 PowerShell 命令
- 命令以与运行 MCP 服务器的进程相同的权限执行
- 暴露破坏性操作时要小心
- 考虑对敏感命令实施额外验证
故障排除
常见问题
- PowerShell 执行策略限制
- 您可能需要调整 PowerShell 执行策略以允许脚本执行
- 使用
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
允许本地脚本
- 未找到路径错误
- 确保文件路径是绝对路径或相对于工作目录正确路径
- 为您的操作系统使用适当的路径分隔符
- 未找到命令错误
- 某些命令可能需要安装特定模块
- 使用
Install-Module ModuleName
安装所需的模块
执照
麻省理工学院
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
模型上下文协议服务器,使 AI 助手能够在 Windows 系统上执行 PowerShell 命令、检索系统信息、管理模块和运行脚本。
Related MCP Servers
- AsecurityAlicenseAqualityA 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 -3JavaScriptMIT License
- AsecurityFlicenseAqualityA 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 -1318JavaScript
- -securityFlicense-qualityA 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 -1Python
- -securityFlicense-qualityA 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 -16TypeScript