Token导航 LogoToken导航TokenDH.com
Intellij MCP logo
开发工具未说明官方级别未说明来源级核验

Intellij MCP

MCP Server

通过MCP协议暴露JetBrains IDE的代码分析能力,支持多种编程语言的符号查找、引用分析、类型层次结构获取等功能,适用于AI编程助手集成。

工具数

10

提示词数

0

GitHub Stars

7

资源数

0
Kotlin编程辅助代码分析ClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

jiayun

提供方

jiayun

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

代码智能MCP

通过以下方式展示JetBrains IDE代码分析功能 MCP(模型上下文协议) 用于与Claude Code等AI编码助手集成。

特性

  • 查找符号 -按名称搜索类、函数或变量定义
  • 查找引用 -查找项目中符号的所有用法
  • 获取符号信息 -获取详细信息(类型、文件、签名)
  • 列出文件符号 -列出具有层次结构的文件中的所有符号
  • 获取类型层次结构 -获取类的继承层次结构
  • 运行配置 -列出并执行IDE运行配置(测试、应用程序等)
  • 测试结果 -获取结构化测试结果,包括通过/失败状态、持续时间、失败消息和堆栈跟踪\*

\*结构化测试结果需要SM测试运行器支持。骑士的。NET测试运行器使用ReSharper后端,该后端不向平台API公开结构化结果。看 已知限制.

支持的语言

语言状态文件扩展名
JavaScript/TypeScript✅ 支持.js, .mjs, .cjs, .ts, .mts, .cts, .jsx, .tsx
Vue.js✅ 支持.vue
python✅ 支持.py, .pyi
PHP✅ 支持.php, .phtml
Java✅ 支持.java
科特林✅ 支持.kt, .kts
锈蚀✅ 支持.rs
去吧✅ 支持.go
Swift✅ 支持.swift
C✅ 支持.cs
飞镖✅ 支持.dart

需求

  • JetBrains IDE(IntelliJ IDEA、PyCharm、WebStorm、GoLand、Rider等)版本2025.1+
  • 对于JavaScript/TypeScript支持:JavaScript插件(捆绑在WebStorm、IntelliJ IDEA Ultimate中)
  • 对于Vue.js支持:Vue.js插件(捆绑在WebStorm中,可在IntelliJ IDEA Ultimate中获得)
  • 对于Python支持:已安装Python插件
  • 对于PHP支持:已安装PHP插件(捆绑在PhpStorm中,可在IntelliJ IDEA Ultimate中获得)
  • 对于Java支持:已安装Java插件(捆绑在IntelliJ IDEA中)
  • 对于Kotlin支持:已安装Kotlin插件(捆绑在IntelliJ IDEA中)
  • 对于Rust支持:已安装Rust插件(捆绑在RustRover中,可在IntelliJ IDEA Ultimate/CLion中获得)
  • Go支持:安装Go插件(捆绑在GoLand中,可在IntelliJ IDEA Ultimate中获得)
  • Swift支持: 仅限macOS -需要Xcode或Swift工具链和SourceKit LSP
  • 对于Dart支持:已安装Dart插件(捆绑在Android Studio中,可在IntelliJ IDEA中获得)

安装

来自JetBrains市场

![JetBrains Plugin](https://plugins.jetbrains.com/plugin/29509-code-intelligence-mcp)

  1. 打开 设置插件市场
  2. 搜索“代码智能MCP"
  3. 点击 安装重新启动IDE

从磁盘

  1. 下载 intellij-mcp-x.x.x.zip发布
  2. 打开 设置插件 → ⚙️ → 从磁盘安装插件。..
  3. 选择zip文件→ 重新启动IDE

用法

1.启动MCP服务器

IDE启动时,服务器会自动启动。您也可以手动控制它:

  • 工具代码智能MCP启动MCP服务器
  • 工具代码智能MCP停止MCP服务器

服务器运行在 http://localhost:9876 默认情况下。

2.验证服务器

# Health check
curl http://localhost:9876/health
# Returns: OK

# Server info
curl http://localhost:9876/info
# Returns: {"name":"intellij-mcp","version":"1.0.0","languages":["python"]}

3.连接克劳德代码

claude mcp add intellij-mcp --transport http http://localhost:9876/mcp

或者从以下位置复制配置: 工具代码智能MCP复制Claude代码配置

4.配置CLAUDE.md(推荐)

将以下内容添加到您的项目中 CLAUDE.md~/.claude/CLAUDE.md 帮助Claude Code利用IDE的代码分析:

## Code Intelligence MCP Integration

When working with this Python codebase, prefer using intellij-mcp tools for:

- **Finding symbol definitions** - Use `find_symbol` instead of grep/ripgrep when looking for class, function, or variable definitions. The IDE understands the language structure and provides accurate results.

- **Finding references** - Use `find_references` to find all usages of a symbol. This is more accurate than text search as it understands scope and imports.

- **Getting symbol details** - Use `get_symbol_info` to get type information, documentation, and function signatures for a symbol at a specific location.

- **Understanding code structure** - Use `get_file_symbols` to get an overview of a file's classes, methods, and functions with their signatures.

- **Exploring inheritance** - Use `get_type_hierarchy` to understand class inheritance relationships.

**Note:** Line and column numbers are **1-based**, matching editor display. Line 16 in editor = `line=16` in API.

Note: intellij-mcp requires the JetBrains IDE to be running with the project open.

MCP工具

工具说明
list_projects列出IDE中所有打开的项目
get_supported_languages获取支持的语言列表
find_symbol按名称查找符号定义
find_references查找对某个符号的所有引用
get_symbol_info获取详细的符号信息
get_file_symbols列出文件中的所有符号
get_type_hierarchy获取类继承层次结构
list_run_configurations列出IDE项目中的所有运行配置
run_configuration按名称执行运行配置
get_test_results从测试执行中获取结构化测试结果

includeLibraries 参数

find_symbol, find_references,以及 get_type_hierarchy 工具支持可选 includeLibraries 参数(默认值: false).当设置为 true,搜索范围扩展到包括项目依赖关系和库(例如JDK类、Python stdlib、Dart SDK、Cargo crates)。

支持:Java、Kotlin、Python、PHP、Rust、Go、Dart。不适用于JavaScript/Types/Vue.js(基于FilenameIndex)或Swift/C#(基于LSP,范围由语言服务器控制)。

示例

# Find a symbol
curl -X POST http://localhost:9876/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"find_symbol","arguments":{"name":"MyClass"}}}'

Swift支持(仅限macOS)

Swift支持使用 SourceKit LSP 用于代码分析。

先决条件

  1. macOS -Swift支持仅在macOS上可用
  2. Xcode或Swift工具链 -以下之一:

- 安装Xcode(推荐,包括SourceKit LSP) - 安装Xcode命令行工具: xcode-select --install - 从以下位置安装独立的Swift工具链 swift.org

支持的项目类型

  • SwiftPM项目 (与 Package.swift)-最佳支持
  • Xcode项目 (.xcodeproj)-需要先构建项目

重要说明

  • 首次索引:首次打开Swift项目时,SourceKit LSP需要对项目进行索引。这可能需要10-30秒,具体取决于项目规模。在此期间,您将在IDE日志中看到“正在等待SourceKit LSP索引…”。
  • 先构建你的项目:运行 swift build 在使用代码分析以获得最佳结果之前。

局限性

  • get_type_hierarchy 不支持(SourceKit LSP限制)
  • 项目必须做到最好 find_references 结果
  • find_symbol 需要非空搜索查询

C#支持

先决条件

安装csharp ls(推荐):

dotnet tool install --global csharp-ls

支持的项目类型

  • 仅限SDK风格的项目 (.NET核心/.NET 5+)
  • 解决方案文件 (.sln)-最佳支持
  • 项目文件 (.csproj)-单一项目支持
  • 遗产。NET框架项目(旧式 .csprojToolsVersion)都是 不支持

重要说明

  • 首次索引:首次打开C#项目时,LSP服务器需要对项目进行索引。这可能需要10-30秒,具体取决于项目规模。
  • 先构建你的项目:运行 dotnet build 在使用代码分析以获得最佳结果之前。

与Swift支持相比

  • get_type_hierarchy 被支持 C#(与Swift不同)
  • 跨平台支持(Windows、macOS、Linux)

测试执行限制

run_configurationget_test_results 这些工具最适合使用标准SM Test Runner框架的IDE:

IDE运行测试结构化结果
IntelliJ IDEA(JUnit、TestNG)
PyCharm(pytest、unittest)
WebStorm(有,有,有速度)✅
GoLand(去测试)
附加程序(.NET xUnit、NUnit、TUnit)✅ 触发执行❌ ReSharper后端

骑手限制:骑士。NET测试运行器通过RD协议通过ReSharper后端进行通信,该协议不向IntelliJ平台API公开结构化测试结果。测试将在IDE中成功执行,但是 get_test_results 返回降级响应,没有单独的测试细节。作为解决方法,代理可以运行 dotnet test 直接用于结构化输出。

发展

# Build
./gradlew :core:buildPlugin

# Output: core/build/distributions/intellij-mcp-x.x.x.zip

使用插件运行IDE

# IntelliJ IDEA Ultimate (default)
./gradlew :core:runIde

# PyCharm Professional (for Python testing)
./gradlew :core:runPyCharm

# PhpStorm (for PHP testing)
./gradlew :core:runPhpStorm

# WebStorm (for JavaScript/TypeScript/Vue.js testing)
./gradlew :core:runWebStorm

# RustRover (for Rust testing)
./gradlew :core:runRustRover

# GoLand (for Go testing)
./gradlew :core:runGoLand

# Rider (for C# testing)
./gradlew :core:runRider

许可证

麻省理工学院

目录标签

目录标签

Kotlin编程辅助代码分析Claude本地部署IDE插件多语言支持AI集成

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

10

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP