AI助手扩展协议

Model Context Protocol (MCP) 是一个开放的协议,用于扩展Claude Desktop AI助手的功能,使其能够连接外部工具和服务。

  • by ChatGPT3a01
  • HTML
  • 本地部署
  • 4 星标
  • 更新于
在 GitHub 查看 ChatGPT3a01/Claude-MCP-Guide

使用说明

Claude MCP 完整教學指南

Model Context Protocol (MCP) 讓 Claude Desktop 擁有超強擴充能力!

什麼是 MCP?

Model Context Protocol (MCP) 是 Anthropic 推出的開放協議,讓 Claude Desktop 能夠連接外部工具和服務,大幅擴展 AI 助手的能力。

┌─────────────────┐     MCP Protocol     ┌─────────────────┐
│  Claude Desktop │ ◄─────────────────► │   MCP Servers   │
└─────────────────┘                      └─────────────────┘
                                                  │
                    ┌─────────────────────────────┼─────────────────────────────┐
                    │              │              │              │              │
               ┌────▼────┐   ┌────▼────┐   ┌────▼────┐   ┌────▼────┐   ┌────▼────┐
               │ 檔案系統 │   │  GitHub │   │  Brave  │   │ Blender │   │  Figma  │
               │   存取   │   │   整合  │   │  搜尋   │   │  3D建模 │   │  設計   │
               └─────────┘   └─────────┘   └─────────┘   └─────────┘   └─────────┘

快速開始

前置需求

設定檔位置

作業系統 設定檔路徑
Windows %APPDATA%\Claude\claude_desktop_config.json
macOS ~/Library/Application Support/Claude/claude_desktop_config.json

提示:Windows 用戶可按 Win + R,輸入 %APPDATA%\Claude 快速開啟資料夾

課程目錄

單元 主題 說明
Part 01 MCP 基礎入門 了解 MCP 架構與核心概念
Part 02 檔案系統整合 讓 Claude 讀寫本機檔案
Part 03 SQLite 資料庫 連接本地資料庫進行查詢
Part 04 GitHub 整合 管理倉庫、PR、Issues
Part 05 網頁內容抓取 從網站獲取即時資訊
Part 06 記憶系統 實現對話記憶功能
Part 07 Python MCP 伺服器 自訂 Python MCP 服務
Part 08 Node.js MCP 伺服器 自訂 Node.js MCP 服務
Part 09 多伺服器整合 同時運行多個 MCP
Part 10 實戰專案 綜合應用範例

熱門 MCP 伺服器一覽

MCP 伺服器 功能 需要設定 難度
filesystem 讀寫本機檔案 指定資料夾路徑 ⭐
sequential-thinking 強化深度思考 無需額外設定 ⭐
puppeteer 自動化瀏覽器 無需額外設定 ⭐
brave-search 隱私優先搜尋 Brave API Key ⭐⭐
github GitHub 專案管理 GitHub Token ⭐⭐
n8n-mcp 工作流程自動化 n8n API Key ⭐⭐
blender 3D 建模控制 安裝 uv + Addon ⭐⭐⭐
figma Figma 設計整合 Figma API Key ⭐⭐

完整設定檔範例

將以下內容儲存為 claude_desktop_config.json:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "C:/Users/你的使用者名稱/Desktop",
        "C:/Users/你的使用者名稱/Documents",
        "C:/Users/你的使用者名稱/Downloads"
      ]
    },
    "sequential-thinking": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
    },
    "puppeteer": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-puppeteer"]
    },
    "brave-search": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "貼上你的_Brave_API_Key"
      }
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "貼上你的_GitHub_Token"
      }
    },
    "n8n-mcp": {
      "command": "npx",
      "args": ["n8n-mcp"],
      "env": {
        "MCP_MODE": "stdio",
        "LOG_LEVEL": "error",
        "DISABLE_CONSOLE_OUTPUT": "true",
        "N8N_API_URL": "http://localhost:5678",
        "N8N_API_KEY": "貼上你的_n8n_API_Key"
      }
    },
    "blender": {
      "command": "cmd",
      "args": ["/c", "uvx", "blender-mcp"]
    },
    "figma": {
      "command": "npx",
      "args": ["-y", "figma-developer-mcp", "--figma-api-key=貼上你的_Figma_Token", "--stdio"]
    }
  }
}

注意:請將 你的使用者名稱 改為你的 Windows 使用者名稱

詳細設定指南

👉 查看完整 API Key 取得教學

包含以下 MCP 的逐步設定說明:

  • n8n API Key 取得與設定
  • Blender + uv 安裝設定
  • GitHub Personal Access Token 申請
  • Brave Search API Key 註冊
  • Figma API Key 產生

常見問題

Q: MCP 沒有出現 🔨 圖示?
  1. 確認 JSON 格式正確(使用 JSONLint 驗證)
  2. 完全關閉 Claude Desktop 再重新開啟
  3. 檢查設定檔路徑是否正確
Q: 出現「spawn npx ENOENT」錯誤?

Windows 用戶請確認:

  1. Node.js 已正確安裝
  2. 重新開啟終端機,輸入 npx --version 確認可執行
  3. 必要時重新啟動電腦
Q: 如何查看 MCP 錯誤日誌?
  • Windows: %UserProfile%\AppData\Roaming\Claude\Logs\
  • macOS: ~/Library/Application Support/Claude/Logs/

或在 Claude Desktop 中:Settings → Developer → Debug 日誌

相關資源

資源 連結
官方 MCP 文檔 modelcontextprotocol.io
官方 MCP Servers github.com/modelcontextprotocol/servers
Awesome MCP Servers github.com/punkpeye/awesome-mcp-servers
MCP 搜尋引擎 mcp.so
Claude Desktop 下載 claude.ai/download

授權

本專案採用 MIT License 授權。


如果這個指南對你有幫助,請給個 ⭐ Star!
有問題歡迎開 Issue 討論