Skip to main content
Glama
s2005

Windows CLI MCP Server

by s2005

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription
execute_command

Execute a command in the specified shell (powershell, cmd, gitbash, bash, wsl)

IMPORTANT GUIDELINES:

  1. ALWAYS use the workingDir parameter to specify the working directory

  2. Request config of this MCP server configuration using tools

  3. Follow limitations taken from configuration

  4. Use validate_directories tool to validate directories before execution

Shell-Specific Settings:

powershell:

  • Command timeout: 30s

  • Max command length: 2000 characters

  • Injection protection: enabled

  • Blocked operators: &, |, ;, `

  • Path format: Windows-style (C:\Users...)

cmd:

  • Command timeout: 30s

  • Max command length: 2000 characters

  • Injection protection: enabled

  • Blocked operators: &, |, ;, `

  • Path format: Windows-style (C:\Users...)

gitbash:

  • Command timeout: 30s

  • Max command length: 2000 characters

  • Injection protection: enabled

  • Blocked operators: &, |, ;, `

  • Path format: Mixed (C:... or /c/...)

bash:

  • Command timeout: 30s

  • Max command length: 2000 characters

  • Injection protection: enabled

  • Blocked operators: &, |, ;, `

  • Path format: Unix-style (/home/user, /mnt/c/...)

  • Inherits global Windows paths (converted to /mnt/...)

wsl:

  • Command timeout: 30s

  • Max command length: 2000 characters

  • Injection protection: enabled

  • Blocked operators: &, |, ;, `

  • Path format: Unix-style (/home/user, /mnt/c/...)

  • Inherits global Windows paths (converted to /mnt/...)

Working Directory:

  • If omitted, uses the server's current directory

  • Must be within allowed paths for the selected shell

  • Must use the correct format for the shell type

Output Truncation:

  • Output is automatically truncated if it exceeds the configured limit

  • Current limit: 20 lines

  • Use maxOutputLines parameter to override the limit for a specific command

  • If truncated, use get_command_output tool with the executionId to retrieve full output

  • When file logging is enabled (via logDirectory), full logs are also saved to disk

Examples:

Windows CMD:

{ "shell": "cmd", "command": "dir /b", "workingDir": "C:\\Projects" }

WSL:

{ "shell": "wsl", "command": "ls -la", "workingDir": "/home/user", "maxOutputLines": 50 }

Bash:

{ "shell": "bash", "command": "ls -la", "workingDir": "/home/user", "maxOutputLines": 50 }

Git Bash:

{ "shell": "gitbash", "command": "git status", "workingDir": "/c/Projects/repo" // or "C:\Projects\repo" }

With custom output limit:

{ "shell": "gitbash", "command": "git log --oneline -50", "workingDir": "/c/Projects/repo", "maxOutputLines": 100 }
get_command_output

Retrieve the full output from a previous command execution.

Use this tool when command output was truncated and you need to see the complete result. The executionId is provided in the truncation message of the original command.

Parameters:

  • executionId (required): The execution ID from the truncation message

  • startLine (optional): 1-based start line (default: 1)

  • endLine (optional): 1-based end line (default: last line)

  • search (optional): Regex pattern (case-insensitive) to filter lines

  • maxLines (optional): Maximum lines to return (default: config value)

Examples:

{ "executionId": "20251125-143022-a8f3" }
{ "executionId": "20251125-143022-a8f3", "startLine": 100, "endLine": 150 }
{ "executionId": "20251125-143022-a8f3", "search": "error|failed|exception" }
get_current_directory

Get the current working directory

set_current_directory

Set the current working directory

get_config

Get the windows CLI server configuration

Returns:

  • global: Default settings applied to all shells

  • shells: Enabled shells with any overrides applied

Only enabled shells are included and technical fields like executables are omitted.

validate_directories

Check if directories are within allowed paths (only available when restrictWorkingDirectory is enabled)

Validation Modes:

  • Global: Validates against server-wide allowed paths (default)

  • Shell-specific: Validates against a specific shell's allowed paths

Shell-Specific Validation: Add the "shell" parameter to validate for a specific shell:

{ "directories": ["/home/user", "/tmp"], "shell": "wsl" }

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
CLI Server ConfigurationComplete server configuration with global and shell-specific settings
Global ConfigurationGlobal default settings applied to all shells
powershell Shell ConfigurationResolved configuration for powershell shell
cmd Shell ConfigurationResolved configuration for cmd shell
gitbash Shell ConfigurationResolved configuration for gitbash shell
bash Shell ConfigurationResolved configuration for bash shell
wsl Shell ConfigurationResolved configuration for wsl shell
Security InformationCurrent security settings and restrictions
Command Execution Logs ListList all stored command execution logs with metadata
Recent Command LogsGet most recent command execution logs (supports ?n=<count> and ?shell=<shell>)

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/s2005/wcli0'

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