Skip to main content
Glama

CMD MCP Server

npm downloads 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.

Features

  • Execute CMD commands through MCP

  • TypeScript implementation

  • Built on the official MCP SDK

  • Cross-platform compatibility

Related MCP server: Globalping

Installation

Installing via Smithery

To install CMD Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install server-cmd --client claude

Manual 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.

Available Tools

2 tools
execute_commandA

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.

Inputs: command (required), newSession.

execute_ssh_commandC

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.

Inputs: host (required), username (required), command (required), port, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: execute_command handles local shell commands, while execute_ssh_command handles remote SSH commands. There is no overlap or ambiguity between them, as each targets a different execution environment.

    Naming Consistency5/5

    Both tools follow a consistent verb_noun pattern with 'execute_' as the prefix and descriptive suffixes ('command' and 'ssh_command'). The naming is perfectly uniform and predictable across the tool set.

    Tool Count2/5

    With only 2 tools, the server feels thin for a command execution domain. It lacks essential operations like listing available commands, managing sessions, or handling file operations, which are common in such contexts. The count is too low for adequate coverage.

    Completeness2/5

    The tool set is severely incomplete for command execution. It covers basic local and remote command execution but misses critical functionalities such as session management tools, command history, file transfer, or environment configuration, leaving significant gaps for agent workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers