cmd-mcp
v0.1.0
Published
Minimal MCP server exposing a Windows cmd tool.
Downloads
4
Maintainers
Readme
cmd-mcp
A minimal Model Context Protocol (MCP) server that exposes a single tool for running Windows cmd.exe commands. It is intentionally laconic: one tool, matching JSON schema, and a STDIO transport so your AI client can talk to the Windows command prompt with as little ceremony as possible.
Requirements
- Node.js 18+
- pnpm, npm, or yarn
- Windows host (the tool wraps
cmd.exe)
Installation
npm installUsage
Build and run via STDIO (the expected transport for MCP runtimes that launch the server as a subprocess):
npm run build
npm startFor rapid iteration you can run directly from TypeScript:
npm run devMCP client configuration
Point your MCP-compatible client at the compiled entry point (node dist/index.js) using the stdio transport. Example (Anthropic's Claude Desktop format):
{
"mcpServers": {
"cmd-mcp": {
"command": "node",
"args": ["C:/path/to/cmd-mcp/dist/index.js"],
"transport": "stdio"
}
}
}Tool signature
cmd.run
| Field | Type | Required | Description |
|------------|---------|----------|---------------------------------------------------------|
| command | string | ✔ | Raw string passed to cmd.exe /c. |
| cwd | string | ✖ | Working directory for the process. |
| timeoutMs| integer | ✖ | Kill the process after this many milliseconds (default 60000). |
The tool returns a text block that includes exit code, stdout, and stderr. Non-zero exit codes mark the result as an error for the client.
Security notes
- This server is a thin proxy over
cmd.exe; it does not sandbox or validate commands. - Only run it in trusted environments and with clients you control.
- Use
timeoutMsto guard against long-running or hanging processes.
Publishing
The package.json already includes files and main fields so it is publish-ready. When you are ready to release:
npm run build
npm publishContact
- LinkedIn: https://www.linkedin.com/in/xingyu-chen-b5b3b0313/
- Email: [email protected]
- GitHub: https://github.com/guangxiangdebizi/
- npm: https://www.npmjs.com/~xingyuchen
License
Apache License 2.0
