CMD-MCP-Server
允许通过CMD执行任何命令的MCP服务器
可用工具 (2 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
execute_command 2 个参数 需填 1 项
Execute a command and return its output. Commands run in a persistent shell session by default. Use newSession: true to run in a new shell instance.
必填参数:command
execute_ssh_command 7 个参数 需填 3 项
Execute a command on a remote server via SSH. Commands run in a persistent SSH session by default. Use newSession: true to run in a new session.
必填参数:host、username、command
服务介绍
CMD MCP 服务器
这是一个用于在 Windows 和 Linux 上执行 CMD 命令以及允许 SSH 连接的 Model Context Protocol (MCP) 服务器实现。该服务器允许您将命令行操作与支持 MCP 的应用程序集成。
特性
- 通过 MCP 执行 CMD 命令
- 使用 TypeScript 实现
- 基于官方 MCP SDK 构建
- 跨平台兼容性
安装
通过 Smithery 安装
要通过 Smithery 自动安装适用于 Claude Desktop 的 CMD 服务器:
npx -y @smithery/cli install server-cmd --client claude
手动安装
npm install server-cmd
先决条件
- Node.js(建议 v16 或更高版本)
- npm 或 yarn 包管理器
使用
import { MCPCmdServer } from 'server-cmd';
// Initialize the server
const server = new MCPCmdServer();
// Start the server
server.start();
配置
可以通过环境变量或配置对象来配置服务器:
const config = {
// Add your configuration options here
};
const server = new MCPCmdServer(config);
开发
设置开发环境的步骤如下:
- 克隆仓库:
git clone https://github.com/PhialsBasement/CMD-MCP-Server.git
cd CMD-MCP-Server
- 安装依赖项:
npm install
- 构建项目:
npm run build
脚本
npm run build- 将 TypeScript 编译为 JavaScriptnpm run prepare- 准备发布包
依赖项
@modelcontextprotocol/sdk: ^1.0.1glob: ^10.3.10zod-to-json-schema: ^3.23.5
贡献
欢迎贡献!请随时提交 Pull Request。
许可证
该项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。
安全
请注意,执行命令行操作可能具有潜在危险。在生产环境中使用此服务器时,请确保实施适当的安全措施和输入验证。
支持
对于问题和功能请求,请使用 GitHub 问题跟踪器。