Skip to content

Releases: yotsuda/PowerShell.MCP

PowerShell.MCP v1.6.1 - Cross-Platform Stability & Performance Improvements

08 Feb 13:52

Choose a tag to compare

Cross-Platform Stability & Performance Improvements

This release improves cross-platform reliability, console performance, and broader PowerShell compatibility, making PowerShell.MCP more stable on Linux/macOS and preventing performance degradation from heavy usage.

🎉 What's New

Cross-Platform Console Title

Console window title now works correctly on Linux and macOS. Previously, Console.Title threw exceptions on non-Windows platforms, causing the title to fall back to PID only. Now uses $Host.UI.RawUI.WindowTitle via the PowerShell Host API on Unix systems.

Multi-line Command History Handling

Multi-line commands are now intentionally excluded from PSReadLine history with a clear warning message.

Why this matters: Multi-line commands significantly contribute to history file growth, leading to severe performance degradation. By excluding them from PSReadLine history, you avoid console slowdowns while still being able to execute multi-line commands normally.

Automatic History File Trimming

Critical performance fix: PSReadLine history file is now automatically trimmed to 4,096 lines when it exceeds 1 MB.

Why this matters: Large history files cause severe console performance degradation — command input becomes sluggish with noticeable delays of several seconds when typing. This issue became more prevalent in v1.6.0 with multi-instance support, as multiple Claude Code instances writing to history can rapidly grow the file.

PowerShell 7.4 Support

Minimum PowerShell version lowered from 7.5 to 7.4 for broader compatibility. The module DLL targets net8.0 (forward-compatible with net9.0). The Proxy is self-contained and requires no .NET installation.


📊 What's Changed Since v1.6.0

User-Facing Changes

  • Cross-platform console title: Uses Host API on Unix instead of Console.Title
  • Multi-line history handling: Clear warnings when commands cannot be added to history
  • Performance fix: Automatic history file trimming prevents console slowdown
  • Compatibility: PowerShell 7.4 support (down from 7.5)

Internal Improvements

  • Replace string literals with PipeStatus constants for pipe status checks
  • Inject PipeDiscoveryService via DI instead of creating new instances per call
  • Reuse NamedPipeClient instance in WaitForPipeReadyAsync loop
  • Remove unused StartPowerShellConsoleParams class
  • Remove duplicate Get-Process call in Get-MCPOwner fallback
  • 500+ lines of new unit tests for PowerShellTools
  • CI workflow now runs tests on Windows, Ubuntu, and macOS

🔄 Installation & Upgrade

Windows

# New installation
Install-Module PowerShell.MCP -Force

# Upgrade existing
Update-Module PowerShell.MCP

Linux / macOS

# Install
pwsh -Command "Install-Module PowerShell.MCP -Scope CurrentUser -Force"

# Set execute permission
chmod +x $(pwsh -Command "Import-Module PowerShell.MCP; Get-MCPProxyPath")

Update MCP Configuration

For Claude Code:

claude mcp add PowerShell -s user -- "$(Get-MCPProxyPath)"

For Claude Desktop — Update claude_desktop_config.json:

Get-MCPProxyPath -Escape  # Returns JSON-escaped path
{
  "mcpServers": {
    "PowerShell": {
      "command": "C:\\Users\\YourName\\Documents\\PowerShell\\Modules\\PowerShell.MCP\\1.6.1\\bin\\win-x64\\PowerShell.MCP.Proxy.exe"
    }
  }
}

Restart your MCP client after updating.

📖 Full Guide: https://github.com/yotsuda/PowerShell.MCP#quick-start


Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions | Report Issues: GitHub Issues

PowerShell.MCP v1.6.0 - Multi-Instance & Sub-Agent Support for Claude Code

06 Feb 13:49

Choose a tag to compare

Multi-Instance & Sub-Agent Support for Claude Code

This release adds multi-instance isolation, sub-agent console isolation, automatic console naming, and enhanced console management features, making PowerShell.MCP safer and more reliable when using multiple Claude Code instances and sub-agents simultaneously.

🎉 What's New

Multi-Instance Isolation for Claude Code

Unlike Claude Desktop (which runs only one instance at a time), Claude Code allows multiple instances to run simultaneously. Previously, this could cause issues when multiple Claude Code instances shared the same PowerShell console, leading to unpredictable behavior.

v1.6.0 ensures each Claude Code instance gets its own isolated PowerShell console. This brings:

  • 🔒 Safety: No console conflicts between Claude Code instances
  • 🚀 Parallel workflows: Work on multiple projects simultaneously
  • 🎯 Predictable behavior: Each instance operates independently

Example: Safe concurrent usage

Claude Code #1 (Project A)  →  Dedicated PowerShell Console "Zeus"
Claude Code #2 (Project B)  →  Dedicated PowerShell Console "Sirius"
Claude Code #3 (Project C)  →  Dedicated PowerShell Console "Maple"

All instances run independently without interfering with each other.

Sub-Agent Console Isolation

Claude Code's sub-agents (Task tool) can now get their own isolated console sessions. Each sub-agent runs in a dedicated console without interfering with the main agent or other sub-agents.

  • 🔀 Independent sessions: Each agent operates in its own console with separate state
  • 🧹 Automatic cleanup: Unused agent sessions are removed automatically

Example: Parallel sub-agent execution

Main Agent     →  Console "Zeus"
Sub-Agent A    →  Console "Apollo"
Sub-Agent B    →  Console "Athena"

All existing tools accept an optional agent_id parameter for console isolation. When omitted, they default to the main agent's console for backward compatibility.

Automatic Console Naming

Each console now gets a unique, memorable name automatically displayed in the window title. This makes it easy to identify which console belongs to which Claude Code instance when working with multiple instances simultaneously.

  • Category per client: Each MCP client is assigned a unique category (Greek mythology, animals, colors, etc.)
  • Consistent naming: All consoles from the same client use names from the same category
  • Easy identification: Instantly see which console you're looking at (#12345 Zeus)
  • Status line integration: Console names shown in command results
✓ Pipeline executed successfully | Window: #12345 Zeus | Status: Ready

Why this matters: When running multiple Claude Code instances, you can identify which instance owns a console by its naming category. For example, if one instance uses Greek names and another uses star names, you'll always know which is which.

Console Adoption

Claude can now work with both AI-started and user-started PowerShell consoles:

  • AI-started consoles: PowerShell.MCP is automatically imported when Claude starts a console
  • User-started consoles: Import PowerShell.MCP manually to let Claude join your existing console session

Get-MCPOwner Cmdlet

Check which proxy owns the current console:

Get-MCPOwner
# Returns: Owned (True/False), ProxyPid, AgentId, ClientName (Claude Desktop/Claude Code/etc.)

Install-ClaudeSkill Cmdlet

Install PowerShell.MCP skills as Claude Code slash commands:

Install-ClaudeSkill              # Install all skills to ~/.claude/skills/
Install-ClaudeSkill ps-analyze   # Install specific skill

start_location Parameter (start_powershell_console)

Specify a starting directory when launching a new PowerShell console.

Progress Bar Cleanup

Residual progress bar text is now properly cleared after command completion.


📊 What's Changed Since v1.5.1

New Features

  • Multi-instance isolation: Proxy PID in pipe naming
  • Sub-agent console isolation: generate_agent_id tool and per-agent session state
  • Automatic console naming: Categorized, randomized names for easy identification
  • Get-MCPOwner cmdlet: Query console ownership
  • Install-ClaudeSkill cmdlet: Install skills as Claude Code slash commands
  • start_location: Specify starting directory for new consoles

Improvements

  • Disabled CLICOLOR_FORCE: gh CLI output is now intentionally monochrome for reliable JSON piping (git colors unaffected)
  • PowerShellVersion requirement updated from 7.2 to 7.5 (module targets .NET 9)

🔄 Installation & Upgrade

Windows

# New installation
Install-Module PowerShell.MCP -Force

# Upgrade existing
Update-Module PowerShell.MCP

Linux / macOS

# Install
pwsh -Command "Install-Module PowerShell.MCP -Scope CurrentUser -Force"

# Set execute permission
chmod +x $(pwsh -Command "Import-Module PowerShell.MCP; Get-MCPProxyPath")

Update MCP Configuration

For Claude Code:

claude mcp add PowerShell -- "$(Get-MCPProxyPath)"

For Claude Desktop — Update claude_desktop_config.json:

Get-MCPProxyPath -Escape  # Returns JSON-escaped path
{
  "mcpServers": {
    "PowerShell": {
      "command": "C:\\Users\\YourName\\Documents\\PowerShell\\Modules\\PowerShell.MCP\\1.6.0\\bin\\win-x64\\PowerShell.MCP.Proxy.exe"
    }
  }
}

Restart your MCP client after updating.

📖 Full Guide: https://github.com/yotsuda/PowerShell.MCP#quick-start


Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions | Report Issues: GitHub Issues

PowerShell.MCP v1.5.1 - Recursive Search & Performance Improvements

31 Jan 06:32

Choose a tag to compare

Recursive Search & Performance Improvements

This release adds recursive directory search to Show-TextFile and brings significant performance optimizations across file operations.

🎉 What's New

Show-TextFile -Recurse

Search files recursively across subdirectories:

Show-TextFile . -Recurse -Pattern "TODO"           # Search all files
Show-TextFile *.cs -Recurse -Contains "FIXME"      # Search C# files only

Requires -Pattern or -Contains to be specified.

-Contains and -Pattern Combination

-Contains and -Pattern can now be combined (OR condition):

Show-TextFile log.txt -Contains "[Error]" -Pattern "Warning|Critical"
# Matches lines containing "[Error]" OR matching "Warning|Critical"

FileShare.ReadWrite Support

Show-TextFile can now read files locked by other processes (e.g., log files being written to by another application).

Newline Normalization in Update-MatchInFile

Newlines in -Replacement are automatically normalized to match the file's line ending style (CRLF/LF).


📊 What's Changed Since v1.5.0

New Features

  • -Recurse parameter: Recursive directory search in Show-TextFile
  • -Contains + -Pattern: OR condition when both are specified
  • FileShare.ReadWrite: Read files locked by other processes
  • Newline normalization: Auto-normalize line endings in replacement text

Performance Improvements

  • Cached compiled Regex instance across files
  • Cached Match results to avoid redundant regex calls
  • Fast BOM-only encoding detection for Show-TextFile
  • Batch WriteObject calls for better output performance
  • Index-based highlighting instead of Regex.Replace

Documentation

  • Simplified PlatyPS help documentation for LLM consumption

Code Quality

  • Removed UTF-8 BOM from all C# files
  • Removed trailing whitespace from C# files

Tests

  • Added ShowTextFileContainsPatternCombination.Tests.ps1
  • Added ShowTextFileShareReadWrite.Tests.ps1
  • Added UpdateMatchNewlineNormalization.Tests.ps1

Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions | Report Issues: GitHub Issues

PowerShell.MCP v1.5.0 - Multi-Console & Long-Running Command Support

25 Jan 02:52

Choose a tag to compare

Multi-Console & Long-Running Command Support

This release introduces multi-console management and long-running command support, enabling AI assistants to execute multiple commands in parallel and handle commands that take longer than the MCP timeout.

🎉 What's New

Multi-Console Management

PowerShell.MCP now supports multiple simultaneous PowerShell consoles. When a console is busy executing a command, the system automatically:

  • Detects busy consoles via lightweight status checks
  • Switches to an available console, or starts a new one
  • Tracks and reports status of all active consoles

Use start_powershell_console to explicitly launch additional consoles when needed.

Long-Running Command Support

Commands that exceed the timeout (default: 170 seconds) now continue running in the background:

  • Results are automatically cached when timeout occurs
  • Use wait_for_completion tool to retrieve cached results
  • Multiple timed-out commands can be tracked simultaneously

Timeout Control

The invoke_expression tool now accepts a timeout_seconds parameter (0-170, default: 170):

  • Set to 0 for interactive commands (e.g., Read-Host, pause)
  • Shorter timeouts for quick status checks
  • Commands continue in background after timeout

📊 What's Changed Since v1.4.1

New Features

  • Multi-console management: Automatic busy detection and console switching
  • wait_for_completion tool: Retrieve results from long-running commands
  • timeout_seconds parameter: Configurable timeout for invoke_expression (0-170 seconds)
  • Output caching system: Automatic caching for timed-out and switched-console scenarios

Breaking Changes

  • Removed execute_immediately parameter: This parameter allowed inserting commands into the console without executing them (user would press Enter manually). Removed due to low usage - the same workflow can be achieved by asking the AI for a command and copy-pasting it to the console.

Improvements

  • Heartbeat detection: Detects user-initiated commands and automatically switches to a new console, preventing MCP from blocking
  • Scope warning: Warns when local variables are assigned without $script: or $global: prefix (which won't persist across calls)
  • Closed console detection: Tracks busy PIDs across tool calls to detect externally closed consoles
  • macOS $TMPDIR support: Improved Named Pipe discovery on macOS
  • Status reporting: Reports remaining busy consoles when returning completed results
  • Console startup: Pipeline not executed on console switch to ensure correct working directory
  • Pipe readiness check: Verifies standby status instead of just connection availability

Bug Fixes

  • Fixed Add-LinesToFile adding BOM to BOM-less UTF-8 files
  • Fixed macOS/Linux pipe discovery with polling and standby check
  • Fixed macOS/Linux to activate newly started console by tracking existing pipes

Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions | Report Issues: GitHub Issues

⚠️ Security Notice: Provides complete PowerShell access. Use in trusted environments only.

PowerShell.MCP v1.4.1 - Syntax Highlighting & Stability Improvements

25 Dec 03:12

Choose a tag to compare

Syntax Highlighting & Startup Banner

This release improves syntax highlighting accuracy, prevents conflicts from multiple server instances, and adds customizable startup banners.

🎉 What's New

Startup Banner

The start_powershell_console tool now accepts an optional banner parameter to display a customizable message when the PowerShell console launches. AI assistants can use this to add personality with greetings, jokes, or fun facts!

Single Instance Enforcement

PowerShell.MCP now detects if another server is already running and fails module import with a clear error message. This prevents confusion from orphaned sessions or duplicate servers.

Detection uses a connection test to the named pipe/socket, which works reliably on all platforms.


📊 What's Changed Since v1.4.0

New Features

  • Startup banner: start_powershell_console now supports a banner parameter for custom startup messages (displayed in green)

Improvements

  • Comment token coloring: Comments are now properly colored (DarkGreen by default)
  • PSReadLine color matching: Default colors updated to match PSReadLine defaults
    • Keyword: Yellow → Green
    • Member: White → Gray
    • Default: White → Gray

Internal

  • Build script now supports -Target parameter for selective builds (Dll, WinX64, LinuxX64, OsxX64, OsxArm64)

Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions | Report Issues: GitHub Issues

Security Notice: Provides complete PowerShell access. Use in trusted environments only.

PowerShell.MCP v1.4.0 - Cross-Platform Support: Linux & macOS

22 Dec 14:46

Choose a tag to compare

Cross-Platform Support: Linux & macOS

This release adds Linux and macOS support, enabling PowerShell.MCP to run on all major platforms.

🎉 Cross-Platform Support

Now available on Linux and macOS

Platform Architecture Status
Windows x64 ✅ Supported
Linux x64 New
macOS x64 (Intel) New
macOS arm64 (Apple Silicon) New

📊 What's Changed Since v1.3.9

New Features

  • Linux support: Works with gnome-terminal, konsole, xfce4-terminal, xterm, lxterminal, mate-terminal, terminator, tilix, alacritty, kitty
  • macOS support: Works with Terminal.app on both Intel and Apple Silicon Macs
  • Login shell integration: Uses $SHELL -l -c to properly inherit user environment (PATH, etc.)
  • Home directory start: pwsh console starts in user's home directory with -WorkingDirectory ~
  • Multiple sessions: Removed Named Pipe existence check to allow multiple PowerShell.MCP sessions

Improvements

  • Version mismatch error now shows Get-MCPProxyPath -Escape tip on Windows
  • Version mismatch error now shows Get-MCPProxyPath tip on Linux/macOS
  • Added GitHub Actions CI/CD for cross-platform testing
  • PSReadLine is automatically removed on Linux/macOS (not supported)

Bug Fixes

  • Fixed nullable reference warnings in TextFileUtility and ShowTextFileCmdlet
  • Fixed Update-MatchInFile help to show -OldText instead of -Contains

Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions | Report Issues: GitHub Issues

Security Notice: Provides complete PowerShell access. Use in trusted environments only.

PowerShell.MCP v1.3.9 - Breaking Change: -Contains to -OldText & BOM Preservation Fix

20 Dec 05:59

Choose a tag to compare

Breaking Change: -Contains to -OldText & BOM Preservation Fix

This release includes a breaking parameter rename in Update-MatchInFile, BOM preservation fix for UTF-8 files, tail line removal support, and significant code quality improvements.

⚠️ Breaking Change

-Contains → -OldText in Update-MatchInFile

The -Contains parameter has been renamed to -OldText for clarity:

# Before (v1.3.8)
Update-MatchInFile file.txt -Contains "old" -Replacement "new"

# After (v1.3.9)
Update-MatchInFile file.txt -OldText "old" -Replacement "new"

📊 What's Changed Since v1.3.8

Bug Fixes

  • BOM preservation: UTF-8 files with BOM now retain BOM when entire content is replaced

New Features

  • Tail line removal: Remove-LinesFromFile supports negative LineRange (e.g., -LineRange -10 removes last 10 lines)

Improvements

  • Updated tool descriptions with -WhatIf recommendations and tail removal syntax
  • Renamed CreateInteractiveMap to ShowInteractiveMap with localized display text

Code Quality

  • Extracted AnsiColors class for centralized ANSI color code management
  • Extracted ContentAccumulatingCmdletBase for shared pipeline input handling
  • Added IsWhatIfMode helper method to TextFileCmdletBase
  • Translated all Japanese comments to English
  • Removed unused NotificationService and debug comments

Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions | Report Issues: GitHub Issues

Security Notice: Provides complete PowerShell access. Use in trusted environments only.

PowerShell.MCP v1.3.8 - Visual -WhatIf Preview for Remove-LinesFromFile & Safety Improvements

04 Dec 12:20

Choose a tag to compare

Visual -WhatIf Preview for Remove-LinesFromFile & Safety Improvements

This release adds visual diff preview to Remove-LinesFromFile, safer deletion handling for Update-LinesInFile, newline validation across all pattern-matching cmdlets, and performance improvements to Update-MatchInFile.

✨ What's New

🔍 Visual -WhatIf Preview for Remove-LinesFromFile

Remove-LinesFromFile -WhatIf now displays a detailed preview showing exactly which lines will be deleted:

  • Red highlighting for lines being removed
  • Yellow background for matched pattern/text within deleted lines
  • Surrounding context lines for clarity
  • No file modification until you confirm
# Preview which lines will be deleted
Remove-LinesFromFile log.txt -Contains "ERROR" -WhatIf

# Output shows:
#   1- Previous line
#   2: Error message here     ← Red with "ERROR" highlighted in yellow
#   3- Next line

⚡ Performance: Update-MatchInFile Single-Pass Processing

Update-MatchInFile has been refactored from 2-pass to 1-pass processing, reading the file only once instead of twice. This improves performance especially for large files.

🛡️ Safer Deletion Handling for Update-LinesInFile

Update-LinesInFile now requires -Content parameter when -LineRange is specified:

# Explicit deletion (works as before)
Update-LinesInFile file.txt -LineRange 5,10 -Content @()

# Omitting -Content now throws an error (previously would silently delete)
Update-LinesInFile file.txt -LineRange 5,10  # Error!

This prevents accidental line deletion when -Content is forgotten.

🚫 Newline Validation for Pattern Parameters

All cmdlets with -Pattern or -Contains parameters now reject newline characters:

# These now throw errors immediately (instead of silently failing to match)
Show-TextFile file.txt -Pattern "line1`nline2"      # Error!
Update-MatchInFile file.txt -Contains "a`nb" -Replacement "x"  # Error!
Remove-LinesFromFile file.txt -Pattern "multi`nline"  # Error!

📊 What's Changed Since v1.3.7

New Features

Visual -WhatIf Preview:

  • Remove-LinesFromFile -WhatIf shows lines to be deleted in red
  • Pattern/Contains matches highlighted with yellow background
  • Context lines displayed for clarity

Pipeline Input Support:

  • Add-LinesToFile -Content now accepts pipeline input
  • Update-LinesInFile -Content now accepts pipeline input

Improvements

Performance:

  • Update-MatchInFile refactored from 2-pass to 1-pass processing (reads file once instead of twice)

Display:

  • Update-MatchInFile normal execution now shows only replacement text (green), while -WhatIf shows both before (red) and after (green)

Safety:

  • Update-LinesInFile now requires -Content when -LineRange is specified
  • Newline validation added to Show-TextFile, Update-MatchInFile, Remove-LinesFromFile

Bug Fixes:

  • Add-LinesToFile now displays actual insertion line number in summary message

Code Quality

  • Reduced code duplication with shared pipeline input handling
  • Lazy initialization for content accumulation

🔧 Technical Details

Newline Validation

Cmdlet -Pattern -Contains
Show-TextFile ✅ Error ✅ Error
Update-MatchInFile ✅ Error ✅ Error
Remove-LinesFromFile ✅ Error ✅ Error

Update-LinesInFile Content Behavior

Specification Intent Behavior
-Content omitted Ambiguous Error (safe default)
-Content @() Explicit delete Delete lines
-Content "text" Replace Replace with text
-Content "" Replace with empty Single empty line

Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions

Report Issues: GitHub Issues


Security Notice: Provides complete PowerShell access. Use in trusted environments only.

PowerShell.MCP v1.3.7 - Enhanced Text File Cmdlets with Visual Diff Preview

30 Nov 14:11

Choose a tag to compare

Enhanced Text File Cmdlets with Visual Diff Preview

This release brings significant improvements to text file operations, featuring a new visual diff preview for -WhatIf, tail display support with negative line ranges, and consistent ANSI color output across all cmdlets.

✨ What's New

🔍 Visual Diff Preview with -WhatIf

Update-MatchInFile -WhatIf now displays a detailed line-by-line diff preview showing exactly what will change:

  • Red highlighting for text being removed
  • Green highlighting for text being added
  • Surrounding context lines for clarity
  • No file modification until you confirm
# Preview changes before applying
Update-MatchInFile config.json -Contains "localhost" -Replacement "production" -WhatIf

📜 Tail Display with Negative LineRange

Show-TextFile now supports negative line numbers to display the last N lines of a file:

# Show last 10 lines
Show-TextFile log.txt -LineRange -10

# Equivalent to above
Show-TextFile log.txt -LineRange -10,-1

🎨 Consistent ANSI Color Output

All text file cmdlets now use a unified color scheme:

  • Bold white headers (==> filename <==)
  • Cyan summary messages
  • Yellow for search match highlights
  • Green for additions
  • Red for deletions
  • Yellow for WhatIf messages

📊 What's Changed Since v1.3.6

New Features

Visual Diff Preview:

  • Update-MatchInFile -WhatIf shows detailed before/after comparison
  • -Confirm with "No" now exits silently without output

Tail Display:

  • Added RotateBuffer<T> class for efficient tail operations
  • Show-TextFile -LineRange -N displays last N lines
  • Negative end values (e.g., 100,-1) mean "to end of file"

Color Improvements:

  • Standardized ANSI color scheme across all cmdlets
  • Added bold headers to Update-LinesInFile output
  • Yellow highlighting for pattern matches in context lines

Improvements

  • Prompt display after command execution: The PowerShell prompt now displays immediately after each command completes, making it clearer when the console is ready for the next input

Bug Fixes

  • Fixed Show-TextFile gapLine handling to prevent duplicate output
  • Fixed 1-line gap display between match groups

Code Quality

  • Removed DEBUG logs from Proxy services (cleaner stderr output)
  • Removed unused Test-TextFileContains cmdlet
  • Refactored cmdlets to use RotateBuffer for consistent tail handling

🔧 Technical Details

RotateBuffer

A new fixed-capacity circular buffer for efficient "last N items" collection:

var buffer = new RotateBuffer<string>(10);  // Keep last 10 items
foreach (var line in File.ReadLines(path))
    buffer.Add(line);
// buffer now contains last 10 lines

LineRange Parameter Enhancements

Input Meaning
5 Line 5 only
5,10 Lines 5 to 10
5,-1 or 5,0 Line 5 to end of file
-10 Last 10 lines
-10,-1 Last 10 lines (explicit)

Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions

Report Issues: GitHub Issues


Security Notice: Provides complete PowerShell access. Use in trusted environments only.

PowerShell.MCP v1.3.6 - Enhanced CLI Tool Color Support

13 Nov 12:31

Choose a tag to compare

Enhanced CLI Tool Color Support

This release extends automatic color output support to additional CLI tools, improving the visual experience when working with modern development tools like GitHub CLI, .NET tools, and 24-bit color terminals.

✨ What's New

🌈 Extended Color Output Support

Added automatic color output for additional CLI tools commonly used in development workflows:

  • GitHub CLI (gh): Now displays colored output via CLICOLOR_FORCE
  • .NET Tools: Console applications now support ANSI color redirection
  • 24-bit Color Terminals: Modern terminals with truecolor support are automatically detected via COLORTERM

These additions complement existing color support for Git, npm, yarn, cargo, and pytest, providing a consistent colorful experience across your entire toolchain.


📊 What's Changed Since v1.3.5

Core Enhancements

Environment Variables:

  • Added CLICOLOR_FORCE='1' for GitHub CLI and standard CLI tools
  • Added COLORTERM='truecolor' for 24-bit color terminal support
  • Added DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION='1' for .NET tools

Behavior:

  • All color environment variables are set conditionally (only if not already defined)
  • Respects user's existing color configuration
  • Maintains backward compatibility with v1.3.5

🔧 Technical Details: Color Environment Variables

PowerShell.MCP automatically configures the following environment variables to enable ANSI color output in MCP environments where stdout is redirected (not a TTY):

Environment Variable Value Target Tools Version Added Description
GIT_CONFIG_PARAMETERS 'color.ui=always' Git v1.3.5 Forces Git to output colors even when stdout is not a terminal. Preserves existing user configurations.
FORCE_COLOR 1 Node.js tools (yarn, chalk, etc.) v1.3.5 Standard variable for Node.js ecosystem to force color output.
NPM_CONFIG_COLOR always npm v1.3.5 npm-specific configuration to always show colors.
CARGO_TERM_COLOR always Rust cargo v1.3.5 Enables colored output for Rust's package manager.
PY_COLORS 1 pytest, Python tools v1.3.5 Standard Python variable to enable ANSI colors.
CLICOLOR_FORCE 1 GitHub CLI (gh), standard CLI tools v1.3.6 Industry-standard variable for forcing color output in POSIX-style tools.
COLORTERM truecolor Modern terminals v1.3.6 Indicates 24-bit color (16 million colors) support to applications.
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION 1 .NET console apps v1.3.6 Enables ANSI color codes in .NET applications when output is redirected.

Configuration Behavior

  • Non-Destructive: All variables are set conditionally using if (-not $env:VARIABLE), respecting existing user configurations.
  • Persistent: Environment variables remain active throughout the PowerShell session.
  • Automatic: Configuration happens transparently when the MCP server starts—no user action required.

Why These Variables Are Needed

When PowerShell captures output from external CLI tools (e.g., via pipes or variable assignment), those tools detect that their output is being redirected rather than displayed directly to a terminal. Most CLI tools disable ANSI color codes in this "non-interactive" mode to avoid cluttering logs with escape sequences. These environment variables override that detection, forcing tools to output color codes even when their stdout is redirected, ensuring colorful output is preserved for better readability and user experience.


Full Documentation: https://github.com/yotsuda/PowerShell.MCP

Questions? GitHub Discussions

Report Issues: GitHub Issues


Security Notice: Provides complete PowerShell access. Use in trusted environments only.