Skip to main content

MCP Integration

The Model Context Protocol (MCP) lets AI coding tools access your Octokraft data — health scores, analysis issues, architecture reviews, PR analyses — so they have full context about your codebase quality when helping you write code.

Supported Tools

ToolSupport
Claude CodeFull
CursorFull
WindsurfFull
Claude DesktopFull
Any MCP-compatible tool can connect to the Octokraft MCP server.

Setup

1. Create an API Key

Go to Settings > API Keys in your Octokraft project and create a new key. Give it a descriptive name like “MCP Server”. Copy the key immediately — it will not be shown again. See API Keys for details on key management.

2. Configure Your Tool

The Octokraft MCP server communicates over stdio and requires two environment variables:
  • OCTOKRAFT_API_KEY — Your API key from step 1
  • OCTOKRAFT_BASE_URL — Your Octokraft instance URL (defaults to https://api.octokraft.com)
Add to your MCP configuration (.mcp.json in your project root or ~/.claude/mcp.json globally):
{
  "mcpServers": {
    "octokraft": {
      "command": "octokraft-mcp",
      "env": {
        "OCTOKRAFT_API_KEY": "your-api-key",
        "OCTOKRAFT_BASE_URL": "https://api.octokraft.com"
      }
    }
  }
}
The octokraft-mcp binary is available from your Octokraft dashboard under Settings > Downloads, or as part of the self-hosted deployment package.

Available Tools

The Octokraft MCP server exposes 17 tools organized by domain.

Project

ToolDescription
list_projectsList all projects accessible with the current API key
get_projectGet details for a specific project

Code Health

ToolDescription
get_health_dashboardOverall health score with category breakdown and active drift alerts
get_health_categoriesAll 8 health categories with weights, scores, and baseline thresholds
get_health_assessmentDetails for a specific assessment
list_health_assessmentsAssessment history over time
list_drift_alertsQuality regressions detected between assessments

Analysis

ToolDescription
list_analysis_issuesAll detected issues, with optional filters by severity and category
get_issue_statsIssue counts grouped by category and severity
list_dismiss_rulesActive dismiss rules that suppress specific findings

Architecture

ToolDescription
get_architecture_overviewSummary of the latest architecture review, conventions, and ADRs
get_architecture_reviewLatest architecture review with scores across 4 dimensions
list_conventionsDetected coding conventions with conformance rates
list_adrsArchitecture decision records with lifecycle status

Pull Requests

ToolDescription
get_pr_analysisAnalysis results for a specific PR, including merge readiness and issues
list_pr_analysesPR analysis history
get_pr_statsAggregate PR analysis statistics

Example Usage

With the MCP server connected, your AI coding assistant can answer questions about your codebase using real data from Octokraft. You: “What is the current state of our code health? Are there any critical issues I should focus on?” Your AI assistant will call get_health_dashboard to retrieve the overall score and category breakdown, then list_analysis_issues filtered by critical severity to find the most important issues. The response includes specific file locations, issue descriptions, and which health categories are most affected. You: “I am about to refactor the authentication module. What conventions does the codebase follow for error handling?” Your AI assistant will call list_conventions to find error handling patterns detected in the codebase, and get_architecture_review for structural context about the module. This ensures the refactor follows established project patterns. You: “Show me the drift alerts from the last week. What is causing our health score to drop?” Your AI assistant will call list_drift_alerts to retrieve recent regressions, showing exactly which PRs introduced which issues and how they affected category scores.

Security

MCP access through the Octokraft server is read-only. API keys used for MCP cannot:
  • Modify project settings
  • Trigger analyses or assessments
  • Access raw source code
  • Delete or dismiss issues
  • Manage team members or permissions
The MCP server exposes only aggregated analysis results, scores, and metadata. Source code is never transmitted through the MCP interface.