MCP 安装教程

修复 MCP command not found 错误

排查 npx、uvx、docker、python 等运行时缺失导致的 MCP 安装错误。

适合谁?

适合已复制 MCP 配置,但客户端无法启动命令的用户。

配置路径和示例

Terminal PATH and MCP client config

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "./"]
    }
  }
}

安装步骤

1

Identify the runtime

Look at the first word of the command: npx, uvx, docker, python, node, or bunx.

2

Run the command in terminal

If it fails in terminal, install the missing runtime before editing MCP config.

npx -y @modelcontextprotocol/server-filesystem ./
3

Use an absolute path if needed

Some clients do not inherit your shell PATH. Use the full executable path when needed.

4

Restart the client

After fixing PATH or installing the runtime, fully restart Cursor, Claude, VS Code, or Codex.

常见问题

Node.js missing

Install Node.js LTS to use npx-based MCP servers.

Docker not running

Start Docker Desktop before using docker-based MCP servers.

FAQ

Why does it work in terminal but not in the app?

GUI apps may not inherit the same PATH as your terminal.

Should I use absolute paths?

Use absolute paths when the client cannot find the executable.