Integrates with Astral's uv tool for package management and dependency installation, which is recommended for setting up the server environment.
Supports deployment in Docker containers with automatic configuration for Streamable-http transport mode, exposing the MCP server on port 8000.
Uses Pytest for analyzing Python code, providing tools for running tests on submitted code as part of the CI process.
Provides specialized tools for Python code analysis, including linting with pylint and static type checking with mypy and basedpyright.
Quack MCP Server
Quack is a continuous integration server built as an MCP server that automates code analysis and testing for Python code. It provides tools for linting and static type analysis of Python code.
Features
- Linting: Analyzes Python code for style, formatting, and code quality issues using pylint.
- Static Analysis: Performs static type checking using mypy to identify type errors.
- Asynchronous Processing: Jobs are processed asynchronously, allowing for concurrent analysis of multiple code submissions.
- Job Management: Track and retrieve results of submitted jobs.
Installation
- Clone the repository:
- Install dependencies:
First, install uv
from here
The Quack server requires the following dependencies:
Usage
Starting the Server
To start the Quack server with stdio transport (default):
For debug logging:
To start the server with streamable HTTP transport:
Alternatively, you can use the provided shell script:
Docker Container
The Quack server can be run in a Docker container, which automatically uses Streamable-http transport:
When running in a Docker container, the server automatically starts in Streamable-http mode on port 8000.
Using the MCP Tools
Quack exposes the following MCP tools:
submit_code
: Submit code for both linting and static analysis.submit_code_for_linting
: Submit code for linting only.submit_code_for_static_analysis
: Submit code for static analysis only.submit_code_for_basedpyright
: Submit code for basedpyright analysis only.get_job_results
: Get the results of a submitted job.list_jobs
: List all jobs and their status.
Setting Up Quack with Cline/Claude Code
Quack can be integrated with Cline to provide code analysis capabilities directly through the Cline interface.
Configuration Steps
- Configure Cline MCP SettingsThe Quack server can be configured in Cline's MCP settings file at:
For Local Stdio Mode (Default)
For Docker Container with Streamable Http
When running the server in a Docker container, configure Cline to connect via Streamable-http:Note: Replacelocalhost:8000
with the appropriate host and port if you've mapped the Docker container to a different port.
Usage Sample Image
Used with Zed Agent in Zed editor. Model used: Gemini 2.5 Flash
Using Quack with Cline
Once configured, you can use Cline to analyze Python code using the Quack server. Here are some example prompts:
- Analyze code for linting issues:
- Check code for type errors:
- Get comprehensive feedback:
Testing Architecture
Quack has two distinct testing concepts:
- Tests OF Quack: The tests in the
tests/
directory verify that the Quack server, job manager, and processors are working correctly. When you add a new processor, you should add tests here to verify your processor works. - Tests BY Quack: These are the analyses that Quack performs on submitted code. The lint processor and static analysis processor analyze Python code for issues. Your new processor will do the same on separate code submissions.
Directory Structure
When implementing a new processor (e.g., a test coverage processor):
- Create your processor in
quack/processors/
- Add tests for your processor in
tests/processors/
- Use code in
tests/examples/
to test what your processor analyzes
Running Tests
The repository includes a comprehensive test suite in the tests
directory. All tests are managed using pytest.
- Run all tests:
- Run a specific test file:
- Run tests for a specific processor:
- Run tests with verbose output and show test progress:
- Run tests and stop on the first failure:
Automatic Server Management
Many of the tests automatically start and stop the Quack server as needed, so you don't need to manually manage the server process during testing. This is handled by pytest fixtures in the conftest.py
file.
The server tests in tests/server/test_server_auto.py
demonstrate how to automatically start and stop the server for testing. These tests verify that:
- The server starts up correctly
- The server can process jobs
- The server shuts down properly
Sample Code for Testing
You can use the following sample code with intentional issues to test the Quack server:
How It Works
- When you ask Cline to analyze Python code, Cline will use the Quack MCP server
- The Quack server will process the code through its linting and static analysis tools
- The results will be returned to Cline, which will present them to you in a readable format
Troubleshooting
If Cline doesn't seem to be using the Quack server:
- Make sure the Quack server is properly configured in the MCP settings file
- Check that the path to the quack.py file is correct (for stdio mode)
- Verify the URL is correct and the server is running (for Streamable-http mode)
- Ensure all dependencies are installed
- Restart VSCode to reload the MCP settings
Docker-Specific Issues
When running in Docker:
- Port Mapping: Ensure the container's port 8000 is properly mapped to a host port:
- Network Access: If running Docker in a complex network environment, make sure the host can access the container's port.
- Container Logs: Check the container logs for any startup issues:
- Testing the Connection: You can test if the Streamable http endpoint is accessible:This should return a 404 response (since there's no root endpoint), but confirms the server is running.
Architecture
Quack is built using the Model Context Protocol (MCP) and consists of the following components:
- Server: The main MCP server that handles client connections and tool invocations.
- Job Manager: Manages the lifecycle of jobs, including submission, processing, and result retrieval.
- Processors: Specialized components that perform the actual code analysis:
- Lint Processor: Uses pylint to analyze code style and quality.
- Static Analysis Processor: Uses mypy to perform static type checking.
Development
Adding New Processors
To add a new processor:
- Create a new processor class in the
quack/processors
directory. - Implement the
process
method to perform the analysis. - Register the processor in the server.
- Add tests for your processor in
tests/processors/
.
Example: Adding a Test Coverage Processor
- Create
quack/processors/coverage.py
with your processor implementation - Add the processor to the server in
quack/server.py
- Create tests in
tests/processors/test_coverage_processor.py
- Test your processor with example code in
tests/examples/
Logs are written to both the console and logs/quack.log
.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A continuous integration server that automates Python code analysis, providing linting and static type checking tools for quality assurance.
Related MCP Servers
- -securityAlicense-qualityA server that enables AI assistants like Claude to safely run Python code and access websites, processing data for better AI understanding while providing helpful error messages.Last updated -2PythonGPL 3.0
- -securityAlicense-qualityAn interactive Python code execution environment that allows users and LLMs to safely execute Python code and install packages in isolated Docker containers.Last updated -14PythonApache 2.0
- -securityFlicense-qualityAn MCP server that analyzes Python codebases using AST, stores code elements in a vector database, and enables natural language queries about code structure and functionality using RAG with Google's Gemini models.Last updated -1Python
- AsecurityFlicenseAqualityA specialized server that provides advanced TypeScript code manipulation and analysis capabilities, enabling refactoring, navigation, diagnostics, and module analysis through Claude.Last updated -111,312203TypeScript