SuperAPIAI Directory

fastmcp-sonarqube-metrics

github.com · AI coding

Retrieve SonarQube project information: current and historical metrics, issues and health status.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Purpose: This project wraps the SonarQube API through the FastMCP (Fast Model Context Protocol) framework, allowing users to retrieve project quality data via message-style tool calls for reporting, analysis, and system integration.

Main capabilities (MCP tools): get_status health check; create_sonarqube_project creates a project (requires administrator privileges); delete_sonarqube_project deletes a project (requires administrator privileges, use with caution); list_projects lists accessible projects, filterable by name or key; get_sonarqube_metrics retrieves metrics such as bugs, vulnerabilities, code smells, coverage, and duplication density for a specified project; get_sonarqube_metrics_history retrieves historical metrics via /api/measures/search_history, supporting date filtering; get_sonarqube_component_tree_metrics retrieves metric values for all components (files or directories) within a project via /api/measures/component_tree, automatically handling pagination; get_project_issues retrieves project issues, filterable by type, severity, and resolution status, returning a maximum of 10 by default.

Usage: You need a SonarQube instance with API access and an API token, and install fastmcp, httpx, pydantic, python-dotenv. After cloning the repository, enter the directory, create a .env file, and set SONARQUBE_URL, SONARQUBE_TOKEN, TRANSPORT (stdio or sse), as well as optional GEMINI_API_KEY, GEMINI_MODEL, or AzureOpenAI-related variables. Run python server.py to start the server, and python client_test.py to test the client. You can also install it into Claude Desktop via fastmcp, or use SSE mode (port 8001) with MCP Inspector for debugging. The project also provides a Tkinter GUI client client_tool.py and a LangChain-based command-line client client_langchain.py.

Use cases: for developers, DevOps engineers, and analysts who need to integrate SonarQube metrics into workflows, generate regular code quality reports, monitor trends, or locate problematic components.

Limitations: the repository describes itself as work in progress, and some features may be incomplete; the built-in clients are for testing only, and the official recommendation is to use Claude Desktop or a self-built client; creating and deleting projects requires administrator privileges; some features depend on external LLM configuration.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools