适合谁?
适合已经有 MCP 安装命令,但不知道 Cursor JSON 怎么写的用户。
配置路径和示例
~/.cursor/mcp.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "./"]
}
}
}安装步骤
Start with mcpServers
Cursor expects MCP servers under a top-level mcpServers object.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "./"]
}
}
}Split command and args
The first token becomes command. Everything after it becomes args.
Keep server names readable
Use stable names like filesystem, github, postgres, or browser.
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.