This project provides a FastAPI-based MCP (Machine Control Protocol) server for interacting with SonarQube. It allows tools like Qwen, Cursor, and Claude to access SonarQube data through MCP protocol.
- Get all projects from SonarQube
- Retrieve coverage metrics for projects
- Get duplication rates
- Access project issues
- Obtain uncovered lines information
- Health check endpoint
Fauzi Fadhlurrohman
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables in
.env
file - Run the server:
python mcp_server.py
The project includes multiple Docker Compose configurations:
-
Development (default):
docker-compose up docker-compose down
-
Production:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d docker-compose -f docker-compose.yml -f docker-compose.prod.yml down
-
MCP Server:
docker-compose -f docker-compose.mcp.yml up -d docker-compose -f docker-compose.mcp.yml down
To use this server with AI tools like Qwen, Cursor, or Claude, configure the MCP settings as follows:
{
"sonarqube-mcp": {
"command": "docker-compose",
"args": [
"-f",
"docker-compose.mcp.yml",
"exec",
"-T",
"sonarqube-mcp",
"python",
"mcp_server.py"
],
"cwd": "H:\\fauzi\\project\\sonarqube-fastapi-mcp"
}
}
The server implements MCP protocol and can be used with compatible AI tools like Qwen, Cursor, and Claude.