Spaces:
Runtime error
Runtime error
# MCP Server Setup on Windows: Reference Guide | |
## Overview | |
This document summarizes key points and step-by-step instructions for setting up MCP servers on Windows, with a focus on the use of `cmd` and `/c` wrappers in configuration files. It is based on a real troubleshooting and research session. | |
--- | |
## 1. Installing Prerequisites | |
- **Node.js**: Download and install from https://nodejs.org/ | |
- **Python 3.10+** (if using Python-based servers): https://www.python.org/downloads/ | |
- Add both to your PATH during installation. | |
--- | |
## 2. Installing MCP Servers Globally | |
Open **Command Prompt (CMD) as Administrator** and run: | |
```sh | |
npm install -g @modelcontextprotocol/server-filesystem | |
npm install -g @modelcontextprotocol/server-memory | |
npm install -g @modelcontextprotocol/server-brave-search | |
``` | |
(Install any other MCP servers you need.) | |
--- | |
## 3. Using Absolute Paths in Configuration | |
Find your global npm modules path: | |
```sh | |
where node | |
npm root -g | |
``` | |
Use these absolute paths in your config files. | |
--- | |
## 4. Example MCP Server Configuration (with cmd and /c) | |
```json | |
"sentiment-analysis": { | |
"command": "cmd", | |
"args": [ | |
"/c", | |
"npx", | |
"-y", | |
"mcp-remote", | |
"https://freemansel-mcp-sentiment.hf.space/gradio_api/mcp/sse", | |
"--transport", | |
"sse-only" | |
] | |
} | |
``` | |
### What does `cmd` and `/c` do? | |
- **`cmd`**: Launches the Windows Command Prompt. | |
- **`/c`**: Tells `cmd.exe` to execute the following command and then terminate. | |
- This ensures the command runs in a Windows shell, which is important for compatibility and environment handling. | |
--- | |
## 5. When to Use This Pattern | |
- Use `cmd` and `/c` when you want to ensure a command runs in the Windows Command Prompt, especially for shell-specific syntax or command chaining. | |
- For simple scripts, you can sometimes use `node` or `npx` directly, but `cmd` is the most compatible for complex or chained commands. | |
--- | |
## 6. Windows CLI Wrapper Example | |
For a Windows-specific CLI wrapper (to expose PowerShell, CMD, or Git Bash as MCP tools): | |
- [win-cli-mcp-server](https://github.com/SimonB97/win-cli-mcp-server) | |
Install and configure: | |
```sh | |
npm install -g @simonb97/server-win-cli | |
``` | |
Config example: | |
```json | |
"windows-cli": { | |
"command": "npx", | |
"args": ["-y", "@simonb97/server-win-cli"] | |
} | |
``` | |
--- | |
## 7. Tips and Troubleshooting | |
- Always use **absolute paths** for both Node and server files. | |
- Run Cursor/Claude Desktop as **Administrator** for best compatibility. | |
- If you need environment variables, set them in the `env` section of your config. | |
- If you get errors, try running the server directly in CMD to check for issues. | |
--- | |
## 8. References | |
- [MCP-Windows Setup Guide (Gist)](https://gist.github.com/feveromo/7a340d7795fca1ccd535a5802b976e1f) | |
- [win-cli-mcp-server GitHub](https://github.com/SimonB97/win-cli-mcp-server) | |
--- | |
## Conversation Summary | |
- The use of `cmd` and `/c` is a Windows-specific wrapper to ensure commands run in a shell and terminate after execution. | |
- This pattern is common in MCP server configs for Windows to maximize compatibility. | |
- For more details or troubleshooting, see the references above or ask for help in the Cursor/Claude community forums. |