Setting Environment Variable for npx Command in Windows

I’m currently trying to run a command in PowerShell that requires setting an environment variable. Specifically, I need to set a GitHub personal access token for the command cmd /c npx @modelcontextprotocol/server-github.

$env:GITHUB_PERSONAL_ACCESS_TOKEN = "<YOUR_TOKEN>"; cmd /c npx @modelcontextprotocol/server-github

Is this currently not possible on Windows? Command without the access token is able to start the MCP server but none of the tools work since they require authentication.

Switched over to smithery-ai and worked

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.