# IntelliJ 整合 GitHub Copilot agent 與 IntelliJ MCP Server ## 重要 我寫完這篇文章沒幾天,update 我的 intellij 和 github copilot plugin,就出現 agent 了... 所以這篇文章也過時啦 哈哈哈哈哈哈哈哈哈...... ![image](https://hackmd.io/_uploads/HkLQOsGmxg.png) -------- 我一直都習慣在 VSCode 使用 GitHub Copilot AI 作為主要助手,在 Intellij 中的 GitHub Copilot 功能還沒有 VScode 來的完善,目前仍然不支援 agent 模式,也無法自定義 MCP server 設定。就只有用他的 auto completion 而已。 但在開發的主要 IDE 又是 IntelliJ ,讓我覺得很浪費。 但我看別人都已經整合了 Claude Desktop、MCP 和 Intellij 了。 我也不想又多訂閱一個 Claude。 所以就來試試看能不能整合 IntelliJ、VScode、GitHub Copilot + MCP Server,實現跟 Claude Desktop 一樣的效果,而且無需另外訂閱 Claude! 前提是你已經擁有 GitHub Copilot 訂閱,並且已在 VSCode Insider 中成功安裝與設定 Copilot。 --- ## 步驟教學 ### Step 1:在 IntelliJ 中安裝 MCP Server Plugin 1. 開啟 IntelliJ,隨便打開一個專案。 2. 前往 IntelliJ 的 Plugins Marketplace,搜尋並安裝 `MCP Server` 插件。 ![image](https://hackmd.io/_uploads/ryP6BnLzxe.png) --- ### Step 2:複製 MCP Server 設定 1. 在 MCP Server 插件頁面的右側往下滑,點選 GitHub Repository。 2. 進入該 Plugin 的 GitHub 頁面後,找到並複製 MCP Server 的設定 JSON。 ![image](https://hackmd.io/_uploads/rJgxv2Uzxg.png) --- ### Step 3:設定 VSCode Insider 的 MCP Server 1. 開啟 VSCode Insider。 2. 點選右下角齒輪 → 設定(Settings)。 3. 搜尋 `MCP`,進入 `Features -> Chat` 頁面。 4. 點選右側的 `Edit in settings.json`。 5. 在 `mcp.servers` 區塊中,貼上剛剛複製的 MCP 設定內容。 ![image](https://hackmd.io/_uploads/HkB3P2UGll.png) --- ### Step 4:啟動 IntelliJ 上的 MCP Server 1. 回到 IntelliJ 上方工具列,應該會看到 `Start` 的按鈕,點選它。 2. 成功後會變成 `Running` 狀態,如同上方截圖所示。 --- ### Step 5:開啟 GitHub Copilot Chat 並切換 Agent 模式 1. 在 VSCode 中打開 GitHub Copilot 的聊天室。 2. 點選右上角的 `...`,選擇 `Open chat in new window`,讓視窗更好操作。 3. 在 chat 視窗左下角將 `Mode` 改為 `Agent`。 4. 接著輸入:`請證明你可以控制我的 IntelliJ`。 你會看到 agent 模式開始操控 IntelliJ,幫你打開視窗、執行指令等操作! --- ## 額外建議 你也可以考慮在 MCP Servers 設定中加入 `filesystem` 類型的 MCP server,這樣在操作本地檔案與 IntelliJ 配合上會更強大。 --- ###### Tags:`AI` `IntelliJ` `GitHub Copilot` `MCP Server`