agentleFS
Microsoft AzureKnown publisherAzure/aks-mcp/.github/copilot-instructions.md

aks-mcp

Copilot instructions142 starsChanged 4 months agoMITView on GitHub

This file provides guidance to Github Copilot when working with code in this repository. AKS-MCP is a Model Context Protocol (MCP) server that enables AI assistants to interact with Azure Kubernetes Service (AKS) clusters. It serves as a bridge between AI tools and AKS, translating natural language requests into AKS operations. The codebase includes comprehensive unit tests: - Azure Client Tests: internal/azure/client_test.go - Resource Handler Tests: internal/azure/resourcehandlers/handlers_test.go - Security Validation Tests: internal/security/validator_test.go - Cache Tests: internal/azure/cache_test.go - Helper Tests: internal/azure/resourcehelpers/helpers_test.go

The file

We split this copilot-instructions.md into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create handler function in appropriate internal/azure/resourcehandlers/ file

    line 71
  2. Very specific:

    Add tool registration in internal/server/server.go

    line 73
  3. Very specific:

    All tools follow the ResourceHandler interface:

    line 77
  4. Distinctive:

    All Azure operations respect the configured access level

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions

This file provides guidance to Github Copilot when working with code in this repository.

Project Overview

AKS-MCP is a Model Context Protocol (MCP) server that enables AI assistants to interact with Azure Kubernetes Service (AKS) clusters. It serves as a bridge between AI tools and AKS, translating natural language requests into AKS operations.

Architecture

High-Level Structure

  • Entry Point: cmd/aks-mcp/main.go - Main application entry point
  • Core Server: internal/server/server.go - MCP server implementation with tool registration
  • Configuration: internal/config/ - Command line parsing and configuration management
  • Azure Integration: internal/azure/ - Azure SDK clients with caching layer
  • Resource Handlers: internal/azure/resourcehandlers/ - Handlers for Azure resource operations (VNet, NSG, Route Tables, Subnets)
  • Security: internal/security/ - Access level validation and security controls
  • Tools: internal/tools/ - MCP tool adapters and interfaces

Key Components

  • Access Levels: Three security levels (readonly, readwrite, admin) control available operations
  • Resource Caching: Azure resources are cached internally for performance
  • Transport Support: Supports stdio transport
  • Tool Registration: Tools are dynamically registered based on access level

Development Commands

Build

go build -o aks-mcp ./cmd/aks-mcp

Test

go test -v ./...                           # Run all tests
go test -race -coverprofile=coverage.txt -covermode=atomic ./...  # Run tests with coverage
go test -v ./internal/azure/...         # Run specific package tests

Lint

golangci-lint run                       # Run linter
golangci-lint run --timeout=5m          # Run with extended timeout

Configuration

Command Line Arguments

  • --timeout: Command execution timeout in seconds (default: 600)
  • --access-level: Access level (readonly, readwrite, admin)

Environment Variables

Standard Azure authentication variables are supported:

  • AZURE_TENANT_ID
  • AZURE_CLIENT_ID
  • AZURE_CLIENT_SECRET
  • AZURE_SUBSCRIPTION_ID

Testing Strategy

The codebase includes comprehensive unit tests:

  • Azure Client Tests: internal/azure/client_test.go
  • Resource Handler Tests: internal/azure/resourcehandlers/handlers_test.go
  • Security Validation Tests: internal/security/validator_test.go
  • Cache Tests: internal/azure/cache_test.go
  • Helper Tests: internal/azure/resourcehelpers/helpers_test.go

MCP Tool Development

Adding New Tools

  1. Create handler function in appropriate internal/azure/resourcehandlers/ file
  2. Register tool in internal/azure/resourcehandlers/registry.go
  3. Add tool registration in internal/server/server.go
  4. Implement security validation based on access level

Tool Handler Pattern

All tools follow the ResourceHandler interface:

type ResourceHandler interface {
    Handle(params map[string]interface{}, cfg *config.ConfigData) (string, error)
}

Security Considerations

  • Access levels control available operations
  • Input validation is performed through internal/security/validator.go
  • Azure credentials are managed through Azure SDK default authentication
  • All Azure operations respect the configured access level

Dependencies

  • Azure SDK: github.com/Azure/azure-sdk-for-go/sdk
  • MCP Go: github.com/mark3labs/mcp-go
  • Command Line: github.com/spf13/pflag
  • Shell Parsing: github.com/google/shlex

CI/CD

The project uses GitHub Actions for:

  • Linting: golangci-lint across multiple OS platforms
  • Testing: Unit tests with coverage reporting
  • Security: Gosec security scanning
  • Building: Go binary builds
  • Publishing: SLSA3 compliant releases

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.