win-cli-mcp-tmyy
This server is a Windows command-line MCP server enabling AI clients to interact with Windows systems through a comprehensive set of tools:
Command Execution: Run CMD (
cmd_exec) and PowerShell (powershell_exec) commands with environment variable and working directory support.File System Operations: Read, write, edit files (with line ranges, encoding, base64), list directories (recursive), find files (minimatch patterns), search text in files, get metadata, create/delete/move paths, zip/unzip, compute file hashes, analyze disk usage, and manage BOM.
Process & Service Management: List and kill processes; list, start, and stop Windows services.
System & Network Information: List drives with usage, get environment variables, get system info (OS, CPU, memory, hostname), network interface info, and list occupied TCP ports.
Code Checking: Validate or check syntax for npm, Python, Go, Rust, Java, C#/.NET, Bash, and SQL projects/files.
Git Tools: View repository status, diffs, and commit logs.
Advanced Tools: Base64 encode/decode, structured deep thinking for reasoning, MCP proxy to other MCP servers, and retrieve project documentation.
MCP Protocol Features: Exposes resources (e.g.,
mcp://info), provides prompts (code review, diagnose, project scan), and allows disabling tools via environment variable.
Click on "Deploy 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., "@win-cli-mcp-tmyy Show me the current system information"
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.
win-cli-mcp-tmyy
Windows 命令行 MCP 服务器 — 为 AI 客户端(如 Trae、Claude Desktop 等)提供 Windows 系统的命令行执行、文件系统操作、系统信息查询、代码检查等功能,通过 MCP(Model Context Protocol)协议进行通信。
功能特性
命令执行
cmd_exec — 执行 Windows CMD 命令,支持环境变量传递、输出截断、路径自动转义
powershell_exec — 执行 PowerShell 命令,脚本自动写入系统临时目录执行,避免内联转义问题
文件系统操作
read_file — 读取文件内容,支持指定编码和行范围(单次上限 5MB)
write_file — 直接写入文件,支持 content / content_base64、unicode_escape、lineEnding 参数,原子写
edit_file — 按行范围替换文件内容,支持 preserve_indent 自动缩进适配
list_directory — 列出目录内容,支持递归和深度限制
find_files — 基于 minimatch 模式匹配的文件搜索(原生 Node.js 实现),自动忽略 node_modules/.git
search_text — 目录树文件内容搜索,支持子串/正则、文件名过滤、忽略目录
get_file_info — 获取文件/目录的详细元数据(大小、时间、类型、权限)
create_directory — 递归创建目录
delete_path — 删除文件或目录,支持移入回收站(可恢复)
move_path — 移动或重命名文件/目录,支持跨驱动器(自动回退到复制+删除)
delete_lines / insert_lines — 按行删除/插入文件内容
zip_create / zip_extract — zip 压缩与解压
file_hash — 文件哈希校验(SHA256/MD5/SHA1)
disk_usage — 目录磁盘占用分析(总大小 + 子目录排行)
进程与服务管理
list_processes — 列出运行中的进程(按 CPU 降序)
kill_process — 按 PID 或名称终止进程
list_services — 列出 Windows 服务及状态
start_service / stop_service — 启停 Windows 服务
系统与网络信息
list_drives — 列出所有可用驱动器及使用情况
get_env — 获取环境变量
get_system_info — 获取 OS 版本、CPU、内存、主机名等系统信息(基于 CIM)
get_network_info — 获取网络接口、IP、网关、DNS 信息
list_ports — 列出占用中的 TCP 端口及所属进程
代码检查
check_npm — npm 项目错误检查(npm install / npm run build)
check_python — Python 文件语法检查(py_compile)
check_go — Go 项目编译检查(go build)
check_rust — Rust 项目错误检查(cargo check)
check_java — Java 文件/项目编译检查(javac)
check_csharp — C#/.NET 项目构建检查(dotnet build)
check_bash — Bash 脚本语法检查(bash -n)
check_sql — SQL 脚本语法检查(内存 SQLite,无副作用)
Git 工具
git_status — 查看仓库工作区状态
git_diff — 查看未提交改动
git_log — 查看提交历史
高级工具
bom_manage — 检测、添加、移除文件 BOM(Byte Order Mark),支持 UTF-8/UTF-16/UTF-32
base64_manage — Base64 编解码,支持文本和文件,辅助 edit_file 避免 JSON 转义问题
deep_thinking — 结构化深度思考工具,模拟 Sequential Thinking 模式,支持逐步推理、修订、多分支探索
mcp_proxy — MCP 穿透工具,调用其他 MCP 服务器的工具,支持任意 stdio 模式的 MCP 服务器
get_project_doc — 获取本项目完整说明书(project.md)
MCP 协议能力
Resources — 暴露
mcp://info、项目文档及任意file://路径资源Prompts — 预设 code_review / diagnose / project_scan 任务模板
工具禁用配置 — 通过环境变量
WIN_CLI_MCP_DISABLED_TOOLS隐藏并拒绝指定工具
可靠性与智能处理
并发信号量 — 同时执行的命令数上限 4,防止资源耗尽
原子写 — 文件写入采用临时文件+rename,防止写坏文件
输出截断 — 命令输出超过 20000 字符自动截断,防止超出 AI 上下文窗口
自动 Unicode 转义 — 默认将
\uXXXX字面字符串转换为实际 Unicode 字符(如\u00a7→§),可用unicode_escape: false关闭换行符控制 — 默认归一化 CRLF/CR 为 LF,可用
lineEnding: 'crlf'/'auto'控制BOM 自动处理 — 读取文件时自动剥离 BOM,避免解析异常
跨驱动器移动 — 检测 EXDEV 错误,自动回退到复制+删除方案
Related MCP server: COP Plug
技术栈
运行时: Node.js(ES Modules)
核心依赖:
@modelcontextprotocol/sdk— MCP 协议官方 SDKminimatch— 文件搜索模式匹配
协议: MCP(Model Context Protocol)via stdio JSON-RPC 2.0
项目结构
win-cli-mcp-tmyy/
├── index.js # 主入口文件,包含所有工具实现和 MCP 服务器逻辑
├── package.json # 项目配置、依赖管理
├── install.bat # 本地安装脚本(npm link)
├── .gitignore # Git 忽略规则
├── LICENSE # 协议文件
├── README.md # 本说明文件
└── project.md # 详细项目说明书(供 AI 读取)安装
npm install -g win-cli-mcp-tmyy配置
在 AI 客户端(如 Trae)的 MCP 配置中添加:
{
"mcpServers": {
"win-cli-mcp-tmyy": {
"command": "npx",
"args": ["win-cli-mcp-tmyy"]
}
}
}可选:通过 env 禁用部分工具(逗号分隔工具名)。被禁用的工具不会出现在工具列表中,调用也会被拒绝:
{
"mcpServers": {
"win-cli-mcp-tmyy": {
"command": "npx",
"args": ["win-cli-mcp-tmyy"],
"env": {
"WIN_CLI_MCP_DISABLED_TOOLS": "mcp_proxy,kill_process"
}
}
}
}协议
Business Source License 1.1
✅ 开源可查看 — 任何人都可以查看、复制、修改、非商业使用
⚠️ 商业需授权 — 商业使用(包括但不限于销售、嵌入商业产品、作为商业服务提供)需联系作者获取商业许可
🔄 到期自动转 Apache 2.0 — 2030-08-05 后协议自动转为 Apache License 2.0,届时完全开源
本协议由 MariaDB 创建,被 CockroachDB、Sentry 等知名项目采用,是广泛认可的"源代码可用、商业需授权"协议方案。
Available Tools
24 toolsbase64_manageA
Base64 encode/decode utility. Supports: encode text to base64, decode base64 to text, encode file to base64 string, or decode base64 string to file. Useful for preparing content for edit_file's content_base64 parameter.
Inputs: action (required), path, text, encoding.
bom_manageA
Detect, add, or remove BOM (Byte Order Mark) in a file. Supports UTF-8/UTF-16/UTF-32 BOM detection and UTF-8 BOM add/remove.
Inputs: path (required), action (required).
check_goA
Check for errors in a Go project using 'go build'.
Inputs: directory (required), envPath.
check_javaA
Check for compilation errors in a Java file or project using 'javac'. For single files, pass filePath; for projects, pass directory containing source files.
Inputs: envPath, filePath, directory.
check_npmB
Check for errors in an npm project by running 'npm install' or 'npm run build'.
Inputs: directory (required), command, envPath.
check_pythonA
Check for syntax errors in a Python file using py_compile.
Inputs: filePath (required), envPath.
check_rustA
Check for errors in a Rust project using 'cargo check'.
Inputs: directory (required), envPath.
cmd_execB
Execute a command using Windows CMD (Command Prompt). Supports all drives and Windows commands.
Inputs: command (required), env, working_dir.
create_directoryA
Create a new directory (folder). Supports recursive creation of nested directories. Works on all drives.
Inputs: path (required).
deep_thinkingA
Structured sequential thinking tool for complex problem-solving. Break down problems into manageable steps, revise thoughts as understanding deepens, and explore alternative reasoning paths through branching. Modeled after the Sequential Thinking pattern.
Inputs: thought (required), thoughtNumber (required), totalThoughts (required), nextThoughtNeeded (required), +5 more.
delete_pathA
Delete a file or directory. For directories, supports recursive deletion. Use with caution as this operation is irreversible.
Inputs: path (required), recursive.
edit_fileA
编辑文件内容,按行范围替换(startLine-endLine,1-based)。行号是必填的,必须指定要替换的行范围。Content is auto-normalized: CRLF/CR converted to LF, leading/trailing newlines stripped. Use content_base64 to avoid JSON escaping issues. Set preserve_indent=true to auto-convert new content indentation to match the original file's style (e.g., spaces → TABs).
Inputs: path (required), startLine (required), content, endLine, +4 more.
find_filesB
Search for files matching a pattern in a directory.
Inputs: pattern (required), directory (required), recursive, max_results.
get_envA
Get environment variables. Returns all if no name specified.
Inputs: name.
get_file_infoA
Get detailed metadata for a file or directory (size, timestamps, type, permissions).
Inputs: path (required).
get_project_docA
获取项目说明书(project.md),返回本 MCP 服务器的完整文档,包括所有工具说明、参数、使用示例等。
Inputs: no named parameters.
get_system_infoA
Get basic Windows system information (OS version, CPU, memory, hostname).
Inputs: no named parameters.
list_directoryC
List contents of a directory with detailed information.
Inputs: path (required), max_depth, recursive.
list_drivesB
List all available drives on the system with their information.
Inputs: no named parameters.
mcp_proxyA
MCP穿透工具 - 调用其他MCP服务器的工具。通过本MCP代理转发请求到目标MCP服务器并返回结果。支持任意MCP stdio服务器。
Inputs: tool_args (required), tool_name (required), server_args (required), server_command (required), +1 more.
move_pathA
Move or rename a file or directory. Can move across drives. If destination exists as a directory, the source will be moved into it.
Inputs: source (required), destination (required).
powershell_execB
Execute a command using Windows PowerShell. Supports all PowerShell cmdlets and scripts.
Inputs: command (required), env, working_dir.
read_fileA
Read the contents of a file with specified encoding. Supports reading specific line ranges via startLine/endLine (1-based). If not provided, reads the entire file.
Inputs: path (required), endLine, encoding, startLine.
write_fileA
Write content to a file directly (no line range). Supports both plain text (content) and base64-encoded content (content_base64) to avoid JSON escaping issues. Content is auto-normalized: CRLF/CR converted to LF, leading/trailing newlines stripped, and common indentation removed (dedent) for 'content' (not for 'content_base64').
Inputs: path (required), content, encoding, content_base64, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools have clearly distinct purposes (file ops, system info, language checks). The only notable overlap is between cmd_exec and powershell_exec, which both execute arbitrary commands, and write_file/edit_file share the write action but differ in line-range specificity. Descriptions mostly resolve this ambiguity.
The dominant verb_noun pattern (list_drives, read_file, check_python) is used for many tools, but several deviate with noun_verb (cmd_exec, bom_manage) and a few are unclassifiable (deep_thinking, mcp_proxy). The mixed conventions are readable but not fully predictable.
24 tools is on the heavier side, including six language-specific check_* tools and meta tools like deep_thinking and mcp_proxy that are not strictly Windows CLI utilities. While each tool has a distinct function, the set could be consolidated without losing much capability.
The server covers core file operations, command execution via CMD and PowerShell, system info, environment variables, and basic language checks. Missing process management, registry, or network tools are workaroundable through cmd_exec/powershell_exec, so there are no major dead ends.
Maintenance
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to perform extensive Windows system administration, file operations, process management, network configuration, registry editing, GUI automation, and more through a comprehensive set of MCP tools.1MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to execute PowerShell commands, manage files, inspect projects, run Git operations, and monitor system information on Windows through a local MCP server.-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to seamlessly integrate with the Windows operating system, performing tasks such as file navigation, application control, UI interaction, and QA testing via the MCP protocol.-
- AlicenseAqualityCmaintenanceEnables AI assistants to control Windows PCs by executing shell commands, managing files, capturing screenshots, and monitoring system information through a comprehensive set of MCP tools.181MIT