This guide explains how to set up and use UniAuto MCP Server with Cursor IDE and Claude AI.
Add the UniAuto MCP server as a tool by adding the following configuration:
{
"ai.mcp.enabled": true,
"ai.mcp.tools": [
{
"name": "uniauto-mcp-server",
"url": "http://localhost:3000/api"
}
]
}
Ensure your MCP server is properly configured with the Claude API key in the .env
file:
CLAUDE_API_KEY=your_claude_api_key
CLAUDE_MODEL=claude-3-7-sonnet-20240229
Start the MCP server:
npm run dev
For more reliable integration, use Smithery:
# Install Smithery if you haven't already
npm install -g @smithery/cli
# Connect UniAuto to Smithery
smithery connect uniauto-mcp-server
# Connect Claude to Smithery
smithery connect --assistant claude
Cursor uses Claude by default, which works seamlessly with UniAuto. Here’s how to use it:
Can you automate testing the login form on our application?
Claude will detect that it can use UniAuto and offer to perform the automation.
You can ask Claude to create and run complex test sequences:
Create a test suite for our e-commerce checkout flow using UniAuto.
The flow should:
1. Add a product to cart
2. Proceed to checkout
3. Fill out shipping information
4. Complete payment
5. Verify order confirmation
Claude will:
You can ask Claude to generate tests from user stories or requirements:
Based on this user story: "As a user, I want to be able to filter products by category and price range", generate UniAuto tests.
Claude can analyze your application code and generate appropriate tests:
Analyze this React component and create UniAuto tests for it:
[paste your component code here]
UniAuto’s self-healing features work especially well with Cursor + Claude:
Create a test for our product search feature that uses UniAuto's self-healing capabilities to handle UI changes.
Claude will generate tests that leverage UniAuto’s multiple selector strategies and visual recognition.
You can ask Claude to help set up CI/CD pipelines that use UniAuto:
Create a GitHub Actions workflow that runs our UniAuto tests on every pull request.
Claude will generate the necessary YAML configuration files and explain how to set them up.
If your tests fail, Claude can help diagnose and fix issues:
This UniAuto test is failing with the error "Element not found". Can you help debug it?
[paste your test code here]
Claude will analyze the problem and suggest fixes, possibly using UniAuto’s self-healing or alternative selectors.
Keep the Context Window Open: When working on complex automation, keep relevant code files open in Cursor to give Claude more context.
Use Split View: Use Cursor’s split view to keep your test code visible while Claude helps debug and improve it.
Save Common Patterns: When Claude creates effective test patterns, save them as snippets for future use.
Leverage Cursor’s Code History: Cursor keeps track of AI-generated code. If a test approach doesn’t work, you can easily roll back to a previous version.
Combine with Manual Testing: Ask Claude to generate tests that complement your manual testing efforts, focusing on regression testing and edge cases.
If Cursor can’t connect to UniAuto:
If Claude reports permission issues:
For persistent test failures: