squish-mcp
Enables AI agents to run and create Squish test scripts and test suites and analyze the results.
README
Squish MCP Server
[!IMPORTANT] This repository is outdated and no longer maintained. A new version of Squish MCP is available in the Qt Customer Portal.
The new version equips AI agents with the capability of directly interacting with your application under test (AUT), which enables them to generate sensible test cases for complex applications such as Qt Creator, and reduces the amount of tokens required for generating tests. See the release announcement for more details.
Squish MCP v0.1.0 (outdated)
Squish Model Context Protocol (MCP) server enables AI agents to run and create Squish (documentation) test scripts and test suites and analyze the results.
Demo video of Squish MCP in action
Requirements
- uv — Python package manager (also takes care of the correct Python version)
- Squish (version 9.0 or later)
- GitHub Copilot (VS Code Extension) (version 0.40 or later)
Tested on Windows 11, macOS, and Ubuntu 22.04.
Known Limitations
- Supported AUTs. Only Qt Widgets and QML-based applications are currently tested.
- Real names should be enabled. Without enabling real names, the performance gains provided by Squish MCP are severely reduced. To enable real name generation, modify the snapshot filter file at
<path-to-squish>/etc/qt_snapshot_filter.xmland change<realname exclude="yes"/>to<realname exclude="no"/>. - Avoid spaces in paths. VS Code has issues with spaces in file paths, which can cause otherwise correct configurations to fail. See vscode#214931.
Installation
- Clone the repository:
git clone <repository-url> cd squish-mcp - Install Python dependencies:
uv sync - Configure the MCP server in VS Code. The exact configuration entry will vary depending on your agent. For GitHub Copilot in VS Code, it may look like this (
.vscode/mcp.jsonin your working directory):MCP configuration documentation for VS Code (GitHub Copilot){ "servers": { "SquishMCP": { "command": "uv", "args": ["run", "--directory", "<path-to-squish-mcp>", "squish_mcp"], "env": { "SQUISH_PREFIX": "<path-to-squish>", } } } }
<details> <summary>Using Other Agents</summary>
While this project is primarily tested with GitHub Copilot in VS Code, MCP is an open standard and other agents should work as well. Some alternatives:
- Claude Code — See the Claude Code MCP documentation for configuration details.
- GitHub Copilot CLI — The Copilot CLI gives you more control over the agent from a terminal. </details>
<details> <summary>Starting the Server over HTTP</summary>
By default the server is started as a subprocess by the VS Code extension (stdio transport). Alternatively, you can start the server manually over HTTP for more control over the underlying process.
Start the server in a terminal:
SQUISH_PREFIX=<path-to-squish> uv run --directory <path-to-squish-mcp> squish_mcp --transport http --host localhost --port 8000
Then configure the MCP client to connect to it:
{
"servers": {
"Squish-MCP": {
"url": "http://localhost:8000/mcp",
"type": "http"
}
}
}
</details>
Usage
Once your MCP server is configured and recognized by your agent, you are ready to start prompting. Most of the MCP tools operate in the context of a single test suite and accept the test_suite_path argument (a concrete suite_* directory path).
Example Usage
The examples below use the addressbook application bundled with Squish, found at <path-to-squish>/examples/qt/addressbook/addressbook.
Execute a Test Case / Test Suite
You can ask the agent to run either a full test suite or an individual test case. The agent will automatically determine paths and execute the appropriate Squish commands.
[!tip] Example prompt Run all Squish tests for the addressbook
The agent will locate the relevant tests and execute all it can relate to the addressbook. It may ask for clarifications if needed.
Generate Test Cases
You can ask the agent to generate Squish test cases for your application under test (AUT).
[!tip] Example prompt Create a new test suite for the addressbook application
<path-to-squish>/examples/qt/addressbook/addressbook. Add a test to the suite that adds a contact in the addressbook and verifies its presence in the table.
The agent will create a test case and determine how to address individual objects (e.g. the add-button) in the application. It may reach out to the user, run intermediate test cases to programmatically scan the application's objects, or use existing test cases as reference.
If you already have Squish test cases available, you can reference them in the prompt to match the style and improve the quality of the generated test case.
Generate a BDD Test Case
Squish has its own implementation and structure for running BDD tests. Squish MCP is aware of this structure and can produce both feature files and step function implementations.
[!tip] Example prompt (assumes a generated test case from the prior steps) Convert the test case tst_add_contact into a BDD test
Squish MCP will create both test.py and test.feature files with proper BDD structure, including step definitions and feature file format.
<details> <summary>Generate Object Map (advanced)</summary>
The MCP server offers a tool to generate an object map from a given object snapshot, which needs to be prepared beforehand. It serves as a helper for the agent when generating test cases to produce correct object references, but can also be used directly. </details>
Configuration
SQUISH-RULES.yaml
For adding general "rules of thumb" for the LLM to follow, you can customize project-specific patterns and conventions:
memories:
requested_patterns:
- pattern: "user asks for a screenshot verification"
context: "Use the verify_image() function from global scripts"
- pattern: "BDD step function with variable input"
context: "Use |any| notation for variable parameters"
- pattern: "Any time you, the LLM/ the AI agent, aren't sure of what to do in a test script"
context: "Add a 'TODO: *' comment where you explain what needs to be done in a missing area."
You can use SQUISH-RULES.yaml.example for reference and create your own SQUISH-RULES.yaml in the src/squish_mcp/server/tools/analysis directory.
Environment variables
SQUISH_GLOBAL_SCRIPTS: Directory storing scripts available for all Squish test cases, see Squish documentation for more information.
High-Level Architecture Overview
<img src="squishmcp.png" width="708" height="549">
License
See the LICENSE file for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。