Complete Setup Guide and possible setup options with IntelliJ IDEA IDE
Selenium has long been one of the most widely used tools for browser automation and end-to-end testing. With the Model Context Protocol (MCP), AI assistants such as Claude can interact with browser automation tools through a standardized interface. We cover Complete Setup of Selenium MCP Server with VS Code and Claude and explore the possibility with IntelliJ IDEA IDE.
This makes it possible to use natural-language instructions such as:
“Open the login page, enter the test credentials, verify the dashboard, and report any failures.”
Instead of manually writing every Selenium command, an MCP-enabled AI client can discover and invoke browser automation tools exposed by an MCP server.
This article explains how to set up a Selenium MCP workflow with:
- Visual Studio Code
- Claude / Claude Code
- IntelliJ IDEA
- A Selenium-based MCP server
What Is MCP?
The Model Context Protocol, or MCP, is a standardized protocol that allows AI applications to connect to external tools and data sources.
The architecture looks like this:
┌────────────────────┐│ Claude / AI Client │└──────────┬─────────┘ │ MCP ▼┌────────────────────┐│ Selenium MCP Server │└──────────┬─────────┘ │ ▼┌────────────────────┐│ Selenium WebDriver │└──────────┬─────────┘ │ ▼┌────────────────────┐│ Chrome / Edge / ││ Firefox Browser │└────────────────────┘
The MCP server acts as the bridge between the AI assistant and Selenium.
The AI assistant does not directly need to know every implementation detail of WebDriver. Instead, the MCP server exposes browser automation capabilities as tools.
For example, an MCP server may expose tools such as:
- Start a browser session
- Navigate to a URL
- Find an element
- Click an element
- Enter text
- Take a screenshot
- Read page content
- Execute a browser action
- Close the browser
1. Prerequisites
Before starting, install the following:
Required software
- Node.js and npm
- A supported browser such as Chrome, Edge, or Firefox
- Selenium WebDriver
- Visual Studio Code, if using the VS Code workflow
- Claude Desktop or Claude Code
- An MCP-compatible Selenium server
You should also verify your Node.js installation:
node --versionnpm --version
The exact MCP package and startup command depend on the Selenium MCP server implementation you choose. Always verify the package name, publisher, and configuration before installing it. VS Code specifically warns that local MCP servers can execute arbitrary code on the machine, so MCP servers should only be installed from trusted sources.
2. Configure Selenium MCP with VS Code
Visual Studio Code has built-in support for adding and configuring MCP servers.
MCP servers can be installed from the MCP server gallery or configured manually through the workspace MCP configuration file.
Option A: Install from the MCP Gallery
In VS Code:
- Open the Extensions view.
- Search for:
@mcp
- Find the Selenium MCP server you want to use.
- Install it either:
- In your user profile, or
- In the current workspace.
For workspace installation, VS Code updates:
.vscode/mcp.json
VS Code supports manually configuring MCP servers in this file as well.
Option B: Configure the MCP Server Manually
A typical MCP configuration has this general structure:
{ "servers": { "selenium": { "command": "npx", "args": [ "-y", "<selenium-mcp-package>" ] } }}
Replace <selenium-mcp-package> with the actual package name of the Selenium MCP server you have selected.
The important concept is:
VS Code ↓MCP Client ↓Selenium MCP Server ↓Selenium WebDriver ↓Browser
The configuration format can vary depending on whether the server is launched through:
npxnode- Python
- A standalone executable
- Docker
- An HTTP or SSE endpoint
Therefore, use the configuration format documented by the specific MCP server implementation.
3. Configure Claude with Selenium MCP
Claude can act as the MCP client that invokes Selenium tools.
There are two common workflows:
Workflow 1: Claude Desktop
Claude Desktop uses its own MCP configuration.
A typical configuration concept looks like:
{ "mcpServers": { "selenium": { "command": "npx", "args": [ "-y", "<selenium-mcp-package>" ] } }}
After updating the configuration:
- Save the configuration file.
- Restart Claude Desktop.
- Open a new conversation.
- Verify that the Selenium MCP tools are available.
The exact configuration location and format may vary by client version and operating system.
Workflow 2: Claude Code
Claude Code uses its own MCP configuration workflow.
A typical command-based setup is conceptually:
claude mcp add selenium -- <command-to-start-selenium-mcp>
For example, if the server is started using a Node.js command, the configuration will reference that command and its arguments.
After adding the server, you can inspect the configured MCP servers from Claude Code.
The important distinction is that Claude Desktop, Claude Code, and VS Code can have separate MCP configurations. Configuring an MCP server in one client does not necessarily configure it automatically in another.
4. Using Claude to Drive Selenium
Once the MCP server is connected, you can use natural-language prompts.
For example:
Open https://example.com and verify that the page title contains "Example Domain".
A more complete testing workflow might be:
Navigate to the login page.Enter the test username and password.Submit the login form.Verify that the dashboard is displayed.If the login fails, capture a screenshot and report the error.
The MCP server translates the AI’s requested actions into Selenium operations.
The overall flow is:
User Prompt ↓Claude ↓MCP Tool Selection ↓Selenium MCP Server ↓WebDriver Commands ↓Browser
This can be useful for:
- Exploratory testing
- UI smoke testing
- Test debugging
- Regression investigation
- Generating test scenarios
- Reproducing browser workflows
- Validating application behavior
5. VS Code Project Structure
A typical automation project may look like this:
selenium-mcp-project/│├── .vscode/│ └── mcp.json│├── tests/│ ├── login.test.js│ └── checkout.test.js│├── pages/│ ├── LoginPage.js│ └── DashboardPage.js│├── package.json└── README.md
The MCP configuration is usually kept in:
.vscode/mcp.json
This makes the MCP setup available to the project rather than only to a single developer machine.
For team environments, you should carefully review whether the MCP configuration contains:
- Secrets
- API keys
- Tokens
- Local file paths
- Machine-specific settings
Sensitive values should not be committed to source control.
6. Is Selenium MCP Available for IntelliJ IDEA?
Yes, IntelliJ IDEA supports MCP workflows.
There are two different concepts to understand.
Option 1: Use IntelliJ IDEA as an MCP Server
Starting with IntelliJ IDEA 2025.2, JetBrains provides an integrated MCP server. This allows external clients such as Claude Desktop, Claude Code, VS Code, Cursor, and others to access tools provided by the IDE.
To enable it:
- Open IntelliJ IDEA.
- Go to:
Settings → Tools → MCP Server
- Enable the MCP Server.
- Use the client auto-configuration option for the client you want to connect.
- Restart the client.
IntelliJ IDEA can also provide manual configuration options, including different transport types such as:
- Stdio
- SSE
- HTTP streaming
JetBrains also provides options to copy the required configuration for manual client setup.
Option 2: Use IntelliJ IDEA as the Development Environment for a Selenium MCP Server
You can also run your Selenium MCP project directly from IntelliJ IDEA.
For example:
IntelliJ IDEA │ ├── Selenium Test Code ├── MCP Configuration └── Selenium MCP Server │ ▼ Browser
In this workflow, IntelliJ is simply your IDE, while Claude acts as the AI client.
You can:
- Open the Selenium project in IntelliJ IDEA.
- Configure the MCP server separately.
- Run the Selenium MCP server from the IntelliJ terminal.
- Connect Claude to the server.
- Allow Claude to interact with the project and browser automation workflow.
This is often the simplest approach for Java-based Selenium projects.
7. IntelliJ IDEA + Claude Setup
The recommended setup is:
┌─────────────────────┐│ Claude ││ Desktop / Code │└──────────┬──────────┘ │ │ MCP ▼┌─────────────────────┐│ IntelliJ IDEA MCP ││ Server │└──────────┬──────────┘ │ ▼┌─────────────────────┐│ IntelliJ Project ││ ││ Selenium Tests ││ Java Code ││ Test Configuration │└─────────────────────┘
In IntelliJ IDEA:
Settings ↓Tools ↓MCP Server ↓Enable MCP Server
Then use the Auto-Configure option for the external client.
JetBrains documents automatic configuration for external clients, including Claude Desktop, Claude Code, VS Code, Cursor, Codex, and Windsurf.
For Claude Desktop specifically, JetBrains documents an auto-configuration flow that updates the Claude Desktop MCP configuration.
8. Recommended Architecture for Java Selenium Projects
For a Java-based Selenium project, I recommend this architecture:
┌──────────────┐
│ Claude │
└──────┬───────┘
│
│ MCP
▼
┌─────────────────┐
│ Selenium MCP │
│ Server │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Selenium │
│ WebDriver │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Chrome / Edge │
└─────────────────┘
┌────────────────────────────┐
│ IntelliJ IDEA │
│ │
│ Java Selenium Project │
│ Page Objects │
│ TestNG / JUnit │
│ Maven / Gradle │
└────────────────────────────┘
A typical project might contain:
selenium-project/│├── pom.xml│├── src/│ ├── main/java/│ │ └── pages/│ ││ └── test/java/│ └── tests/│└── .mcp/ └── configuration.json
Claude can then help with tasks such as:
Analyze the LoginPage class and identify missing synchronization.Create a Selenium test for the invalid login scenario.Run the login test and investigate the failure.Open the application and verify that the logout flow works.Review the failing test screenshot and identify the likely root cause.
9. Important Security Considerations
MCP servers can expose powerful capabilities.
A Selenium MCP server may be able to:
- Open arbitrary websites
- Submit forms
- Enter data
- Read page content
- Take screenshots
- Execute browser actions
An IDE MCP server may also expose capabilities such as:
- Reading project files
- Modifying source code
- Running configurations
- Executing terminal commands
For this reason, you should:
- Install MCP servers only from trusted sources.
- Review the server configuration before running it.
- Avoid storing passwords directly in prompts or configuration files.
- Use test accounts for browser automation.
- Avoid exposing production credentials.
- Restrict tools to only those required by the workflow.
- Review confirmation settings before enabling automatic command execution.
JetBrains provides an option to expose and manage the tools available through its MCP server. It also provides a “brave mode” that can allow shell commands or run configurations without repeated confirmation, so this setting should be enabled only when appropriate for your environment.
10. VS Code or IntelliJ IDEA: Which Should You Choose?
Choose VS Code when:
- You want a lightweight editor.
- You primarily use Claude Code.
- You want project-level
.vscode/mcp.jsonconfiguration. - You work across multiple languages.
- You want a simple MCP client workflow.
Choose IntelliJ IDEA when:
- You develop primarily in Java or Kotlin.
- Your Selenium framework uses Maven or Gradle.
- You use JUnit or TestNG.
- You want deep Java code intelligence.
- You want to use JetBrains’ built-in MCP server.
- You want Claude to interact with IntelliJ project context.
For Java Selenium automation, IntelliJ IDEA is generally the more natural development environment. For a lightweight AI-assisted workflow, VS Code can be simpler.
Conclusion
Selenium MCP creates a bridge between AI assistants and browser automation.
A practical setup can look like:
Claude ↓MCP ↓Selenium MCP Server ↓Selenium WebDriver ↓Browser
With VS Code, MCP servers can be installed from the MCP gallery or configured through .vscode/mcp.json.
With IntelliJ IDEA, you can use the integrated MCP server available from IntelliJ IDEA 2025.2 onward, configure external clients such as Claude, and allow AI tools to interact with the IDE and project context.
The most effective setup for a Java Selenium team is usually:
IntelliJ IDEA +Java Selenium Framework +Selenium MCP Server +Claude
This combination can accelerate exploratory testing, browser debugging, test generation, and failure investigation while keeping the actual automation framework under the team’s control.
Related Links
Model Context Protocol documentation
VS Code MCP servers documentation
Claude Code MCP documentation
Claude Desktop MCP documentation
IntelliJ IDEA MCP Server documentation
Related Articles
Agentic Test Automation using Playwright MCP
Discover more from Rotebit
Subscribe to get the latest posts sent to your email.
