CMD MCP Server
MCP server allowing any and all command execution over CMD
MCP server allowing any and all command execution over CMD
A Model Context Protocol (MCP) server implementation for executing CMD commands on both Windows and Linux, as well as allowing SSH connections. This server allows you to integrate command-line operations with MCP-compatible applications.
To install CMD Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install server-cmd --client claude
npm install server-cmd
import { MCPCmdServer } from 'server-cmd';
// Initialize the server
const server = new MCPCmdServer();
// Start the server
server.start();
The server can be configured through environment variables or a configuration object:
const config = {
// Add your configuration options here
};
const server = new MCPCmdServer(config);
To set up the development environment:
Clone the repository:
git clone https://github.com/PhialsBasement/CMD-MCP-Server.git
cd CMD-MCP-Server
Install dependencies:
npm install
Build the project:
npm run build
npm run build
- Compile TypeScript to JavaScriptnpm run prepare
- Prepare the package for publishing@modelcontextprotocol/sdk
: ^1.0.1glob
: ^10.3.10zod-to-json-schema
: ^3.23.5Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Please note that executing command-line operations can be potentially dangerous. Make sure to implement proper security measures and input validation when using this server in production environments.
For issues and feature requests, please use the GitHub issue tracker.
[
{
"description": "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.",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"command": {
"type": "string"
},
"newSession": {
"type": "boolean"
}
},
"required": [
"command"
],
"type": "object"
},
"name": "execute_command"
},
{
"description": "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.",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"command": {
"type": "string"
},
"host": {
"type": "string"
},
"newSession": {
"type": "boolean"
},
"password": {
"type": "string"
},
"port": {
"default": 22,
"type": "number"
},
"privateKey": {
"type": "string"
},
"username": {
"type": "string"
}
},
"required": [
"host",
"username",
"command"
],
"type": "object"
},
"name": "execute_ssh_command"
}
]