MCP 安装教程

Cursor MCP JSON 配置示例

复制可用的 Cursor mcp.json 示例,并了解如何把安装命令转换成 MCP 配置。

适合谁?

适合已经有 MCP 安装命令,但不知道 Cursor JSON 怎么写的用户。

配置路径和示例

~/.cursor/mcp.json

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

安装步骤

1

Start with mcpServers

Cursor expects MCP servers under a top-level mcpServers object.

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

Split command and args

The first token becomes command. Everything after it becomes args.

3

Keep server names readable

Use stable names like filesystem, github, postgres, or browser.

4

Validate JSON

A missing comma or quote can prevent Cursor from loading the server.

常见问题

Putting the full command in command

Do not set command to the entire string. Use command: npx and args: [...] instead.

Wrong path

Make sure you are editing the Cursor config file used by your current profile.

FAQ

What should command contain?

Only the executable, such as npx, uvx, docker, node, or python.

What should args contain?

All remaining command tokens, for example -y and the package name.