Tox Testing MCP Server
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Provides tools for executing Python tests within a project using tox and pytest. Supports running tests in various modes (all tests, specific test files, individual test cases, or directory-based tests) and different test groups.
Enables running and managing Python test suites using tox commands. Handles different test execution scenarios with configurable timeouts and provides targeted testing capabilities for Python projects.
Tox Testing MCP Server
An MCP server that executes tox commands to run python tests within a project using pytest. This server provides a convenient way to run and manage python tests through the Model Context Protocol (MCP).
Features
Tools
run_tox_tests
- Execute tox tests with various modes and options- Supports different execution modes:
all
: Run all tests or tests from a specific groupfile
: Run tests from a specific filecase
: Run a specific test casedirectory
: Run all tests in a specified directory
- Test groups supported:
clients
: Client-related testsapi
: API endpoint testsauth
: Authentication testsuploads
: Upload functionality testsroutes
: Route handler tests
- Supports different execution modes:
Development
Install dependencies:
Build the server:
For development with auto-rebuild:
Installation
To use with VSCode, add the server config to your MCP settings file at:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Configuration Options
env.TOX_TIMEOUT
: (Optional) Maximum time in seconds to wait for test execution to complete. If a test run takes longer than this timeout, it will be terminated. Default is 600 seconds (10 minutes)env.TOX_APP_DIR
: (Required) Directory containing the tox.ini file. This is where tox commands will be executed from. The path should point to the root of your Python project where tox.ini is located.
The timeout is particularly important for:
- Preventing hung test processes
- Managing long-running integration tests
- Ensuring CI/CD pipelines don't get stuck
Usage
The server provides a single tool run_tox_tests
that can be used in different modes:
Tool Arguments
Using with Cline
When using this MCP with Cline, you can configure Cline's Custom Instructions to handle test execution efficiently. Here's a recommended workflow:
This workflow ensures:
- Comprehensive test coverage by running all tests first
- Focused debugging by isolating failed test cases
- Verification of fixes by retesting individual cases
- Final validation by running all tests again
Example interactions with Cline:
Contributing
Please see CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
You must be authenticated.
An MCP server that executes tox commands to run Python tests within a project using pytest, allowing users to run all tests or specific test groups, files, cases, or directories.