mcp-quality-hub

v0.1.0
@amyisme13/mcp-quality-hub Checked 2 days ago Published 1 year ago

Bun-based MCP server exposing read-only GitLab, SonarQube, and DefectDojo tools.

Minimal MCP server scaffold using Bun exposing read-only GitLab, SonarQube, and DefectDojo tools. Transpile and bundle to dist/ for publishing: Use the MCP Inspector UI (recommended for development):

Summary extracted from the README.

@amyisme13/mcp-quality-hub

Minimal MCP server scaffold using Bun exposing read-only GitLab, SonarQube, and DefectDojo tools.

Install

bun install

Build

Transpile and bundle to dist/ for publishing:

bun run build

Run Inspector

Use the MCP Inspector UI (recommended for development):

bun run inspector

This opens the UI on http://localhost:6274 and runs the server via stdio.

Available Tools

  • search_repositories

    • Inputs: search (string), page (number, optional), per_page (number, optional)
    • Returns: { count, items[] } with basic project fields
  • list_directory

    • Inputs: project_id (string), path (string, optional; '' = root), ref (string, optional; default HEAD)
    • Returns: array of entries { name, type: 'blob'|'tree', path, mode }
  • get_file

    • Inputs: project_id (string), file_path (string), ref (string, optional; default HEAD)
    • Returns: file metadata and decoded UTF-8 content
  • resolve_project_keys

    • Inputs: project_id (string)
    • Behavior: verifies the repository exists, then tries master, release, and develop until it finds both Jenkinsfile and sonar-project.properties at repo root and extracts keys.
    • Returns: { sonar_project_key, defectdojo_project_key, alt_sonar_project_key } or one of:
      • Invalid project. GitLab project not found.
      • Invalid project. Missing Jenkinsfile and sonar-project.properties at repository root.
  • defectdojo_findings_by_tag

    • Inputs: tag (string; service tag, e.g., Jenkins imageName), page (number, optional), page_size (number, optional)
    • Behavior: returns active security findings linked to the given tag
    • Returns: { total, findings[] }
  • sonarqube_search_projects

    • Inputs: q (string, optional), page (number, optional), page_size (number, optional)
    • Returns: { total, projects[] } with project keys and names
  • sonarqube_find_issues

    • Inputs: project_key (string), page (number, optional), page_size (number, optional)
    • Behavior: returns issues that affect reliability and security (aligned with your Quality Gate)
    • Returns: { total, issues[] }
  • sonarqube_quality_gate_status

    • Inputs: project_key (string), branch (string, optional)
    • Returns: SonarQube quality gate status payload for the project
  • sonarqube_find_hotspots

    • Inputs: project (string), page (number, optional), page_size (number, optional)
    • Behavior: lists Security Hotspots in a project with pagination
    • Returns: { total, hotspots[] }

Configuration (mcp.json)

mcp.json configures how the Inspector runs the local server. Environment variables can be set under env:

{
  "mcpServers": {
    "local": {
      "type": "stdio",
      "command": "bun",
    "args": ["run", "src/index.ts"],
    "env": {
      "GITLAB_API_URL": "https://gitlab.com/api/v4",
      "GITLAB_PERSONAL_ACCESS_TOKEN": "",
      "SONARQUBE_URL": "http://localhost:9000",
      "SONARQUBE_TOKEN": "",
      "DEFECTDOJO_URL": "http://localhost:8080",
      "DEFECTDOJO_TOKEN": ""
    }
    }
  }
}

This project was created using bun init in bun v1.2.21. Bun is a fast all-in-one JavaScript runtime.

Publish (npm)

This package is Bun-first. To publish to npm:

# Verify package contents
bun publish --dry-run

# Publish (requires npm auth)
bun publish

The CLI entry is mcp-quality-hub.

Run via bunx (no install):

bunx mcp-quality-hub

Or after global install:

npm i -g @amyisme13/mcp-quality-hub
mcp-quality-hub