cmd-mcp-server

  • OS Automation
JavaScript
MIT
5
3
  • Linux
A
security – no known vulnerabilities (report Issue)
A
license - permissive license (MIT)
A
quality - confirmed to work

MCP server allowing any and all command execution over CMD

  1. Tools
  2. Prompts
  3. Resources
  4. Server Configuration
  5. README.md

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
execute_commandExecute 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.
execute_ssh_commandExecute 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.

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

README.md

CMD MCP Server

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.

<a href="https://glama.ai/mcp/servers/s83mqs6123"><img width="380" height="200" src="https://glama.ai/mcp/servers/s83mqs6123/badge" alt="cmd-mcp-server MCP server" /></a>

Features

  • Execute CMD commands through MCP
  • TypeScript implementation
  • Built on the official MCP SDK
  • Cross-platform compatibility

Installation

npm install server-cmd

Prerequisites

  • Node.js (v16 or higher recommended)
  • npm or yarn package manager

Usage

import { MCPCmdServer } from 'server-cmd'; // Initialize the server const server = new MCPCmdServer(); // Start the server server.start();

Configuration

The server can be configured through environment variables or a configuration object:

const config = { // Add your configuration options here }; const server = new MCPCmdServer(config);

Development

To set up the development environment:

  1. Clone the repository:
git clone https://github.com/PhialsBasement/CMD-MCP-Server.git cd CMD-MCP-Server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm run prepare - Prepare the package for publishing

Dependencies

  • @modelcontextprotocol/sdk: ^1.0.1
  • glob: ^10.3.10
  • zod-to-json-schema: ^3.23.5

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Security

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.

Support

For issues and feature requests, please use the GitHub issue tracker.

GitHub Badge

Glama performs regular codebase and documentation scans to:

  • Confirm that the MCP server is working as expected.
  • Confirm that there are no obvious security issues with dependencies of the server.
  • Extract server characteristics such as tools, resources, prompts, and required parameters.

Our directory badge helps users to quickly asses that the MCP server is safe, server capabilities, and instructions for installing the server.

Copy the following code to your README.md file:

Alternative MCP servers

  • A
    security
    A
    license
    A
    quality
    A powerful Model Context Protocol (MCP) server for Docker operations, enabling seamless container and compose stack management through Claude AI.
    MIT
    • Apple
  • -
    security
    F
    license
    -
    quality
    A Windows control server built using nut.js and Model Context Protocol (MCP), providing programmatic control over Windows system operations including mouse, keyboard, window management, and screen capture functionality.
  • A
    security
    A
    license
    A
    quality
    Command line interface with secure execution and customizable security policies
    MIT