You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MCP server exposes the analyzers to Claude, Cursor and other assistants. An assistant can analyze a file, look up a rule and apply its code fix without leaving the conversation.
65
+
The MCP server gives Claude Code, GitHub Copilot, Cursor and Codex the ALCops code fixes plus Microsoft's AL tooling. An assistant can compile, look up a rule and apply its code fix without leaving the conversation.
Copy file name to clipboardExpand all lines: content/docs/getting-started/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Run ALCops as part of your build to catch issues before they reach production:
25
25
26
26
### AI Tooling
27
27
28
-
-[MCP Server](ai-tooling/) — let AI assistants like Claude analyze your AL code through the Model Context Protocol
28
+
-[MCP Server](ai-tooling/) — give Claude Code, Copilot, Cursor and other assistants ALCops code fixes and Microsoft's AL tooling through the Model Context Protocol
Copy file name to clipboardExpand all lines: content/docs/getting-started/ai-tooling.md
+81-29Lines changed: 81 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,59 +5,111 @@ weight: 50
5
5
type: docs
6
6
---
7
7
8
-
The [ALCops MCP server](https://github.com/ALCops/mcp-server)brings AL code analysis to AI assistants through the [Model Context Protocol](https://modelcontextprotocol.io/). It lets Claude, Cursor, and other MCP-compatible clients analyze Business Central AL projects, browse rules, and apply code fixes — all without leaving the conversation.
8
+
The [ALCops MCP server](https://github.com/ALCops/mcp-server)gives AI assistants — Claude Code, GitHub Copilot, Cursor, Codex and any other [MCP](https://modelcontextprotocol.io/) client — the ALCops code fixes and rule lookup, and proxies Microsoft's own AL MCP server (`almcp`) so compiling, diagnostics, symbols, publishing and tests come through the same connection. One server entry in your client, everything an assistant needs to fix AL code.
9
9
10
-
## Install
10
+
## Prerequisites
11
+
12
+
-[.NET 10](https://dotnet.microsoft.com/download/dotnet/10.0) SDK or runtime.
13
+
- Microsoft BC Development Tools **v18.0 or later**. The recommended way to get them is the dotnet tool:
If you already have the [AL Language](https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al) VS Code extension, that install is optional — the server detects the extension's tools automatically.
20
+
21
+
v17 and earlier are not supported. The server checks the dotnet tool store before the AL extension, takes the newest version it finds there, and logs which directory it used; `--devtools-path` overrides the search. See [how the server finds the tools](https://github.com/ALCops/mcp-server#bc-devtools-resolution) for the full probe order.
22
+
23
+
## Install
13
24
14
25
```shell
15
26
dotnet tool install -g ALCops.Mcp
16
27
```
17
28
18
-
## Configuration
29
+
Upgrade later with `dotnet tool update -g ALCops.Mcp`.
19
30
20
-
Add the server to your MCP client configuration.
31
+
## Connect your assistant
21
32
22
-
```json
33
+
The server speaks MCP over stdio, so every client is a one-line entry.
34
+
35
+
{{< tabpane persist=false >}}
36
+
{{< tab header="Claude Code" lang="shell" >}}
37
+
claude mcp add --scope project alcops -- alcops-mcp
Claude Code writes the entry to `.mcp.json` in the project. VS Code reads `.vscode/mcp.json` — note that its top-level key is `servers`, not `mcpServers`. Cursor reads `.cursor/mcp.json` for a single project or `~/.cursor/mcp.json` globally, and Codex reads `~/.codex/config.toml`, which `codex mcp add alcops -- alcops-mcp` writes for you.
31
68
32
-
## Available Tools
69
+
Start the client from the folder that holds your AL project, or point the server at it with `--projects`. The server discovers `app.json` downward from the working directory, reads that project's `.vscode/settings.json`, and starts `almcp` with the same configuration.
33
70
34
-
The MCP server exposes 4 tools (~1,020 tokens of schema overhead):
71
+
## What the assistant gets
72
+
73
+
Four tools are served by ALCops itself:
35
74
36
75
| Tool | Description |
37
76
|------|-------------|
38
-
|`analyze`| Run analyzers on an AL project or file. Returns diagnostics with severity, location, and code fix availability. |
39
-
|`list_rules`| List all available analyzer rules with metadata (ID, title, severity, category, cop). |
40
-
|`get_fixes`| Get available code fixes for a specific diagnostic at a location. |
41
-
|`apply_fix`| Apply a code fix and return the modified source — does **not** write to disk. |
77
+
|`list_rules`| List analyzer rules with metadata (ID, title, severity, category, cop). |
78
+
|`get_fixes`| Get available code fixes for a diagnostic at a location. |
79
+
|`apply_fix`| Apply a code fix. Writes the fixed content to the file on disk. |
80
+
|`apply_fix_all`| Apply a fix to every occurrence of a rule across a project or file (like VS Code's "Fix all in workspace"). Writes to disk unless `dryRun` is set. |
81
+
82
+
Alongside them come Microsoft's `al_*` tools, proxied from `almcp`: `al_compile`, `al_build`, `al_getdiagnostics`, `al_symbolsearch`, `al_publish`, `al_run_tests`, translations, object IDs and more. The exact set depends on your installed BC Development Tools version; the [README](https://github.com/ALCops/mcp-server#proxied-from-microsofts-almcp) lists them all. If your client already registers `almcp` itself, start the server with `--no-proxy` so the `al_*` tools do not show up twice.
42
83
43
84
## Analyzers
44
85
45
-
The server always includes ALCops' six built-in analyzers. Additionally, it can load **BC standard analyzers** (`${CodeCop}`, `${UICop}`, `${PerTenantExtensionCop}`, `${AppSourceCop}`) and **third-party analyzers** — auto-discovered from `al.codeAnalyzers` in `.vscode/settings.json`, or passed explicitly via the `analyzers` tool parameter.
86
+
Nothing is bundled. The server loads exactly the analyzers your project configures in `.vscode/settings.json` — ALCops cops and BC's standard cops through `al.codeAnalyzers`, severities through `al.ruleSetPath`, symbols through `al.packageCachePath` — and passes the same configuration to `almcp`, so `al_compile` and `get_fixes` agree about which rules run and which are suppressed.
46
87
47
-
## BC Development Tools Resolution
88
+
```json
89
+
{
90
+
"al.codeAnalyzers": [
91
+
"${CodeCop}",
92
+
"${analyzerFolder}ALCops.LinterCop.dll"
93
+
]
94
+
}
95
+
```
48
96
49
-
The server needs Microsoft BC Development Tools at runtime (not bundled due to licensing). On startup it searches, in order:
97
+
The [VS Code](../vscode/#manual-setup-without-the-extension) page shows the full `al.codeAnalyzers` list, and [Configuration](../configuration/#ruleset-files-rulesetjson) covers rulesets and `alcops.json`.
50
98
51
-
1.`BCDEVELOPMENTTOOLSPATH` environment variable
52
-
2. AL Language VS Code extension
53
-
3. Local cache (`~/.alcops/cache/devtools/`)
54
-
4. .NET global tools cache
55
-
5. Auto-download from NuGet (first run only)
99
+
## Recommended agent workflow
56
100
57
-
Most developers have the AL Language extension installed, so **no extra setup is needed**.
101
+
Drop this into your `AGENTS.md` or `CLAUDE.md`so the assistant uses the tools in the right order:
58
102
59
-
## Other AI Integrations
103
+
```markdown
104
+
After changing AL code:
105
+
106
+
1. Run `al_compile` with `onlyErrors: false` and fix any errors.
107
+
2. For every ALCops warning (rule IDs like LC0020, AC0012, ...), call `get_fixes` at its
108
+
location and apply the fix with `apply_fix`; use `apply_fix_all` when the same rule
We are exploring additional integration paths for GitHub Copilot and other AI-assisted development tools. This page will be updated as new integrations become available.
113
+
{{% alert title="al_compile hides warnings by default" color="warning" %}}
114
+
`al_compile` defaults to `onlyErrors: true`, and nearly every ALCops rule is a *warning*. Pass `onlyErrors: false` or the assistant sees no cop diagnostics at all.
Copy file name to clipboardExpand all lines: content/docs/getting-started/quick-start.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,6 @@ Choose the approach that fits your workflow:
78
78
-**[VS Code](../vscode/)** — Install the extension and start getting diagnostics immediately (recommended for development)
79
79
-**[Command Line](../command-line/)** — Use `alc.exe` with analyzer DLLs directly
80
80
-**[CI/CD Pipelines](../cicd/)** — Run ALCops in GitHub Actions or Azure DevOps builds
81
-
-**[MCP Server](../ai-tooling/)** — Let AI assistants analyze your AL code through the Model Context Protocol
81
+
-**[MCP Server](../ai-tooling/)** — Give Claude Code, Copilot, Cursor and other assistants ALCops code fixes and Microsoft's AL tooling through the Model Context Protocol
82
82
83
83
Already using BusinessCentral.LinterCop? See [LinterCop Migration](../../lintercop-migration/) for a complete diagnostic mapping.
0 commit comments