Skip to content

josedacosta/mcp-jetbrains-code-inspections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MCP JetBrains Code Inspections

πŸ” MCP JetBrains Code Inspections

License: OSL-3.0 Node.js TypeScript Documentation MCP SDK JetBrains PRs Welcome

Caution

⚠️ Deprecated Notice

Status: Deprecated

This project is deprecated but still functional. Starting from version 2025.2, JetBrains IDEs (WebStorm, IntelliJ IDEA, PyCharm, etc.) now include a built-in MCP server that provides native integration with external clients like Claude Desktop, Cursor, VS Code, and others.

πŸ”„ Migration Options

IDE Version Recommended Solution Link
2025.2+ Built-in MCP server Official Documentation
Earlier versions JetBrains MCP plugin Plugin Marketplace

βœ… Native Integration Benefits

  • Direct IDE control without external tools
  • 25+ tools comprehensive tool set
  • Better performance and reliability
  • Official support from JetBrains

[!IMPORTANT] The native get_file_problems tool requires setting errorsOnly: false for similar functionality to this project. The get_project_problems tool only returns critical errors.

πŸ“š View Migration Guide & Comparison β†’

A Model Context Protocol (MCP) server that provides JetBrains IDE code inspections with automatic IDE selection and a unified inspection profile that works across all file types.

Tip

πŸ“š Full Documentation Available: Visit our comprehensive docs at josedacosta.github.io/mcp-jetbrains-code-inspections

🎯 Quick Start

Note

Get started in under 2 minutes!

# Clone the repository
git clone https://github.com/josedacosta/mcp-jetbrains-code-inspections.git
cd mcp-jetbrains-code-inspections

# Install and build
yarn install && yarn build

# Test with MCP Inspector
yarn inspect

Then configure your MCP client (Claude Desktop, Cursor, etc.) with the configuration below.

✨ Features

πŸš€ Core Features

  • πŸ” Automatic IDE Detection
    Intelligently selects the best JetBrains IDE
  • ⚑ Configurable Timeout
    Default 120s, adjustable for large projects
  • πŸ”„ Cross-IDE Compatible
    Works with all JetBrains IDEs

πŸ”§ Advanced Capabilities

  • πŸ“Š Smart Output Formats
    Markdown for LLMs, JSON for tools
  • 🎯 Concurrent Execution
    Run even when IDE is open
  • 🌐 Universal Profiles
    One profile for all languages
  • πŸ’¬ Built-in Prompts
    Pre-configured prompts for common tasks
  • πŸ“š Server Resources
    Access profiles, config, and IDE info

πŸ“¦ Installation

Note

Prerequisites: Node.js β‰₯20 and a JetBrains IDE installed

Step-by-step Installation

  1. Install dependencies:

    yarn install
  2. Build the server:

    yarn build
  3. Configure MCP (see βš™οΈ Configuration section below)

Tip

Use yarn inspect after installation to test the server with the MCP Inspector

πŸš€ Usage

πŸ“š MCP Features

The server provides three types of MCP features:

πŸ”¨ Tools

  • get_jetbrains_code_inspections: Runs code inspections on specified files or directories

πŸ’¬ Prompts

  • analyze-project: Analyze a project for code quality issues
  • check-file: Check a specific file for issues
  • fix-issues: Get suggestions to fix detected issues

πŸ“š Resources

  • inspection://profiles: List of available inspection profiles
  • inspection://config: Current MCP server configuration
  • inspection://ides: List of detected JetBrains IDEs on the system

πŸƒ Running the Server

Tip

For development, use yarn dev which includes hot-reload for faster iteration.

# πŸ”„ Run in development mode (with hot-reload)
yarn dev

# πŸ“¦ Run the built server (production)
yarn start

# πŸ§ͺ Use MCP Inspector for interactive testing
yarn inspect

βš™οΈ Configuration

The code inspections server can be configured through environment variables in .mcp.json:

{
    "mcpServers": {
        "mcp-jetbrains-code-inspections": {
            "command": "node",
            "args": ["./dist/index.js"],
            "env": {
                "EXCLUDE_INSPECTIONS": "SpellCheckingInspection"
            }
        }
    }
}

πŸ“ Available Parameters

πŸ”§ Tool Parameter (Required)

Important

The tool accepts only one parameter from the LLM:

Parameter Type Description Required Example
path string File or directory path to inspect βœ… Yes "src/index.ts" or "./src"

🌍 Configuration via Environment Variables

Note

All configurations are managed through environment variables in .mcp.json. These settings control how the inspection server operates.

πŸ“‘ Available Environment Variables (click to expand)
Environment Variable Type Description Default
FORCE_INSPECT_PATH string Force specific IDE inspect tool (disables auto-detection) Auto-detected
FORCE_PROJECT_ROOT string Force project root directory (disables auto-detection) Auto-detected
FORCE_PROFILE_PATH string Force inspection profile path (disables defaults) Project defaults
INSPECTION_TIMEOUT number Maximum analysis time (ms) 120000
EXCLUDE_INSPECTIONS string Comma-separated inspection codes to exclude SpellCheckingInspection
ONLY_INSPECTIONS string Only include these inspection codes -
RESPONSE_FORMAT 'markdown'|'json' Output format for diagnostics 'markdown'
DEBUG boolean Enable debug logging false

Tip

πŸ“š For detailed configuration options, see Configuration Documentation.

πŸ§ͺ Testing

1️⃣ Interactive MCP Test

yarn test:mcp

This runs an interactive test that allows you to test the MCP server functionality directly.

2️⃣ Test with MCP Inspector (recommended)

# Launch the inspector (no installation needed)
yarn inspect

# Or for development mode with hot reload
yarn inspect:dev

The inspector opens a web interface where you can:

  • View available tools, prompts, and resources
  • Test get_jetbrains_code_inspections tool interactively
  • Use pre-configured prompts for common tasks
  • Access server resources (profiles, config, detected IDEs)
  • See requests/responses in real-time

βš™οΈ How It Works

🎯 Automatic IDE Selection

Note

The server intelligently detects and selects the most appropriate JetBrains IDE for your project.

Priority order:

  1. IntelliJ IDEA - Ultimate Java/Kotlin IDE
  2. WebStorm - JavaScript/TypeScript specialist
  3. PyCharm - Python development
  4. PhpStorm - PHP development
  5. GoLand - Go programming
  6. Rider - .NET development
  7. CLion - C/C++ development
  8. RubyMine - Ruby/Rails
  9. DataGrip - Database management
  10. DataSpell - Data science
  11. AppCode - iOS/macOS development

Tip

Use FORCE_INSPECT_PATH to override auto-detection and specify a particular IDE.

πŸ”’ Isolated Configuration

Important

Key Innovation: The server uses temporary isolated configuration directories with -Didea.config.path and -Didea.system.path JVM properties. This allows inspections to run even when the IDE is already open!

Benefits:

  • βœ… No IDE conflicts
  • βœ… Parallel execution support
  • βœ… Clean, isolated analysis
  • βœ… No interference with your active IDE sessions

πŸ’» Example Output

πŸ”Ž View Example Output (click to expand)
πŸ” Searching for available JetBrains IDE inspect tools...
   Following priority order: IntelliJ IDEA > WebStorm > PyCharm > PhpStorm > GoLand > ...

   βœ… WebStorm - Found and selected!
      Path: /Applications/WebStorm.app/Contents/bin/inspect.sh
      Note: Using isolated configuration - works even if IDE is already running

πŸ“Š Analysis Results:
   ⚠️ Warning: Unused variable 'config' at line 42
   ❌ Error: Missing semicolon at line 156
   πŸ’‘ Info: Consider using const instead of let at line 78

πŸ› οΈ Troubleshooting

❌ "JetBrains IDE inspect tool not found"

Warning

This error occurs when no JetBrains IDE can be found in standard installation locations.

Solutions:

  • βœ… Verify that a JetBrains IDE is installed in /Applications/ or ~/Applications/
  • βœ… Ensure the inspect.sh file is executable
  • βœ… Use FORCE_INSPECT_PATH environment variable to specify the exact path

⚠️ "No inspection profile found"

Caution

Without an inspection profile, the tool cannot analyze your code properly.

Steps to fix:

  1. Open the project in a JetBrains IDE
  2. Go to Settings β†’ Inspections
  3. Configure and save an inspection profile
  4. Alternatively, use FORCE_PROFILE_PATH to specify a custom profile

⏱️ Timeout Issues

Tip

Default timeout is 120 seconds. Large projects may need more time.

Solutions:

  • πŸ”„ Increase timeout: Set INSPECTION_TIMEOUT=300000 (5 minutes)
  • πŸ“Š Check that the IDE is not currently indexing
  • πŸ“¦ For very large projects, consider inspecting specific directories

🚫 "Only one instance can be run at a time"

Note

βœ… This is no longer an issue! The server automatically handles this by using isolated configuration directories, allowing inspections to run even when the IDE is already open.

πŸ“š Documentation

Tip

🌐 Visit our comprehensive documentation at josedacosta.github.io/mcp-jetbrains-code-inspections

Available sections:

Section Description
🏁 Getting Started Installation and prerequisites
βš™οΈ Configuration Environment variables and profiles
πŸ“– Usage Guide Basic and advanced usage
πŸ”¬ Technical Details Architecture and IDE detection
πŸ’‘ Guides Best practices and troubleshooting

πŸ“– JetBrains Documentation

Tip

Learn more about JetBrains code inspections and the command-line inspector:

Resource Description
πŸ“˜ Code Inspection Overview Learn about code inspections, severity levels, and inspection profiles
πŸ”§ Command-Line Code Inspector Detailed documentation on using the inspect.sh/inspect.bat tool

🀝 Contributing

Note

We welcome contributions! Please see our Contributing Guide for full details.

What we're looking for:

  • πŸ› Bug fixes and issue reports
  • ✨ New features and enhancements
  • πŸ“ Documentation improvements
  • πŸ§ͺ Test coverage expansion
  • 🌍 Language/IDE support

πŸš€ Quick Start for Contributors

Important

We follow Conventional Commits and use GitHub Flow.

# 1. Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/mcp-jetbrains-code-inspections.git

# 2. Create a feature branch
git checkout -b feat/amazing-feature

# 3. Make your changes and commit
git commit -m 'feat(scope): add amazing feature'

# 4. Push to your fork
git push origin feat/amazing-feature

# 5. Open a Pull Request

Tip

See CONTRIBUTING.md for branch naming, commit message standards, and PR guidelines.

🏷️ Keywords

πŸ” SEO Keywords (click to expand)

MCP & AI Integration: MCP server β€’ Model Context Protocol β€’ Claude Code integration β€’ MCP JetBrains β€’ Claude AI code inspection β€’ MCP tools β€’ Claude Code extensions β€’ MCP inspector β€’ Anthropic MCP β€’ Claude.ai code analysis β€’ LLM code analysis β€’ AI code review

JetBrains IDEs: JetBrains code inspection β€’ WebStorm MCP β€’ IntelliJ IDEA MCP integration β€’ PyCharm MCP server β€’ PhpStorm code inspection β€’ GoLand analysis β€’ Rider code quality β€’ CLion inspection β€’ RubyMine linter β€’ DataGrip SQL analysis β€’ Android Studio inspection β€’ RustRover analysis

Technical Terms: JetBrains command line inspector β€’ inspect.sh β€’ automated code inspection β€’ JetBrains unified profile β€’ IDE code diagnostics β€’ static code analysis β€’ inspection severity levels β€’ inspection profiles β€’ Node.js MCP server β€’ MCP environment variables β€’ code problems detection


Made with ❀️ by the Runtima Team

Star on GitHub Follow on GitHub