Skip to main content
Glama

win-shell-mcp

AI-native cross-platform command abstraction layer — provides 40 deterministic tools as an MCP Server, replacing bare shell calls with unified minimal JSON output, handling Windows path/encoding/quoting differences.

CI

Why

Letting AI call shell commands is dangerous and unreliable:

  • Cross-platform inconsistency: Windows path separators, encoding (GBK), quoting, and command names (del vs rm) differ greatly from Unix

  • Output hard to parse: Shell command output formats are arbitrary, making it difficult for AI to reliably extract information

  • Security risk: Bare shell allows pipes, redirection, and command injection

win-shell-mcp replaces common shell commands with 40 deterministic tools, each of which:

  • Accepts structured JSON parameters and returns unified { ok: true, ...data } or { ok: false, error: { code, message } }

  • Behaves consistently across platforms (same configuration for Windows/macOS/Linux)

  • Provides minimal output (default only includes the minimum fields needed for AI decision-making), with a verbose switch for full data

  • Uses standard error codes (ENOENT/EISDIR/ENOTDIR/EACCES/EINVAL/ETIMEOUT/EEXEC/EUNKNOWN/INVALID_URL/NET_TIMEOUT/NET_FAIL/PROC_NOT_FOUND/PROC_KILL_FAIL/EXEC_FAIL/EXEC_TIMEOUT/GIT_FAIL)

Related MCP server: Pare

Installation

# 全局安装
npm install -g win-shell-mcp

# 或一次性运行
npx win-shell-mcp

Requires Node.js ≥ 18.

Client Configuration

Claude Desktop

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):

{
  "mcpServers": {
    "win-shell-mcp": {
      "command": "win-shell-mcp"
    }
  }
}

If not installed globally, use npx:

{
  "mcpServers": {
    "win-shell-mcp": {
      "command": "npx",
      "args": ["win-shell-mcp"]
    }
  }
}

Generic MCP Client

Any client compatible with the Model Context Protocol can connect via stdio:

{
  "mcpServers": {
    "win-shell-mcp": {
      "command": "win-shell-mcp",
      "transport": "stdio"
    }
  }
}

After startup, the client communicates with the server via stdio and automatically discovers all 40 tools.

Tool List (40)

Grouped by domain. Each tool returns a unified output contract: success { ok: true, ...data }, failure { ok: false, error: { code, message } }.

system (4)

Tool

Description

system_info

System information (os, arch, platform, hostname, cwd, node); verbose includes uptime, memory, CPU

system_disk

Disk usage (total/free/used, in bytes)

system_memory

Memory information (total/free); verbose includes used, swap

system_path

List of PATH environment variable entries; verbose includes count, existing

fs_read (3)

Tool

Description

fs_list

List directory; verbose includes type and size, recursive for recursion

fs_read

Read file; supports line range, automatic encoding detection (GBK/UTF-8), truncation

fs_stat

File/directory information (type, size, mtime, birthtime)

fs_write (6)

Tool

Description

fs_write

Write file (supports utf-8/gbk encoding, can append)

fs_mkdir

Create directory (recursive defaults to true, similar to mkdir -p)

fs_rm

Delete file/directory (recursive deletes directory tree, force ignores non-existent)

fs_cp

Copy file/directory (directory requires recursive)

fs_mv

Move/rename (fails if dest exists, does not overwrite)

fs_touch

Create empty file or update mtime

text (6)

Tool

Description

text_grep

Regex search text

text_head

Get first N lines

text_tail

Get last N lines

text_wc

Count lines/words/characters

text_diff

Difference between two texts

text_replace

Regex replace text

search (3)

Tool

Description

search_glob

Match file paths with glob patterns

search_content

Search content within files

search_which

Find executable file path (similar to which/where)

process (2)

Tool

Description

process_list

List processes

process_kill

Terminate process (by PID)

shell_exec (1)

Tool

Description

shell_exec

Execute shell command (with timeout and encoding handling)

env (3)

Tool

Description

env_get

Read environment variable

env_set

Set environment variable

env_unset

Delete environment variable

net (4)

Tool

Description

net_get

HTTP GET request

net_post

HTTP POST request

net_dns

DNS resolution

net_tcp

TCP connection probe

pkg (2)

Tool

Description

pkg_detect

Detect package manager (npm/pnpm/yarn)

pkg_run

Run package script

git (6)

Tool

Description

git_status

Working tree status

git_log

Commit history

git_branch

Branch list and switch

git_diff

Diff

git_add

Stage

git_commit

Commit

⚠️ Security Note

No sandbox, full permissions.

This server performs all operations with the full permissions of the running user, equivalent to a bare shell. fs_rm can delete any accessible file, shell_exec can execute any command, process_kill can terminate any accessible process, and fs_write can overwrite any accessible file.

Only use in trusted environments:

  • Only connect to AI clients you trust

  • Do not expose in shared/multi-tenant environments

  • Manually confirm operations on sensitive directories (system directories, user home directories)

  • In production, it is recommended to use OS-level permission isolation (dedicated low-privilege accounts, containers, chroot, etc.)

This project does not provide any sandbox, permission isolation, command blacklist, or path restrictions. All access control relies on OS permissions.

Development

# 安装依赖
npm install

# 类型检查
npm run typecheck

# 测试
npm test

# 测试(watch 模式)
npm run test:watch

# 覆盖率(阈值:lines/functions/statements ≥ 85%,branches ≥ 70%)
npm run coverage

# 构建
npm run build

# 开发模式(watch 构建)
npm run dev

The build output is dist/index.js (bundled with tsup, ESM).

Project Structure

src/
  index.ts          # 入口:启动 stdio server
  server.ts         # MCP Server 创建与工具分发
  registry.ts       # 工具注册表(注册全部 40 个工具)
  contract/         # 输出契约与错误码
  encoding/         # 编码检测(GBK/UTF-8)
  tools/            # 40 个工具实现,按域分文件
tests/
  server.test.ts    # server 单元测试
  integration/      # 集成测试(Client + InMemoryTransport)
  tools/            # 各工具单元测试
  contract/         # 契约测试
  encoding/         # 编码测试

License

MIT

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    C
    maintenance
    A unified MCP server with composable tools for GitHub operations, file management, shell execution, kanban boards, Discord messaging, and package management. Features role-based security, HTTP/stdio transports, and a web-based development UI.
  • A
    license
    -
    quality
    A
    maintenance
    Provides MCP servers that wrap common developer tools (git, npm, docker, etc.) returning structured JSON output, enabling AI agents to reliably interact with these tools without parsing fragile terminal text.
    1
    136
    MIT

View all related MCP servers

Related MCP Connectors

  • A MCP server built for developers enabling Git based project management with project and personal…

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

  • Scans MCP servers for tool poisoning, prompt injection and supply chain risks.

View all MCP Connectors

Latest Blog Posts

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/1072636071/win-shell-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server