mcp-server copilot-instructions.md

Project instructions for building, testing, and packaging ALCops, a .NET tool that analyzes Microsoft Business Central AL code.

In plain words
What is it for?
Use them when developing ALCops, running its tests, or packaging it as a .NET global tool.
Why use it?
They document the commands and local proprietary dependencies needed to compile and run the project.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/alcops/mcp-server/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/ALCops/mcp-server

Made for: GitHub Copilot.

Per session 994 This file is loaded in full into every session.
When invoked 994 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00994 $0.00994
Opus 5 $0.00497 $0.00497
Sonnet 5 $0.00199 $0.00199
Haiku 4.5 $0.00099 $0.00099

Measured 2d ago against content hash a102a2a88a2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp-server copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/copilot-instructions.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Copilot Instructions

Build

# Build (requires BC DevTools DLLs, see below)
dotnet build --configuration Release

# Run tests
dotnet test --configuration Release

# Pack as .NET global tool
dotnet pack src/ALCops.Mcp/ALCops.Mcp.csproj --configuration Release --output ./artifacts

There are no linters in this repository.

BC DevTools dependency

The project references proprietary Microsoft BC Development Tools DLLs (Microsoft.Dynamics.Nav.CodeAnalysis, .Workspaces, .Analyzers.Common). These are not bundled and must exist locally for compilation. The BcDevToolsDir MSBuild property (default: ../../Microsoft.Dynamics.BusinessCentral.Development.Tools) points to the directory containing a net8.0/ subfolder with these DLLs.

At runtime, BcDevToolsBootstrap resolves them automatically through a fallback chain: BCDEVELOPMENTTOOLSPATH env var → AL VS Code extension → NuGet cache → auto-download from NuGet.

Architecture

This is an MCP (Model Context Protocol) server packaged as a .NET 8 global tool (alcops-mcp). It exposes AL code analysis capabilities over stdio JSON-RPC.

Startup sequence (order matters)

  1. Program.cs calls BcDevToolsBootstrap.ResolveAndRegister() to find BC DevTools and register an AssemblyLoadContext resolver. This must happen before any BC types are JIT-compiled.
  2. McpHost.RunAsync() is marked [NoInlining] to enforce this ordering, then builds the host, registers DI services, and starts the MCP stdio transport.

Key layers

  • Tools/ — MCP tool endpoints. Each class is annotated with [McpServerToolType] and methods with [McpServerTool]. Tools are auto-discovered via WithToolsFromAssembly(). The five tools: analyze, list_rules, get_fixes, apply_fix, apply_fix_all.
  • Services/ — Core logic. Services are registered as singletons in McpHost.
    • ProjectSessionManager — Caches loaded AL project workspaces keyed by path. GetOrLoadProjectAsync is the main entry point tools use.
    • AnalyzerRegistry — Loads ALCops' 6 built-in cops at startup via reflection. Indexes analyzers, code fix providers, and diagnostic descriptors.
    • ProjectAnalyzerResolver — Merges built-in analyzers with external ones (BC standard cops like ${CodeCop}, third-party DLLs). Reads analyzer config from .vscode/settings.json (al.codeAnalyzers). Also loads rulesets from multiple sources (.vscode/settings.json, .AL-Go/settings.json, convention-named files).
    • ExternalAnalyzerLoader — Loads third-party analyzer DLLs into isolated AssemblyLoadContext instances.
    • ProjectLoader — Creates an AlProjectWorkspace from disk (reads app.json, enumerates .al files, resolves .alpackages).
  • Models/ — Simple record types for tool return values. Serialized with JsonDefaults.Options (camelCase, not indented).

Read the full file on GitHub · 58 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 58 lines · 994 tokens per session scan A a102a2a88a2e

Subscribe to this mod's changes

mcp-server copilot-instructions.md is an instructions file published in the GitHub repository ALCops/mcp-server (9 stars, last pushed 5d ago), licensed MIT. It adds 994 tokens to every session, about $0.0050 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.