What is npx MCP Server? Why Every MCP Config Uses It
What is npx MCP server โ explained simply. Learn why every MCP config uses npx -y, what the flag does, and when to use npx vs a global npm install for your AI skills.
๐Last updated 4 March 2026
npx runs an npm package without a permanent global install. Every MCP config uses npx -y because it lets your AI client launch skills automatically โ no manual setup, always fresh, works on any machine with Node.js. The -y flag just skips the "are you sure?" prompt.
When I first saw "command": "npx", "args": ["-y", "@some/package"] in an MCP config, I had no idea what npx was doing. Why not just install the package? Why the -y? Here's the full story โ shorter than you'd think.
The Problem npx Solves for MCP Servers
Old way: install globally, then run. npm install -g weather-server, then weather-server. Works fine โ but it means every machine needs that pre-install step, version conflicts become a nightmare, and things quietly go stale.
npx skips all of that. It downloads the package, runs it, caches it locally. No global install. No cleanup. No version drift.
We onboarded a team of 8 developers onto a shared MCP setup. Without npx, everyone would've needed to manually run npm install -g for each skill before Claude Code would work. With npx in the config, they cloned the repo, opened the project, and their AI tools just worked. Zero extra setup steps.
The Vending Machine Analogy
Global install = buying a snack and storing it in your pantry. Always available, but takes up permanent space and eventually goes stale.
npx = vending machine. You get exactly what you need, right now, fresh. Nothing left behind.
What npx Actually Does (Step by Step)
When Claude Desktop runs npx @trustedskills/weather-mcp:
- Checks the local cache โ is this package already downloaded?
- If not: fetches the latest version from npm
- Runs it immediately
- Caches it โ so next time it's instant
That's it. No installation prompt, no PATH changes, nothing permanent.
Why -y? That One Flag Explained
Without -y, npx asks you to confirm before downloading a new package:
npx @trustedskills/weather-mcp
# Need to install the following packages:
# @trustedskills/weather-mcp
# Ok to proceed? (y)
That's fine when you're sitting at a terminal. But MCP servers launch automatically in the background โ there's no human there to type "y". So you add -y and it skips the prompt entirely:
npx -y @trustedskills/weather-mcp
# Runs immediately. No questions asked.
A common support question we see: "My skill isn't starting up." Nine times out of ten, the -y flag is missing. Claude Desktop launches the server, npx waits for a "y" that never comes, and the server quietly times out. Add the -y and it works first time.
A Real MCP Config, Dissected
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "@trustedskills/weather-mcp"]
}
}
}
"command": "npx"โ run npx"-y"โ auto-confirm any install prompt"@trustedskills/weather-mcp"โ the package to run
That's the whole thing. Three fields, one working MCP skill.
npx vs Global Install: When to Use Which
| Situation | Use | Why |
|---|---|---|
| MCP server in a config file | npx -y |
Works without manual install on any machine |
| CLI tools you run daily | Global install | Faster startup, always in PATH |
| One-off script | npx |
No clutter, no cleanup |
| Team project dependency | Local install in package.json | Version-locked, reproducible builds |
Do I Need Node.js?
Yes โ npx is bundled with Node.js. If you don't have it:
- Mac:
brew install nodeor download from nodejs.org - Windows: Download the installer from nodejs.org โ check "Add to PATH" during install
- Linux:
sudo apt install nodejs npmor use nvm
Verify it worked:
npx --version
# 10.5.0 โ something like this means you're good
Frequently Asked Questions
Does npx download the package every single time?
No โ it caches packages locally after the first download. Subsequent runs are fast. The cache expires periodically, which is actually useful: you automatically get updates when the skill author publishes a new version.
What does npx -y do in an MCP config?
The -y flag auto-answers "yes" to any install confirmation prompts. Without it, npx waits for user input before downloading a new package โ which breaks automated launches from Claude Desktop or Claude Code.
Can I pin a specific version with npx?
Yes. Use the @version syntax: npx -y @trustedskills/[email protected]. Good for production setups where you want reproducible behaviour and don't want surprise updates.
What if npx isn't found on my system?
Install or reinstall Node.js from nodejs.org. npx has been bundled with Node since v5.2.0. On Windows, make sure you checked "Add to PATH" during installation.
TrustedSkills Team
The TrustedSkills team builds and tests AI agent integrations across Claude, OpenClaw, Cursor, and VS Code. We verify every skill in our registry and have set up hundreds of MCP configs across every major platform.