MCP endpoint: send server instructions (one global text, and one text per role)

MCP endpoint: send server instructions (one global text, and one text per role)

2 votes

avatar

Version 2026.3.5

Impact: MCP clients (Claude Code, Codex, Gemini CLI) use the instructions field of the initialize reply to decide when to use a server's tools. PowerShell Universal does not send it, so agents use PSU tools only when the user names one.

  • Current: the initialize reply from /api/v1/mcp has serverInfo and capabilities, but no instructions. The only MCP setting is Mcp:ServerName.

  • Request 1: one instructions text for the endpoint, for example Mcp:ServerInstructions.

  • Request 2: one text per role, with the global text as the fallback. Each app token has a role, and each role sees different tools.

  • Code: McpRegistrationFeature (PowerShellUniversal.Intelligence.dll) does not set McpServerOptions.ServerInstructions. HttpServerTransportOptions.ConfigureSessionOptions receives the HttpContext and can set it per session.

  • Tested: on 2026.3.5, a .NET startup hook that sets ServerInstructions in ConfigureSessionOptions makes the initialize reply include the text. The SDK in the shipped build already supports this feature.

Example appsettings.json (names are a suggestion). A caller with the Operator role gets the Operator text. A role with no entry gets ServerInstructions.

{
  "Mcp": {
    "ServerName": "PowerShell Universal",
    "ServerInstructions": "IT automation. Use these tools for user accounts, groups and job results.",
    "RoleInstructions": {
      "Operator": "Read-only tools: find users, list group members, read job output.",
      "Administrator": "Read and change tools: create users, change group membership, run deployment scripts."
    }
  }
}

All Comments (1)

avatar

@PhatmandrakeThis is a great idea. I'll open an issue for it. We may surface some of this in the admin console rather than appsettings.json but I'll circle back with any questions. 

Adam Driscoll

PowerShell Expert and Software Architect at Devolutions