SHAFT MCP is a Model Context Protocol (MCP) server that enables Claude Desktop to perform web automation tasks using the SHAFT Engine (a Selenium-based test automation framework). This gives Claude powerful browser automation capabilities including:
Core Features
Browser Control: Launch Chrome, Firefox, Safari, or Edge browsers
Element Interaction: Click, hover, type, clear, drag-and-drop elements
AI-Enhanced Element Detection: Find elements by natural language descriptions
Replace /FULL/PATH/TO/SHAFT_MCP/ with the actual absolute path to your repository
Ensure the JAR file version matches what was built (check the target/ directory)
Use forward slashes / even on Windows, or double backslashes \\\\ for Windows paths
Verify Installation
Start Claude Desktop
Check MCP Server Status:
Go to File > Settings > Developer
Look for shaft-mcp in the MCP servers list
Confirm the status shows as running
Test the server with this prompt in Claude:
Use shaft-mcp to launch Chrome, navigate to google.com, search for "selenium webdriver", and get the page title.
Usage Examples
Once configured, you can use Claude to perform complex web automation tasks:
Basic Browser Control
Use shaft-mcp to:
1. Launch Firefox browser
2. Navigate to https://example.com
3. Get the page title and current URL
Element Interaction
Use shaft-mcp to:
1. Launch Chrome
2. Go to a login page
3. Find the username field and type "testuser"
4. Find the password field and type "testpass"
5. Click the login button
AI-Enhanced Element Detection
Use shaft-mcp to:
1. Open a browser and go to amazon.com
2. Click on the search box using AI
3. Type "laptop" in the search field
4. Click the search button using AI
Data Extraction
Use shaft-mcp to:
1. Navigate to a news website
2. Get all the article headlines
3. Extract the main content text
4. Generate a test report
Troubleshooting
Common Issues:
"No active browser session found"
Always initialize a browser first using driver_initialize
MCP Server not running
Verify the JAR file path is correct and absolute
Check that Java 21 is installed and accessible
Ensure Claude Desktop was restarted after config changes
Build failures
Verify Java 21 is installed: java -version
Ensure Maven is available: mvn -version
Try cleaning first: mvn clean
Element not found errors
Use AI-based element detection (element_click_ai, element_type_ai)
Try different locator strategies (CSS, XPath, ID, etc.)
Check if the element is visible with element_is_displayed
Advanced Configuration
You can add additional MCP servers alongside SHAFT MCP:
Automate web testing - Run comprehensive test suites on web applications
Perform web scraping - Extract data from websites with complex interactions
Automate repetitive tasks - Fill forms, upload files, navigate workflows
Generate test reports - Create detailed Allure reports with screenshots and logs
Cross-browser testing - Test across Chrome, Firefox, Safari, and Edge
AI-powered element detection - Find elements by description instead of technical locators
This essentially turns Claude into a powerful web automation assistant that can handle complex browser-based tasks that would normally require manual effort or custom scripting.