/ 目錄 / 演練場 / JetBrains IDEs
● 官方 JetBrains ⚡ 即開即用

JetBrains IDEs

作者 JetBrains · JetBrains/mcp-jetbrains

Give your agent the same code intelligence your IntelliJ has — refactoring, find-usages, inspections, run configs.

Official JetBrains MCP proxy. Pairs with the MCP Server plugin installed in your IDE (IntelliJ, PyCharm, WebStorm, Rider, etc.). The agent sees project structure through the IDE's indexed model — not just filesystem — so refactors, find-usages, and inspections all work.

為什麼要用

核心特性

即時演示

實際使用效果

jetbrains.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "jetbrains": {
      "command": "npx",
      "args": [
        "-y",
        "@jetbrains/mcp-proxy"
      ]
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "jetbrains": {
      "command": "npx",
      "args": [
        "-y",
        "@jetbrains/mcp-proxy"
      ]
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "jetbrains": {
      "command": "npx",
      "args": [
        "-y",
        "@jetbrains/mcp-proxy"
      ]
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "jetbrains": {
      "command": "npx",
      "args": [
        "-y",
        "@jetbrains/mcp-proxy"
      ]
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "jetbrains",
      "command": "npx",
      "args": [
        "-y",
        "@jetbrains/mcp-proxy"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "jetbrains": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@jetbrains/mcp-proxy"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add jetbrains -- npx -y @jetbrains/mcp-proxy

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: JetBrains IDEs

Rename a symbol safely across the whole project

👤 Java / Kotlin / Python / C# engineers ⏱ ~10 min intermediate

何時使用: You want to rename a symbol but grep-and-replace would miss string references or dynamic calls.

前置條件
  • MCP Server plugin installed in the IDE — plugins.jetbrains.com/plugin/26071-mcp-server — or built-in if on 2025.2+
  • Project opened and indexed in the IDE — Open the project; wait for indexing to complete (status bar)
步驟
  1. Find the symbol
    Find the definition and all usages of getCurrentUser in the project. Include test files.✓ 已複製
    → IDE-accurate usage list with file:line
  2. Dry-run the rename
    Show me what renaming to getAuthenticatedUser would change. Flag any string literals or reflection-based calls I'll need to fix manually.✓ 已複製
    → Preview diff + manual-fix list
  3. Apply the refactor
    Apply the rename. Then run the affected tests.✓ 已複製
    → Refactor done, tests green

結果: A safe rename with IDE-level accuracy, covered by the IDE's existing refactoring engine.

注意事項
  • Reflection-based or string-built references aren't caught — After refactor, grep for the old name as a string — the IDE warns but doesn't auto-fix these
  • IDE not fully indexed, results are partial — Wait for the progress bar to clear before running; ask the IDE for index status first
搭配使用: git

Run a specific test and iterate on failures

👤 Any engineer using JetBrains IDEs ⏱ ~15 min intermediate

何時使用: You want the agent to write code, run the matching test, fix failures, iterate — without leaving the chat.

前置條件
  • Run configuration for the test exists in the IDE — Right-click test file → Run — IDE saves the config
步驟
  1. Run the specific test
    Run the CartCalculatorTest class. Return pass/fail per method with failure messages.✓ 已複製
    → Structured test result
  2. Fix failures
    For each failing test, read the source, identify the bug, propose a minimal fix.✓ 已複製
    → File:line + proposed change
  3. Loop
    Apply the fix and re-run until green. Don't modify tests, only production code.✓ 已複製
    → All tests passing

結果: TDD-at-agent-speed with the IDE's compile + run infrastructure.

注意事項
  • Agent modifies tests to make them pass — Explicit prompt: 'do not touch test files'; review the diff before committing

Onboard to an unfamiliar codebase via IDE navigation

👤 New hires, code reviewers ⏱ ~30 min beginner

何時使用: You need to understand how X is used without bouncing around 20 files manually.

步驟
  1. Start at an entrypoint
    Find the HTTP handler for POST /checkout. Show me the call hierarchy — what it calls, depth 3.✓ 已複製
    → Call tree with file:line nodes
  2. Find tests
    Find all tests that exercise the checkout flow. Open each and summarize what they cover.✓ 已複製
    → Test coverage map
  3. Explain the flow
    Write a 1-page explainer: endpoint → validation → payment → persistence → response. Reference files with line numbers.✓ 已複製
    → Onboarding-quality explainer

結果: A concrete mental model of a subsystem in 30 minutes instead of a day.

注意事項
  • Agent invents class/method names that don't exist — Every claim must link to file:line — if it can't, it's hallucinated; call it out and re-query
搭配使用: git

組合

與其他 MCP 搭配,撬動十倍槓桿

jetbrains + git

IDE-level refactor + verify commit is clean

Rename fetchUser to loadUser project-wide. Then show me the git diff — confirm tests still pass and commit.✓ 已複製
jetbrains + github

Reviewing a PR with IDE navigation instead of GitHub's web UI

Check out PR #234's branch. Walk through the diff using find_usages to understand what each changed method is called from.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
get_project_structure Overview when starting in a new project free
find_usages symbol Impact analysis before changes free
search_in_files text, scope? Full-text search across project free
get_symbol_info symbol or file:line Resolve what something is free
run_configuration config_name Execute a saved run config (test, app, script) free (local)
apply_refactoring refactor type + params Rename, extract method, inline, move free
get_diagnostics file_path? Catch issues the IDE already knows about free

成本與限制

運行它的成本

API 配額
None — local IDE
每次呼叫 Token 數
Call hierarchies can be large; limit depth explicitly
費用
Free — MCP is free; you need a JetBrains license anyway
提示
Rely on IDE operations (find_usages, refactor) over raw filesystem reads — cheaper tokens and more accurate

安全

權限、密鑰、影響範圍

憑證儲存: None — local IDE
資料出站: None to JetBrains; MCP is localhost-only between IDE and client

故障排查

常見錯誤與修復

Connection refused / MCP can't reach IDE

The IDE must be open with the plugin enabled. Check Settings → Tools → MCP Server; port is usually 63342 or auto-assigned.

驗證: curl http://localhost:63342/api/mcp
Tools return 'Project not found'

No project open in the IDE, or multiple projects open and agent is asking about the wrong one. Focus the correct window.

Refactor reports files changed but they look the same

IDE buffers aren't saved to disk yet. Call a 'save all' tool or Cmd+S in the IDE.

find_usages misses references

Indexing hasn't completed. Wait for the IDE status bar to show 'Indexing complete'.

替代方案

JetBrains IDEs 對比其他方案

替代方案何時用它替代權衡
VSCode MCP (various community)You're on VSCode instead of JetBrainsDifferent IDE, different ecosystem — not a direct swap
language-server MCPsYou want IDE-agnostic code intelligence via LSPLSP gives basic symbol info but not refactoring or run configs

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills