---
title: "config MCP ของ Cursor: path ไฟล์, key และตัวอย่าง · DotsAgent"
description: "เพิ่มเซิร์ฟเวอร์ MCP ของ Anysphere ใน Cursor: ตำแหน่งไฟล์ config, key และรูปแบบระดับบนสุด, การรองรับ OAuth สำหรับเซิร์ฟเวอร์ remote และตัวอย่าง config"
url: https://dotsagent.io/th/mcp/clients/cursor
---

Anysphere

# เพิ่มเซิร์ฟเวอร์ MCP ใน Cursor

Cursor อ่าน mcp.json จาก .cursor/ ในโปรเจกต์ หรือจาก ~/.cursor/ เพื่อใช้กับทุกโปรเจกต์

- **macOS**: `~/.cursor/mcp.json`
- **Windows**: `~/.cursor/mcp.json`
- **Linux**: `~/.cursor/mcp.json`
- **ไฟล์โปรเจกต์**: `.cursor/mcp.json`
- **Key ระดับบนสุด**: `mcpServers`
- **รูปแบบ**: json
- **OAuth สำหรับเซิร์ฟเวอร์ remote**: 

## ตัวอย่าง config

ตัวอย่างนี้เพิ่มเซิร์ฟเวอร์ที่ GitHub โฮสต์ไว้และ Playwright เป็นเซิร์ฟเวอร์ local โดยใช้รูปแบบที่ไคลเอนต์นี้รองรับ

`.cursor/mcp.json`

```
{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/"
    },
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}
```

## หมายเหตุและข้อควรระวัง

- ค่าใช้ ${env:NAME}, ${userHome} และ ${workspaceFolder} ได้
- รายการเซิร์ฟเวอร์ระยะไกลใช้ url, headers ที่ไม่บังคับ และบล็อก auth ที่มี CLIENT_ID, CLIENT_SECRET และ scopes สำหรับแอป OAuth ที่ลงทะเบียนไว้ล่วงหน้า
- หากผู้ให้บริการกำหนดให้ใช้ URL เปลี่ยนเส้นทางแบบตายตัว ให้ลงทะเบียน https://www.cursor.com/agents/mcp/oauth/callback และ http://localhost:8787/callback
- ไม่มีเอกสารคำสั่งเพิ่มเซิร์ฟเวอร์ผ่าน command line

[สร้าง config สำหรับ Cursor →](https://dotsagent.io/th/mcp/config#client=cursor)

## ไคลเอนต์อื่น

[Claude Desktop](https://dotsagent.io/th/mcp/clients/claude-desktop)

[Claude Code](https://dotsagent.io/th/mcp/clients/claude-code)

[VS Code (GitHub Copilot)](https://dotsagent.io/th/mcp/clients/vscode-copilot)

[Windsurf / Devin Desktop](https://dotsagent.io/th/mcp/clients/windsurf)

[Zed](https://dotsagent.io/th/mcp/clients/zed)

[OpenAI Codex CLI](https://dotsagent.io/th/mcp/clients/codex-cli)

[Gemini CLI](https://dotsagent.io/th/mcp/clients/gemini-cli)

[ChatGPT](https://dotsagent.io/th/mcp/clients/chatgpt)

[OpenClaw](https://dotsagent.io/th/mcp/clients/openclaw)

[Cline](https://dotsagent.io/th/mcp/clients/cline)

[Continue](https://dotsagent.io/th/mcp/clients/continue)

[JetBrains AI Assistant](https://dotsagent.io/th/mcp/clients/jetbrains-ai)

## แหล่งที่มา

1. [cursor.com](https://cursor.com/docs/context/mcp)/docs/context/mcp

แหล่งอ้างอิงอิสระสำหรับผู้สร้าง AI agent ไม่มีส่วนเกี่ยวข้องกับผู้ให้บริการที่กล่าวถึง

© 2026 DotsAgent · ตรวจสอบข้อมูลเมื่อ 1 ตุลาคม 2569
