cmd-mcp-server
The cmd-mcp-server is a Model Context Protocol (MCP) server that enables command-line operations on both local and remote systems:
Local command execution: Run shell commands on the host machine with options to persist or create new shell sessions
Remote execution via SSH: Connect to remote servers using hostname, username, and password/private key authentication
SSH configuration options: Specify custom ports (default: 22) and choose between persistent or new SSH sessions
Cross-platform compatibility: Works on both Windows and Linux systems
Integration capabilities: Built on the MCP SDK for compatibility with other MCP applications
TypeScript implementation: Provides enhanced type safety and development experience
Allows the execution of command-line operations on Linux systems through a persistent shell session, providing access to Linux system commands and utilities.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cmd-mcp-serverlist all files in the current directory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
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 claudeManual Installation
npm install server-cmdPrerequisites
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:
Clone the repository:
git clone https://github.com/PhialsBasement/CMD-MCP-Server.git
cd CMD-MCP-ServerInstall dependencies:
npm installBuild the project:
npm run buildScripts
npm run build- Compile TypeScript to JavaScriptnpm run prepare- Prepare the package for publishing
Dependencies
@modelcontextprotocol/sdk: ^1.0.1glob: ^10.3.10zod-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 toolsexecute_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.
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| newSession | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that commands run in a persistent shell session by default and can be run in a new instance, which is useful behavioral context. However, it lacks details on permissions, security implications, error handling, or output format, which are important for a command execution tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, with two clear sentences that efficiently convey key information without waste. Each sentence earns its place by explaining the core function and a critical parameter behavior.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (command execution with potential security and behavioral implications), no annotations, no output schema, and 0% schema coverage, the description is incomplete. It covers the basic operation and session behavior but lacks details on permissions, error handling, output structure, or safety warnings, which are crucial for such a tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining the 'newSession' parameter's effect (running in a new shell instance vs. default persistent session) and implies 'command' is the input to execute. It doesn't detail the 'command' parameter's format or constraints, but provides enough context for basic usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Execute') and resource ('a command'), and specifies it returns output. However, it doesn't explicitly differentiate from the sibling 'execute_ssh_command' tool, which likely has a different context or target.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context about when to use the 'newSession' parameter (to run in a new shell instance vs. the default persistent session). It doesn't explicitly mention when to use this tool versus the sibling 'execute_ssh_command' or other alternatives, which is a minor gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| port | No | ||
| username | Yes | ||
| password | No | ||
| privateKey | No | ||
| command | Yes | ||
| newSession | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the persistent session behavior and newSession option, which is helpful. However, it doesn't cover critical aspects like security implications, error handling, timeout behavior, or output format. For a tool that executes remote commands with authentication parameters, this leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately concise with two sentences. The first sentence states the core purpose, and the second provides important behavioral context about session persistence. No wasted words, though it could be more comprehensive given the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 7 parameters, 0% schema description coverage, no annotations, and no output schema, the description is insufficient. It doesn't explain authentication methods (password vs. privateKey), command execution context, error scenarios, or return values. The description should provide more guidance given the tool's security-sensitive nature and complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for all 7 parameters. The description only mentions the 'newSession' parameter explicitly. It doesn't explain the purpose or relationships of host, port, username, password, privateKey, or command parameters. The description adds minimal value beyond what the bare schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Execute a command on a remote server via SSH.' It specifies the action (execute), resource (remote server), and method (SSH). However, it doesn't explicitly differentiate from the sibling tool 'execute_command' (which might be for local execution or different protocols).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides some usage context: 'Commands run in a persistent SSH session by default. Use newSession: true to run in a new session.' This gives guidance on session behavior but doesn't explain when to use this tool versus the sibling 'execute_command' or address authentication method selection (password vs. privateKey).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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.
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.
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.
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A simple MCP server built with FastMCP and python
Related MCP Servers
- MIT

Globalpingofficial
FlicenseNot gradedqualityBmaintenanceRemote MCP server that gives LLMs access to run network commands63- AlicenseNot gradedqualityCmaintenanceMCP server exposing pwntools 4.15.0 functionality for binary exploitation tasks.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PhialsBasement/CMD-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server