Skip to content

MCP & Copilot Integration

Klondike integrates with GitHub Copilot CLI and provides an MCP (Model Context Protocol) server for AI agent tools.

GitHub Copilot Integration

Launch Copilot with Klondike Context

Start a Copilot session with full project context:

klondike copilot start

This launches Copilot CLI with:

  • Project status
  • Feature registry
  • Recent session history
  • Klondike instructions

Copilot Options

Option Description Example
--model AI model to use claude-sonnet, gpt-4
--resume Resume previous session Flag
--feature Focus on specific feature F001
--instructions Additional instructions "Focus on tests"
--allow-tools Limit available tools "read,write"
--dry-run Show command without executing Flag

Examples

# Start with specific model
klondike copilot start --model claude-sonnet

# Focus on a specific feature
klondike copilot start --feature F001

# Resume previous session
klondike copilot start --resume

# Preview command without running
klondike copilot start --dry-run

MCP Server

Klondike provides an MCP server that exposes project tools to AI agents.

Start the MCP Server

# Default: stdio transport
klondike mcp serve

# HTTP transport
klondike mcp serve --transport streamable-http

Install for VS Code

Configure VS Code to use the Klondike MCP server:

klondike mcp install

This updates your VS Code settings with the MCP server configuration.

Generate Config

Generate a configuration file for manual setup:

klondike mcp config --output mcp-config.json

Transport Options

Transport Use Case Command
stdio Local development, CLI klondike mcp serve
streamable-http Remote access, web-based tools klondike mcp serve --transport streamable-http

MCP Tools

The Klondike MCP server exposes these tools to AI agents:

Project Tools

Tool Description
klondike_status Get project status and feature summary
klondike_validate Validate artifact integrity

Feature Tools

Tool Description
klondike_feature_list List all features
klondike_feature_add Add a new feature
klondike_feature_start Start working on a feature
klondike_feature_verify Verify a completed feature
klondike_feature_block Block a feature
klondike_feature_show Show feature details

Session Tools

Tool Description
klondike_session_start Start a new session
klondike_session_end End the current session

Progress Tools

Tool Description
klondike_progress Regenerate progress file
klondike_report Generate stakeholder report

Integration Patterns

VS Code + Copilot

  1. Install Klondike MCP server:

    klondike mcp install
    

  2. Copilot Chat will have access to Klondike tools

  3. Use natural language:

  4. "What features are in progress?"
  5. "Start working on F001"
  6. "End my session with a summary"

Custom AI Agent

# Example: Using Klondike MCP with a custom agent
import subprocess
import json

def get_status():
    result = subprocess.run(
        ["klondike", "status", "--json"],
        capture_output=True,
        text=True
    )
    return json.loads(result.stdout)

def start_feature(feature_id):
    subprocess.run(["klondike", "feature", "start", feature_id])

# In your agent loop
status = get_status()
print(f"Project: {status['project_name']}")
print(f"Completion: {status['completion']}%")

CI/CD Integration

# GitHub Actions example
- name: Check Klondike Status
  run: |
    klondike validate
    klondike status

- name: Verify Features
  run: |
    # Verify all in-progress features have evidence
    klondike feature list --status verified --json > verified.json

Configuration

MCP Config File

The MCP config file (mcp-config.json) structure:

{
  "servers": {
    "klondike": {
      "command": "klondike",
      "args": ["mcp", "serve"],
      "transport": "stdio"
    }
  }
}

VS Code Settings

The MCP server is configured in VS Code settings:

{
  "mcp.servers": {
    "klondike": {
      "command": "klondike",
      "args": ["mcp", "serve"]
    }
  }
}

Troubleshooting

MCP Server Not Starting

  1. Verify Klondike is installed:

    klondike --help
    

  2. Check if you're in a Klondike project:

    klondike validate
    

  3. Test the server manually:

    klondike mcp serve
    

Copilot Not Finding Tools

  1. Restart VS Code after klondike mcp install
  2. Check MCP extension is enabled
  3. Verify config in settings:
    klondike mcp config