使用 MCP 將外部工具與資料來源連接到 Cursor
stdout
或提供 HTTP 端點的語言撰寫 MCP 伺服器——Python、JavaScript、Go 等等。
Transport | Execution environment | Deployment | Users | Input | Auth |
---|---|---|---|---|---|
stdio | Local | Cursor manages | Single user | Shell command | Manual |
SSE | Local/Remote | Deploy as server | Multiple users | URL to an SSE endpoint | OAuth |
Streamable HTTP | Local/Remote | Deploy as server | Multiple users | URL to an HTTP endpoint | OAuth |
Feature | Support | Description |
---|---|---|
Tools | Supported | Functions for the AI model to execute |
Prompts | Supported | Templated messages and workflows for users |
Roots | Supported | Server-initiated inquiries into uri or filesystem boundaries to operate in |
Elicitation | Supported | Server-initiated requests for additional information from users |
mcp.json
mcp.json
的情況下動態設定。這對企業環境與自動化建置流程特別實用。
vscode.cursor.mcp.registerServer()
以程式方式註冊 MCP 伺服器.cursor/mcp.json
,提供專案專屬工具。~/.cursor/mcp.json
,讓工具在各處可用。Available Tools
下的 MCP 工具。可以直接用名稱指定工具,或描述你要做的事。也可以在設定中啟用或停用工具。
MCP 伺服器有什麼用?
要怎麼除錯 MCP 伺服器問題?
可以暫時停用 MCP 伺服器嗎?
如果 MCP 伺服器當機或逾時會怎樣?
要怎麼更新 MCP 伺服器?
npm cache clean --force
3. 重新加入該伺服器以取得最新版本 針對自訂伺服器,更新本機檔案並重新啟動 Cursor。能用 MCP 伺服器處理敏感資料嗎?
stdio
傳輸在本機執行處理敏感資料的伺服器 - 將 API 金鑰權限限制在最低必要範圍 - 在連接敏感系統前先審查伺服器程式碼 - 考慮在隔離環境中執行伺服器