Skip to content

iamcharankumar/copilot-intellij-agent-hack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Author

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. 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 server and Angie Jones' Selenium MCP for Claude Desktop.

{
  "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
  1. 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:
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
MCP_LLM_Swag_Labs_Demo.mp4

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published