-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
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 LLMNew-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...
- Add alpha release Pesters Tests like
Register-IshRemoteMcpTool.Tests.ps1to check and test if backward compatibility with the Prelease is possible. - Add
Register-IshRemoteMcpInstructions.Tests.ps1to check for some content - Add
Invoke-IshRemoteMcpHandleRequest.Tests.ps1with dummy Json values. Make sure to mock $Request with properties id/method and params - Split parameter
FunctionNameofRegister-IshRemoteMcpTooltoFunctionNamePartialLoadandFunctionNameFullLoad- Where
PartialLoadmeans skip EXAMPLES, PARAMETERS? ... reduced from 280k to 44k
- Where
- Parameter
CmdletsToRegisterofStart-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). - Extend all scripts with PowerShell help node at the top
- Adapt instructions to instruct LLM on progressive discovery ...seemingly not need
- Extend
Write-IshRemoteLogwith extra bigif ($script:logFilePath)to check for$nullor empty string (''). Best to add a simpleWriteIshRemoteLog.Tests.ps1to verify for errors. - Adapt
ReleaseNotes-ISHRemote-8.2.mdto explain the progressive behavior reducing token count and how previous behavior can be used. - Release build should not contain any
*.Tests.ps1files
Reactions are currently unavailable