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

  1. 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.
  2. Find the full path to the executable. Run where npx (for npm) or where node in Command Prompt to get the exact path. This path goes in the command field of the config.
  3. 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.
  4. Add the server entry. Use cmd or powershell as the command if the server needs a shell to resolve environment variables, with /c or -Command as the first argument.
  5. Save the config and restart the AI client. If the server does not appear, check the AI client's logs for the error message.
Windows stdio server config example
{
  "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.

How fenbs helps

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 account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

How to do this with fenbs

  1. Create a free account and add a project for your Windows MCP setup.
  2. After a successful setup, record the working command, args pattern, and any path quirks as a context note or lesson.
  3. 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.
  4. 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.
  5. 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.

Questions people ask.

Why does my MCP server start in the terminal but not in the AI client?

The AI client launches the subprocess with a different environment than your terminal. Common causes: the executable is not on the PATH the client sees, a required environment variable is not in the config env object, or the path format is wrong in the JSON. Add cmd /c as the command to use the Windows command processor for resolution, and check the client logs for the exact error.

How do I write Windows paths in the MCP config JSON?

Each backslash in a Windows path must be doubled in JSON because backslash is the escape character. C:\Users\Alice becomes "C:\\Users\\Alice" in the JSON value. Alternatively, use forward slashes, which Windows accepts in most path contexts.

Where are Claude Desktop's MCP logs on Windows?

Claude Desktop writes MCP server logs to %APPDATA%\Claude\logs. Open that folder in File Explorer or type the path in the Run dialog. The log files show the exact error message when a server fails to start.

Do I need administrator rights to run an MCP server on Windows?

Not usually. A local stdio server runs under your user account and does not need administrator rights. A global npm install does require administrator rights or you must use a user-level install path. Use npx for one-off runs to avoid the global install entirely.

How do I share a working Windows MCP setup with my team?

Document the working config pattern — command, args format, env variable names — in a shared project record such as fenbs, without including the actual credentials. Each team member supplies their own credentials in their own config file.

More in Connect your AI tools

All Connect your AI tools articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.