ghostinspector-mcp-server

ghostinspector-mcp-server

Enables natural language interaction with Ghost Inspector for managing automated browser tests, suites, folders, and execution results.

Category
访问服务器

README

Ghost Inspector MCP Server

An MCP (Model Context Protocol) server for interacting with Ghost Inspector, an automated browser testing platform.

Features

This MCP server provides tools to:

  • Hierarchy & Modules: View complete folder/suite structure, list reusable modules, and analyze module usage
  • Tests: List, view, execute, create, duplicate, and manage test results
  • Suites: List, view, execute suites, import tests, and manage suite results
  • Folders: Browse folder structure and list suites within folders
  • Organizations: Monitor currently running tests

Installation

Using pip

pip install -e /path/to/ghostinspector-mcp-server

Using uv (recommended)

uv pip install -e /path/to/ghostinspector-mcp-server

Configuration

API Key

Set your Ghost Inspector API key as an environment variable:

export GHOST_INSPECTOR_API_KEY=your_api_key_here

You can find your API key at: https://app.ghostinspector.com/account

Claude Code Configuration

Add the server to your Claude Code MCP settings. Edit your ~/.claude/claude_desktop_config.json (or the appropriate config file):

{
  "mcpServers": {
    "ghostinspector": {
      "command": "ghostinspector-mcp",
      "env": {
        "GHOST_INSPECTOR_API_KEY": "your_api_key_here"
      }
    }
  }
}

Or if using uv:

{
  "mcpServers": {
    "ghostinspector": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/ghostinspector-mcp-server", "ghostinspector-mcp"],
      "env": {
        "GHOST_INSPECTOR_API_KEY": "your_api_key_here"
      }
    }
  }
}

Available Tools

Hierarchy & Module Tools

Tool Description
get_hierarchy Get complete folder/suite structure in a single call
list_modules List all reusable modules (tests with importOnly=true)
get_module_usage Find all tests that import a specific module

Test Tools

Tool Description
list_tests List all tests in your account (includes importOnly flag)
get_test Get detailed information about a specific test
execute_test Execute a test with optional parameters (browser, region, viewport, start URL)
duplicate_test Create a copy of an existing test
execute_on_demand_test Run a test from JSON definition without saving it permanently
list_test_results List execution history for a test
get_test_result Get detailed result information
cancel_test_result Cancel a running test

Suite Tools

Tool Description
list_suites List all test suites (includes resolved folder names)
get_suite Get suite details
execute_suite Execute all tests in a suite
import_test Create a new test in a suite from JSON definition
list_suite_tests List tests within a suite (includes importOnly flag)
list_suite_results List execution history for a suite
get_suite_result Get detailed suite result
list_suite_result_tests List individual test results from a suite run
cancel_suite_result Cancel a running suite

Folder Tools

Tool Description
list_folders List all folders
get_folder Get folder details
list_folder_suites List suites in a folder

Organization Tools

Tool Description
get_running_tests Get currently running tests for an organization

Usage Examples

Once configured, you can use natural language to interact with Ghost Inspector:

  • "List all my Ghost Inspector tests"
  • "Run the test with ID abc123"
  • "Show me the results for suite xyz789"
  • "What tests are currently running?"
  • "Execute the login test suite on Firefox"
  • "Create a test that clicks the login button and verifies the dashboard loads"
  • "Show me the folder and suite hierarchy"
  • "List all reusable modules"
  • "What tests use the login module?"

Understanding Modules

Ghost Inspector supports reusable test modules - tests that are designed to be imported into other tests rather than run independently. Common examples include login flows, navigation sequences, and setup/teardown procedures.

Identifying Modules

Tests marked with importOnly=true are modules. They:

  • Won't execute when running a suite (they're skipped)
  • Are meant to be imported into other tests using the "Import steps from test" step
  • Allow you to maintain common flows in one place

Module Tools

Tool Use Case
list_modules See all reusable modules grouped by suite
get_module_usage Impact analysis before modifying a module
list_tests / list_suite_tests Check importOnly flag to identify modules

Creating Tests

You can create tests programmatically using either import_test (saves permanently) or execute_on_demand_test (runs without saving).

Test Step Format

Steps are defined as a JSON array. Each step has:

  • command: The action to perform
  • target: CSS selector or element identifier
  • value: (optional) Value for the action

Available Commands

Command Description Example
click Click an element {"command": "click", "target": ".submit-btn"}
type Type text into an input {"command": "type", "target": "#email", "value": "test@example.com"}
open Navigate to a URL {"command": "open", "target": "https://example.com/page"}
assertTextPresent Verify text exists {"command": "assertTextPresent", "target": "body", "value": "Welcome"}
assertElementPresent Verify element exists {"command": "assertElementPresent", "target": ".success-message"}
assertElementVisible Verify element is visible {"command": "assertElementVisible", "target": "#modal"}
extract Extract text to a variable {"command": "extract", "target": ".user-id", "value": "userId"}
eval Execute JavaScript {"command": "eval", "value": "document.title"}
pause Wait for milliseconds {"command": "pause", "value": "2000"}
screenshot Take a screenshot {"command": "screenshot"}
mouseOver Hover over element {"command": "mouseOver", "target": ".dropdown"}
keypress Press keyboard key {"command": "keypress", "target": "#input", "value": "Enter"}

Example: Create a Login Test

Create a test in suite abc123 called "Login Test" that:
1. Goes to https://example.com/login
2. Types "user@example.com" into #email
3. Types "password123" into #password
4. Clicks the .login-button
5. Verifies "Dashboard" appears on the page

Development

Setup

# Clone the repository
cd ghostinspector-mcp-server

# Install dependencies
uv pip install -e ".[dev]"

Running Tests

pytest

Code Formatting

black src/
ruff check src/

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选