MCP Server on Windows: Setup, Paths, and Startup Fixes
Setting up an MCP server on Windows has a few specific requirements: command paths that include spaces need quoting, the shell used to start subprocesses matters, and environment variables work differently than on macOS. Here is how to set up and troubleshoot MCP connections on Windows.
Updated 4 min read
An MCP server on Windows works the same way as on macOS or Linux at the protocol level, but the setup has some Windows-specific requirements. The path separator is a backslash, paths with spaces need quoting, and the shell used to start a stdio server subprocess matters. Getting these right the first time saves the back-and-forth of a server that starts from a terminal but fails to start from the AI client. Tools like fenbs let you save a working setup configuration and the lessons from problems you solve, so the next setup or reinstall starts from a known good state.
These steps apply to Claude Desktop, Cursor, and other AI clients that use a JSON config file to launch local MCP servers on Windows. For the general config format, see MCP server configuration.
Set up an MCP server on Windows
- Install the server package. For npm packages, run
npm install -g <package-name>in a Command Prompt or PowerShell window with administrator rights, or use npx without a global install. - Find the full path to the executable. Run
where npx(for npm) orwhere nodein Command Prompt to get the exact path. This path goes in thecommandfield of the config. - Open the AI client's config file. In Claude Desktop, it is at
%APPDATA%\Claude\claude_desktop_config.json. Open it in a text editor like Notepad or VS Code. - Add the server entry. Use
cmdorpowershellas the command if the server needs a shell to resolve environment variables, with/cor-Commandas the first argument. - Save the config and restart the AI client. If the server does not appear, check the AI client's logs for the error message.
{
"mcpServers": {
"my-tool": {
"command": "cmd",
"args": ["/c", "npx", "-y", "my-mcp-package"],
"env": {
"MY_API_KEY": "your-key-here"
}
}
}
}Path and quoting issues
Windows paths often contain spaces, particularly in C:\Program Files and user profile directories. A path with spaces must be quoted in the config. In JSON, a backslash is an escape character, so a Windows path like C:\Users\Alice\AppData must be written as "C:\\Users\\Alice\\AppData" in the JSON value — each backslash doubled.
Using cmd /c as the command avoids many path issues because cmd resolves executables on the system PATH the same way a Command Prompt window does. If npx works from a Command Prompt but not from the AI client config, try adding cmd as the command and moving npx to the first element of args.
Environment variables and credentials
The env object in the config passes environment variables to the subprocess. This is where API keys and secrets go. The AI client does not inherit your user profile environment variables by default, so a key that works in PowerShell because it is in your user environment may not be available to the subprocess unless you add it explicitly to the config.
Do not put credentials in the args array, where they show up in process listings. Keep them in env, and keep the config file out of version control. On a shared machine, set the config file permissions so only your user account can read it.
Startup and process checks
If the server fails to start, open Task Manager and look for the expected process. A node process that exits immediately usually means a missing dependency or a wrong path. Run the same command from a Command Prompt to see the error message directly.
Claude Desktop logs MCP server startup errors to %APPDATA%\Claude\logs. Other clients have similar log locations. Reading the log gives you the exact error message rather than guessing from the tool list being empty. See MCP server architecture for how the client-server startup protocol works.
Remote MCP servers on Windows
Remote HTTP MCP servers (including fenbs) work on Windows the same as on other platforms: add the URL to the config and follow the OAuth sign-in if prompted. There are no Windows-specific path or shell issues for remote connections. If a remote server is not reachable, check that a corporate proxy or firewall is not blocking the connection.
For hosting your own MCP server on a Windows machine that other clients can reach, see MCP server hosting. The MCP server spec covers the protocol requirements for HTTP transport.
PowerShell handles argument quoting differently from cmd in a few edge cases, particularly for strings that contain equals signs, pipes, or parentheses. If a server command that works in cmd fails when run from PowerShell, check whether special characters are being interpreted rather than passed through. Single-quoted strings in PowerShell are literal; double-quoted strings expand variables. When the MCP config sets cmd as the command with the actual tool command in args, the cmd process handles argument interpretation, which avoids most PowerShell quoting edge cases. Test both shells when documenting a working setup so the next person on the team knows which one was used.
Save a working setup and lessons from what broke
After you get an MCP server working on Windows, record the working config pattern as a lesson in fenbs: which command and args worked, which path format was needed, and what troubleshooting steps resolved the startup issue. The next setup on a new machine or after a reinstall starts from the working pattern rather than from scratch.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
How to do this with fenbs
- Create a free account and add a project for your Windows MCP setup.
- After a successful setup, record the working command, args pattern, and any path quirks as a context note or lesson.
- When a setup step goes wrong and you find the fix, add a Lesson learned: what the error was, what caused it, and what resolved it.
- Connect fenbs to your AI app at Integrations. The assistant reads the setup notes and lessons before trying to help with future Windows MCP issues.
- Update the notes if a Windows update, a Node.js update, or a new package version changes what is needed.
fenbs does not manage your Windows processes or config files. It holds the setup notes and lessons that help your team avoid the same problems twice.