Continuation of #213, the introduction of ISHRemoteMcpServer which has been used by many as a Prelease on the PowerShellGallery, even mentioned on https://community.rws.com
The challenge is that upon start of the PowerShell-based McpServer, the LLM needs to process around 400Kb of data generated for the around 87 Mcp Tools (ahum cmdlets) holding Get-Help input like
- NAME, SYNOPSIS, DESCRIPTION
- SYNTAX which explains the difference between optional and mandatory parameters per parameter set
- PARAMETERS
- EXAMPLES
The idea is to reduce the initial token usage to only give a shallow Mcp Tool description except for some important cmdlets like
Get-Help, basic PowerShell, which instructs the LLM
New-IShSession
The Model Context Protocol describes an Mcp Tool by
- name
- description, which so far concatenates DESCRIPTION, SYNOPSIS, SYNTAX (mandatory parameters), EXAMPLES
- annotations; holds the hints if the cmdlet is destructive or idempotent which is important for autorunning
- inputSchema; holds the PARAMETERs description except if they are mandatory for the parameter set (only visible in SYNTAX)
- returns; by default a string for the LLM
Actions...
Continuation of #213, the introduction of
ISHRemoteMcpServerwhich has been used by many as aPreleaseon the PowerShellGallery, even mentioned on https://community.rws.comThe challenge is that upon start of the PowerShell-based McpServer, the LLM needs to process around 400Kb of data generated for the around 87 Mcp Tools (ahum cmdlets) holding
Get-Helpinput likeThe idea is to reduce the initial token usage to only give a shallow Mcp Tool description except for some important cmdlets like
Get-Help, basic PowerShell, which instructs the LLMNew-IShSessionThe Model Context Protocol describes an Mcp Tool by
Actions...
Register-IshRemoteMcpTool.Tests.ps1to check and test if backward compatibility with the Prelease is possible.Register-IshRemoteMcpInstructions.Tests.ps1to check for some contentInvoke-IshRemoteMcpHandleRequest.Tests.ps1with dummy Json values. Make sure to mock $Request with properties id/method and paramsFunctionNameofRegister-IshRemoteMcpTooltoFunctionNamePartialLoadandFunctionNameFullLoadPartialLoadmeans skip EXAMPLES, PARAMETERS? ... reduced from 280k to 44kCmdletsToRegisterofStart-IshRemoteMcpServerwill becomePartialLoad, adding optional parameterCmdletsToRegisterFullLoadfor old behavior. This second parameter gets above list likeGet-HelpandNew-IShSessionand make sure that these are not double loaded (by removing them fromCmdletsToRegister).Write-IshRemoteLogwith extra bigif ($script:logFilePath)to check for$nullor empty string (''). Best to add a simpleWriteIshRemoteLog.Tests.ps1to verify for errors.ReleaseNotes-ISHRemote-8.2.mdto explain the progressive behavior reducing token count and how previous behavior can be used.*.Tests.ps1files