MCP 安装教程

如何在 Cursor 中安装 MCP

Cursor MCP 安装教程:配置路径、JSON 示例、常见错误和可信入门工具栈。

适合谁?

适合想把 Cursor 连接到文件、GitHub、数据库、浏览器工具或文档的用户。

配置路径和示例

~/.cursor/mcp.json

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

安装步骤

1

Find a trusted MCP server

Start from a trusted listing or a starter stack. Review Trust Score, Risk Level, and install command before copying anything.

2

Open Cursor MCP settings

Open Cursor settings and find the MCP section, or edit the MCP config file directly.

~/.cursor/mcp.json
3

Paste the JSON config

Add your server under the mcpServers object. Multiple servers can live in the same JSON file.

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

Restart Cursor

Restart Cursor or reload MCP servers so the new tool list is detected.

5

Verify it worked

Open Cursor chat and check whether the MCP tools appear. If not, review command path and config JSON syntax.

常见问题

Command not found

Install Node.js or the runtime required by the MCP command, then retry from a normal terminal.

Invalid JSON

Check commas and quotes. Use the config generator if you are unsure.

Server not showing

Restart Cursor after saving the config and confirm the config file path is correct.

FAQ

Where is Cursor MCP config stored?

Most setups use ~/.cursor/mcp.json, but Cursor settings can also open the config directly.

Can Cursor use multiple MCP servers?

Yes. Add multiple entries under the same mcpServers object.