Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
5.42.0
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:
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:
where node
npm root -g
Use these absolute paths in your config files.
4. Example MCP Server Configuration (with cmd and /c)
"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
: Tellscmd.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
ornpx
directly, butcmd
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):
Install and configure:
npm install -g @simonb97/server-win-cli
Config example:
"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
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.