An open API service indexing awesome lists of open source software.

https://github.com/iamcharankumar/copilot-intellij-agent-hack

Turn IntelliJ Into a Context-Aware AI Powerhouse with Claude and MCP
https://github.com/iamcharankumar/copilot-intellij-agent-hack

Last synced: 3 months ago
JSON representation

Turn IntelliJ Into a Context-Aware AI Powerhouse with Claude and MCP

Awesome Lists containing this project

README

          

# Author

- **Name:** Charankumar H
- **LinkedIn:** [Charankumar H](https://www.linkedin.com/in/charankumar-h/)
- **GitHub:** [@iamcharankumar](https://github.com/iamcharankumar)

# Turn IntelliJ Into a Context-Aware AI Powerhouse with Claude and MCP

This repo shows how to integrate GitHub Copilot's IntelliJ plugin with Claude AI Agents using Playwright/Selenium MCP servers. It enables context-driven automation directly inside IntelliJ β€” where your AI agent understands state (like login), generates real test flows (Java 8/17 + TestNG), and executes actions in a fully wired environment. Perfect for devs and QAs who want to go beyond code suggestions and build smart, interactive workflows. No, you won't require Claude desktop this time. πŸ˜‰

## Simple Idea

> The LLMs [Large Language Models] has no decision-making capability.
> So think MCP as your middleware, which use an LLM and talk to you application.
> In this case our application is [Swag Labs](https://www.saucedemo.com/).
> When An LLM is integrated with MCP, we get an AI
> Agent that will help you in decision-making process.

## Prerequisites

Ensure you have the following installed:

1. IntelliJ IDEA (latest)
2. Node.js + npm (LTS)
3. GitHub Copilot IntelliJ Plugin

## Install GitHub Copilot IntelliJ Plugin

Github_Copilot_Plugin

1. Open IntelliJ
2. Navigate to Settings β†’ Plugins
3. Search for GitHub Copilot
4. Click Install
5. Restart IntelliJ

## Authenticate GitHub Copilot

1. After restart, go to File β†’ Settings β†’ Copilot
2. Click **Sign in to GitHub**
3. Follow the OAuth flow in the browser and authorize IntelliJ with your GitHub account.
4. Once authenticated, Copilot will be active in your IntelliJ editor, suggesting code completions and snippets as you
type.

AI_Agent_Preview

## AI Agent Preview: MCP Server Setup

Use the provided config file to run MCP Servers for Playwright and Selenium.

The below json is configured with the
official [Playwright MCP](https://github.com/microsoft/playwright-mcp?tab=readme-ov-file#getting-started) server
and [Angie Jones' Selenium MCP for Claude Desktop](https://github.com/angiejones/mcp-selenium?tab=readme-ov-file#use-with-other-mcp-clients-eg-claude-desktop-etc).

```json
{
"servers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
},
"selenium": {
"command": "npx",
"args": [
"-y",
"@angiejones/mcp-selenium"
]
}
}
}
```

1. Make sure the above json file is named as `mcp.json` and save in the location
`~/.config/github-copilot/intellij/mcp.json.` The config folder is a hidden folder. So make sure that it is unhidden
while placing it. Once you completed this step, execute the below command from your terminal.
2. Execute `cat ~/.config/github-copilot/intellij/mcp.json` to see the content of the `mcp.json` file.
3. You should be able to see the mcp.json file content like shown in the below image.

MCP_Json_Content

4. Now open your IntelliJ and enter the example prompt to see the MCP + LLM integration.

MCP_Server_Setup

## What will blow your mind?

1. The agent understands login state β€” without you telling it.
That’s real contextual awareness. No more explaining whether you're logged in or not β€” it just knows, and adapts.
2. You can ask for Playwright + TestNG (Java 8, 17, etc.) It generates production-ready automation scripts, not just toy
examples. You’ll be committing those outputs straight to your feature branch β€” seriously, check the demo video.
3. Here’s the exact natural language prompt used in the demo with Claude Agent + Playwright MCP:

```Plain Text
Use playwright MCP and Execute the below steps

Step 1: Open chrome browser and launch https://www.saucedemo.com
Step 2: login with standard_user and secret_sauce
Step 3: Quit the browser
```

https://github.com/user-attachments/assets/75a1eb5d-8dbe-4d20-a7f7-2705f6631086

## EXTRAS

- Make sure you keep track of your Usage Quota of the GitHub Copilot.
- Click the GitHub Copilot icon in the bottom right corner of IntelliJ to see your usage stats.

Quota_Usage_1

- Click on the "View Quota Usage" menu to view your current usage and limits.
- For free version, it is limited. See the image below.

Quota_Usage_2

## Important Note on MCP Tool Prompts

> When using Playwright MCP, Selenium MCP, or any MCP integration with the GitHub Copilot IntelliJ Plugin, you will
> still encounter the β€œDo you want to allow...” security prompts during Agent Preview. These prompts are a core security
> feature of the Copilot plugin and cannot be disabled via configuration β€” including autoApprove or toolPermissions in
> your mcp.json. For Playwright MCP tools specifically, these confirmation dialogs are intentional and enforced by design,
> to ensure secure handling of external tool access (e.g., browser control).
> ⚠️ Yes β€” it's not ideal for smooth workflows.
> βœ… But it's functional, and serves as a backup plan for Claude Desktop agent executions β€” not a replacement.

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=iamcharankumar/copilot-intellij-agent-hack&type=Date)](https://www.star-history.com/#iamcharankumar/copilot-intellij-agent-hack&Date)