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 27 September 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.
Almost every MCP config contains "command": "npx", "args": ["-y", "@some/package"]. This page explains what npx does there, why the package isn't installed first, and what the -y is for.
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.
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 @modelcontextprotocol/server-memory:
- Checks the local cache — is this package already downloaded?
- If not: fetches the latest version from npm
- Runs it immediately
- Caches it. Next time, npx checks npm for a newer version, then runs from the cache
That's it. No global install and no PATH changes.
Why -y? That One Flag Explained
Without -y, npx asks you to confirm before downloading a new package:
npx @modelcontextprotocol/server-memory
# Need to install the following packages:
# @modelcontextprotocol/server-memory
# Ok to proceed? (y)
You only see that prompt when you run npx in a terminal. When an app launches an MCP server there is no terminal, and current npm versions install without asking. Configs still include -y so the command never stops to ask, whoever runs it:
npx -y @modelcontextprotocol/server-memory
# Runs immediately. No questions asked.
A Real MCP Config, Dissected
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}
"command": "npx"— run npx"-y"— auto-confirm any install prompt"@modelcontextprotocol/server-memory"— the package to run
That's the whole thing. Three fields, one working MCP server.
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: use nvm or the installers on nodejs.org. Distribution packages can be too old: servers built on the official MCP SDK need Node.js 18 or later.
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 after the first download. For a package name without a version, npx checks npm on each launch and downloads a newer version if there is one. Pin a version with @version to stop that.
What does npx -y do in an MCP config?
The -y flag answers "yes" to npx's install prompt. npx only shows that prompt in a terminal, so apps that launch servers in the background work without it. Keeping -y makes the command behave the same everywhere.
Can I pin a specific version with npx?
Yes. Use the @version syntax: npx -y @modelcontextprotocol/[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 ships with npm, which comes with Node.js. On Windows, make sure you checked "Add to PATH" during installation.
TrustedSkills Team
The TrustedSkills team maintains the TrustedSkills index of AI agent skills. The index records where each skill comes from and how to install it. It does not review or audit skill code.