katalon-mcp-server

katalon-mcp-server

Bridges Katalon Studio with Claude AI for intelligent QA automation, enabling project analysis, test case creation, execution, and object repository management.

Category
访问服务器

README

Katalon MCP Server

License: MIT Node.js Version TypeScript

A comprehensive Model Context Protocol (MCP) server that bridges Katalon Studio with Claude AI for intelligent QA automation. This project enables seamless integration between your existing Katalon Studio and Katalon Runtime Engine licenses with AI-powered test automation capabilities.

📋 Table of Contents

🚀 Quick Start

# Clone the repository
git clone https://github.com/your-organization/katalon-mcp-server.git
cd katalon-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

📋 Prerequisites

Before setting up the Katalon MCP Server, ensure you have the following installed:

Required Software

  • Node.js: Version 18.0.0 or higher (Download)
  • npm: Comes with Node.js (verify with npm --version)
  • Katalon Studio or Katalon Runtime Engine: Valid license required
  • Claude Desktop: For MCP integration (Download)

System Requirements

  • Operating System: Windows 10/11, macOS 10.15+, or Linux (Ubuntu 18.04+)
  • Memory: Minimum 4GB RAM (8GB recommended)
  • Storage: At least 1GB free space
  • Network: Internet connection for package installation

Katalon Setup

  • Valid Katalon Studio or Runtime Engine license
  • Katalon installation path accessible to the system
  • Environment variable KATALON_HOME (optional, auto-detected if not set)

📦 Installation

Method 1: Clone from GitHub (Recommended)

# Clone the repository
git clone https://github.com/your-organization/katalon-mcp-server.git

# Navigate to the project directory
cd katalon-mcp-server

# Install dependencies
npm install

# Build the TypeScript project
npm run build

Method 2: Download ZIP

  1. Download the latest release from GitHub Releases
  2. Extract the ZIP file to your desired location
  3. Open terminal/command prompt in the extracted folder
  4. Run the installation commands:
npm install
npm run build

Method 3: Automated Setup (Windows)

For Windows users, you can use the provided PowerShell script:

# Run the setup script as Administrator
.\setup.ps1

This script will:

  • Install all dependencies
  • Build the project
  • Test the server startup
  • Display next steps for configuration

⚙️ Configuration

1. Environment Variables (Optional)

Set up environment variables for better integration:

# Windows (Command Prompt)
set KATALON_HOME=C:\Program Files\Katalon_Studio_Engine

# Windows (PowerShell)
$env:KATALON_HOME="C:\Program Files\Katalon_Studio_Engine"

# macOS/Linux
export KATALON_HOME="/Applications/Katalon Studio Engine.app/Contents/MacOS"

2. Claude Desktop Configuration

Add the following configuration to your Claude Desktop settings:

Location of config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Configuration:

{
  "mcpServers": {
    "katalon-mcp-server": {
      "command": "node",
      "args": ["/absolute/path/to/katalon-mcp-server/dist/index.js"],
      "cwd": "/absolute/path/to/katalon-mcp-server"
    }
  }
}

Example configurations by OS:

Windows:

{
  "mcpServers": {
    "katalon-mcp-server": {
      "command": "node",
      "args": ["D:\\Projects\\katalon-mcp-server\\dist\\index.js"],
      "cwd": "D:\\Projects\\katalon-mcp-server"
    }
  }
}

macOS/Linux:

{
  "mcpServers": {
    "katalon-mcp-server": {
      "command": "node",
      "args": ["/Users/yourname/Projects/katalon-mcp-server/dist/index.js"],
      "cwd": "/Users/yourname/Projects/katalon-mcp-server"
    }
  }
}

3. Verification

Test your setup by running:

# Start the server
npm start

# You should see output similar to:
# Katalon MCP Server started successfully
# Listening on stdio...
# Available tools: 6

🚀 Usage

Starting the Server

# Development mode (rebuilds on changes)
npm run dev

# Production mode
npm start

# Watch mode (rebuilds automatically)
npm run watch

Basic Commands in Claude

Once configured, you can use these commands in Claude Desktop:

# Analyze a Katalon project
Analyze my Katalon project at C:\MyProject\ECommerce_Tests

# Create a new test case
Create a login test case for my application with username field id="email" and password field id="password"

# Execute a test suite
Execute the regression test suite using Chrome browser

# Manage object repository
Update the checkout button object with smart healing enabled

🛠️ Available Tools

The Katalon MCP Server provides the following tools for Claude AI:

1. Project Analysis

  • Tool: katalon_analyze_project
  • Purpose: Analyze project structure, health metrics, and provide recommendations
  • Usage: Provides comprehensive insights into test suite organization and object repository health

2. Test Case Management

  • Tool: katalon_create_test_case
  • Purpose: Create new test cases with intelligent templates
  • Templates: Login, API Testing, Data-Driven, Mobile, Custom
  • Features: Automatic object repository integration

3. Test Execution

  • Tool: katalon_execute_test_suite
  • Purpose: Execute test suites with real-time monitoring
  • Features: Multi-browser support, execution profiles, detailed reporting

4. Object Repository Management

  • Tool: katalon_manage_object_repository
  • Purpose: Advanced object repository operations
  • Features: Smart healing, object health analysis, bulk operations

5. Keyword Management

  • Tool: katalon_manage_keywords
  • Purpose: Create and manage custom keywords
  • Features: Built-in templates, parameter handling, documentation generation

6. Smart Healing

  • Tool: katalon_smart_healing
  • Purpose: Automatic object healing and optimization
  • Features: Multiple fallback strategies, confidence scoring, auto-updates

🔧 Development

Project Structure

katalon-mcp-server/
├── src/
│   ├── index.ts                 # Main server entry point
│   └── katalon/
│       ├── keyword-manager.ts   # Keyword management tools
│       ├── object-repository.ts # Object repository operations
│       ├── project-manager.ts   # Project analysis and management
│       ├── smart-healing.ts     # Smart healing functionality
│       └── test-executor.ts     # Test execution engine
├── dist/                        # Compiled JavaScript (generated)
├── package.json                 # Project dependencies and scripts
├── tsconfig.json               # TypeScript configuration
├── setup.ps1                  # Windows setup script
├── README.md                   # This file
└── USAGE_EXAMPLES.md          # Comprehensive usage examples

Available Scripts

# Build the project
npm run build

# Start the server
npm start

# Development mode (build + start)
npm run dev

# Watch mode (auto-rebuild)
npm run watch

# Run tests (if available)
npm test

Building from Source

# Clone and setup
git clone https://github.com/your-organization/katalon-mcp-server.git
cd katalon-mcp-server
npm install

# Development workflow
npm run watch  # In one terminal (auto-rebuilds)
npm start      # In another terminal (run server)

✨ Features

🚀 Core Capabilities

  • Test Suite Execution: Execute existing Katalon test suite collections with real-time monitoring
  • Smart Test Case Creation: Generate new test cases with intelligent object identification
  • Object Repository Management: Advanced object repository handling with smart healing
  • Keyword Management: Comprehensive support for built-in and custom Katalon keywords
  • Smart Healing: Automatic object healing with multiple fallback strategies
  • Execution Analytics: Detailed test execution reports and insights

🔧 Key Components

1. Project Manager (project-manager.ts)

  • Analyze Katalon project structure and health
  • Create new test cases with templates
  • Provide project insights and recommendations
  • Support for multiple test case templates (Login, API, Data-Driven, Mobile)

2. Test Executor (test-executor.ts)

  • Execute test suites and test suite collections
  • Real-time execution monitoring and logging
  • Comprehensive execution reports with screenshots
  • Support for multiple browsers and execution profiles
  • Cross-platform Katalon Runtime Engine detection

3. Object Repository Manager (object-repository.ts)

  • Advanced object repository operations
  • Smart healing configuration and management
  • Object health analysis and recommendations
  • Bulk object operations and optimization

4. Keyword Manager (keyword-manager.ts)

  • Create and manage custom keywords
  • Built-in keyword templates and best practices
  • Parameter handling and validation
  • Documentation generation for custom keywords

5. Smart Healing Engine (smart-healing.ts)

  • Automatic object healing with confidence scoring
  • Multiple fallback strategies (XPath, CSS, attributes)
  • Learning from previous healing attempts
  • Integration with object repository for seamless updates

🤝 Contributing

We welcome contributions! Please follow these steps:

Getting Started

  1. Fork the repository
  2. Clone your fork:
    git clone https://github.com/your-username/katalon-mcp-server.git
    
  3. Create a feature branch:
    git checkout -b feature/your-feature-name
    

Development Guidelines

  • Follow TypeScript best practices
  • Add appropriate error handling
  • Include JSDoc comments for public methods
  • Test your changes thoroughly
  • Update documentation as needed

Submitting Changes

  1. Commit your changes:
    git add .
    git commit -m "feat: add new feature description"
    
  2. Push to your fork:
    git push origin feature/your-feature-name
    
  3. Create a Pull Request on GitHub

Commit Message Convention

We use conventional commits:

  • feat: for new features
  • fix: for bug fixes
  • docs: for documentation changes
  • refactor: for code refactoring
  • test: for adding tests

🐛 Troubleshooting

Common Issues

1. Katalon Runtime Engine Not Found

Error: Could not locate Katalon Runtime Engine

Solution:

  • Ensure Katalon is installed and accessible
  • Set KATALON_HOME environment variable
  • Verify Katalon license is valid

2. Node.js Version Issues

Error: Node.js version 18.0.0 or higher is required

Solution:

  • Update Node.js to version 18+ from nodejs.org
  • Use Node Version Manager (nvm) to manage versions

3. Permission Errors (Windows)

Error: EACCES permission denied

Solution:

  • Run terminal as Administrator
  • Check folder permissions
  • Ensure antivirus isn't blocking the application

4. TypeScript Compilation Errors

Error: Cannot find module or type declarations

Solution:

  • Delete node_modules and package-lock.json
  • Run npm install again
  • Ensure TypeScript version compatibility

5. Claude Desktop Not Connecting

MCP server not appearing in Claude Desktop

Solution:

  • Verify config file location and syntax
  • Use absolute paths in configuration
  • Restart Claude Desktop after configuration changes
  • Check server logs for errors

Getting Help

Debug Mode

Enable debug logging:

# Set debug environment variable
DEBUG=katalon-mcp-server npm start

# Or on Windows PowerShell
$env:DEBUG="katalon-mcp-server"; npm start

📚 Documentation

🏗️ Architecture

The Katalon MCP Server follows a modular architecture:

┌─────────────────┐
│   Claude AI     │
└─────────┬───────┘
          │ MCP Protocol
┌─────────▼───────┐
│  MCP Server     │
│  (index.ts)     │
└─────────┬───────┘
          │
    ┌─────▼─────┐
    │  Katalon  │
    │  Modules  │
    └─────┬─────┘
          │
┌─────────▼───────┐
│ Katalon Studio/ │
│ Runtime Engine  │
└─────────────────┘

🔒 Security Considerations

  • Local Execution: All operations execute locally on your machine
  • No Data Transmission: Test data and project information stay on your system
  • License Respect: Requires valid Katalon license for all operations
  • File System Access: Limited to specified project directories

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Anthropic for the Model Context Protocol specification
  • Katalon for the comprehensive test automation platform
  • TypeScript community for excellent tooling
  • Open Source Contributors who make projects like this possible

Made with ❤️ for the QA Automation Community

For more examples and advanced usage patterns, see USAGE_EXAMPLES.md.

  • Create, update, and delete test objects
  • Smart healing capabilities for dynamic elements
  • Object health analysis and recommendations
  • Best practices guidance for object identification
  • Duplicate selector detection and resolution

4. Keyword Manager (keyword-manager.ts)

  • Browse 150+ built-in Katalon keywords with examples
  • Create and manage custom keywords
  • Keyword usage analytics and recommendations
  • Code generation assistance for common patterns

5. Smart Healing System (smart-healing.ts)

  • Automatic object healing with 6 different strategies
  • Configurable healing confidence thresholds
  • Healing attempt history and analytics
  • Visual recognition capabilities (extensible)
  • Comprehensive healing reports and recommendations

Installation

Prerequisites

  • Node.js 18+
  • Katalon Studio or Katalon Runtime Engine
  • TypeScript 5+

Setup

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    
  4. Start the MCP server:
    npm start
    

Configuration

Katalon Integration

The server automatically detects Katalon installations in common locations:

  • Windows: C:\\Katalon_Studio_Engine\\katalonc.exe
  • macOS: /Applications/Katalon Studio.app/Contents/MacOS/katalonc
  • Linux: /opt/katalon/katalonc
  • Environment: $KATALON_HOME/katalonc

Smart Healing Configuration

Configure smart healing behavior in your project:

{
  "enabled": true,
  "confidenceThreshold": 0.8,
  "maxHealingAttempts": 3,
  "reportFailures": true,
  "autoUpdateObjects": false,
  "healingStrategies": [
    "attribute_fallback",
    "xpath_optimization", 
    "css_conversion",
    "text_content_matching",
    "relative_positioning"
  ]
}

MCP Tools

Test Execution

// Execute a test suite
await mcp.callTool('katalon_execute_test_suite', {
  projectPath: '/path/to/katalon/project',
  testSuitePath: 'Test Suites/Regression Suite.ts',
  browser: 'Chrome',
  executionProfile: 'production'
});

Test Case Creation

// Create a new test case
await mcp.callTool('katalon_create_test_case', {
  projectPath: '/path/to/katalon/project',
  testCaseName: 'User_Login_Success',
  description: 'Test successful user login with valid credentials',
  testSteps: [
    'Navigate to login page',
    'Enter valid username',
    'Enter valid password', 
    'Click login button',
    'Verify successful login'
  ]
});

Object Repository Management

// Create a new object with smart healing
await mcp.callTool('katalon_manage_object_repository', {
  projectPath: '/path/to/katalon/project',
  action: 'create',
  objectName: 'login_username_field',
  selector: '#username',
  selectorType: 'css',
  smartHealingEnabled: true
});

Keyword Management

// List built-in keywords
await mcp.callTool('katalon_manage_keywords', {
  projectPath: '/path/to/katalon/project',
  action: 'list_builtin'
});

// Create custom keyword
await mcp.callTool('katalon_manage_keywords', {
  projectPath: '/path/to/katalon/project',
  action: 'create_custom',
  keywordName: 'verifyLoginSuccess',
  keywordCode: `
    WebUI.verifyElementPresent(findTestObject('Dashboard/welcome_message'), 10)
    WebUI.verifyElementText(findTestObject('Dashboard/user_name'), username)
  `
});

MCP Resources

Test Templates

Access comprehensive test case templates:

katalon://test-templates

Object Repository Best Practices

Get guidance on object identification:

katalon://object-repository-patterns

Keyword Library

Browse the complete keyword library:

katalon://keyword-library

MCP Prompts

Test Design Guidance

await mcp.getPrompt('katalon_test_design', {
  application_type: 'web',
  test_scope: 'regression'
});

Object Identification Help

await mcp.getPrompt('katalon_object_identification', {
  element_type: 'button'
});

Development

Building

npm run build        # Compile TypeScript
npm run watch        # Watch mode for development
npm run dev          # Build and run

Testing

npm test            # Run tests (when implemented)

Integration with Claude AI

This MCP server is designed to work seamlessly with Claude AI, providing:

  1. Contextual Test Automation: Claude can understand your Katalon project structure and suggest appropriate test strategies
  2. Intelligent Object Identification: AI-powered recommendations for robust object selectors
  3. Smart Test Case Generation: Generate test cases based on requirements or user stories
  4. Automated Problem Resolution: Use smart healing insights to improve test stability
  5. Best Practice Guidance: Get AI-powered recommendations for test automation improvements

Example Claude Integration

"I need to test the checkout process for an e-commerce site. The application has dynamic element IDs that change between deployments."

Claude with Katalon MCP Server can:
- Analyze your existing test structure
- Suggest robust object identification strategies
- Create test cases with smart healing enabled
- Provide best practices for handling dynamic elements
- Generate comprehensive test data scenarios

Architecture

Katalon MCP Server
├── MCP Protocol Layer (index.ts)
│   ├── Tools (execute, create, manage)
│   ├── Resources (templates, guides, libraries)
│   └── Prompts (design guidance, best practices)
├── Katalon Integration Layer
│   ├── Project Manager (analysis, creation)
│   ├── Test Executor (execution, monitoring)
│   ├── Object Repository (management, healing)
│   ├── Keyword Manager (built-in, custom)
│   └── Smart Healing (strategies, reporting)
└── Katalon Runtime Engine Interface
    ├── Command Line Integration
    ├── Report Parsing
    └── File System Management

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments


Built with ❤️ for QA Automation Engineers

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选