Skip to main content

🔌 MCP Integration: GitHub Copilot & Claude Desktop

What is MCP Integration?

MCP (Model Context Protocol) is an open protocol that allows AI assistants like GitHub Copilot or Claude Desktop to connect to external knowledge sources.

With MCP integration, you can:

  • Use Alex directly in VS Code (via GitHub Copilot)
  • Use Alex directly in Claude Desktop
  • Access Business Central AL knowledge without leaving your editor
  • Compare Business Central versions (BC 26 vs 27, etc.)
Why use MCP?

Instead of switching between VS Code and the Alex web interface, you ask your questions directly in your code editor or in Claude Desktop. Alex responds instantly with accurate information about Business Central AL.

Compatible Assistants

GitHub Copilot (VS Code)

GitHub Copilot is the AI assistant integrated into Visual Studio Code. With MCP integration:

  • Open Copilot Chat in VS Code
  • Use Alex tools: #mcp_alex_alex_al_query or #mcp_alex_alex_al_comparison
  • Ask your questions about Business Central AL
  • Alex responds directly in the chat

Example:

Use #mcp_alex_alex_al_query to ask: How do I create a table extension in AL?

Claude Desktop

Claude Desktop is Claude AI's desktop application. With MCP integration:

  • Open Claude Desktop
  • Authorize Alex tools (see "Usage" section below)
  • Ask your questions normally in the conversation
  • Claude automatically uses Alex to answer Business Central questions

Example:

Explain the differences in table Customer between BC versions 26 and 27

Installation

Prerequisites

  • Node.js 18 or higher installed on your computer
  • An active Alex account with available credits
  • GitHub Copilot (VS Code) or Claude Desktop installed

Windows (PowerShell)

  1. Clone the repository (https://github.com/pmoisontech/Alex-MCP-Proxy) or download the code:

    git clone https://github.com/pmoisontech/Alex-MCP-Proxy.git
    cd Alex-MCP-Proxy/mcp-server-proxy
  2. Run the installer:

    .\install-mcp.ps1
  3. Follow the instructions:

    • Enter the Alex backend URL (default: https://alex.app.pmats.ai/api)
    • Enter your Alex username
    • Enter your Alex password
    • Choose VS Code and/or Claude Desktop
  4. Restart your assistant:

    • VS Code: Close and relaunch VS Code completely
    • Claude Desktop: Close all windows and relaunch Claude

Linux / macOS / WSL

  1. Clone the repository (https://github.com/pmoisontech/Alex-MCP-Proxy) or download the code:

    git clone https://github.com/pmoisontech/Alex-MCP-Proxy.git
    cd Alex-MCP-Proxy/mcp-server-proxy
  2. Run the installer:

    ./install-mcp.sh
  3. Follow the instructions:

    • Enter the Alex backend URL (default: https://alex.app.pmats.ai/api)
    • Enter your Alex username
    • Enter your Alex password
    • Choose VS Code and/or Claude Desktop
  4. Restart your assistant:

    • VS Code: Close and relaunch VS Code completely
    • Claude Desktop: Close all windows and relaunch Claude
API Key Generation

The installer will automatically create an API key for your Alex account. This key is valid for 3 months by default and allows the MCP proxy to authenticate with Alex.

Manual Installation

If you prefer to configure manually, consult the MCP Proxy README for detailed instructions.

Usage

With GitHub Copilot (VS Code)

  1. Open VS Code and start an AL project
  2. Open Copilot Chat (chat icon in the sidebar)
  3. Use Alex tools:

For general AL questions:

Use #mcp_alex_alex_al_query to ask: How does the Customer table work in Business Central?

To compare versions:

Use #mcp_alex_alex_al_comparison to ask: What changed in table Sales Header between BC 26 and BC 27?
Shortcut

Type #mcp to see all available MCP tools. Select #mcp_alex_alex_al_query or #mcp_alex_alex_al_comparison from the list.

With Claude Desktop

  1. Open Claude Desktop
  2. Open Settings → All connectors
  3. Find "alex" with 2 tools (alex_al_query, alex_al_comparison)
  4. Authorize the tools:
    • Click on the "Blocked" dropdown
    • Select "Always allow"
    • Both tools should display ✅ (authorized)
  5. Ask your questions normally in the conversation

Claude will automatically detect when to use Alex to answer Business Central questions.

Example questions:

  • "How do I create a table extension in AL?"
  • "Show me an example of a codeunit that posts a sales order"
  • "What's new in the Sales Order page in BC 27?"
  • "Compare the Item table between versions 26 and 27"

Available Tools

alex_al_query

✅ Default tool for all Business Central AL questions (except version comparisons).

Uses:

  • Information about AL syntax, objects, patterns
  • AL code troubleshooting
  • Business Central best practices
  • Code examples for specific features
  • Structure of tables, pages, codeunits

Examples:

  • "How do I create a table extension in AL?"
  • "What's the syntax for posting a sales order in AL?"
  • "Show me examples of using RecordRef in Business Central"
  • "How to implement OnValidate trigger in AL?"

alex_al_comparison

⚠️ Use ONLY to compare Business Central versions (BC 26 vs 27, etc.).

Uses:

  • Compare AL code between two BC versions
  • Identify breaking changes
  • Discover new features in a version
  • Track deprecated or obsolete AL objects
  • Analyze API changes between versions

Examples:

  • "What changed in the Sales Header table between BC 26 and BC 27?"
  • "Compare the Item table between version 25 and 26"
  • "Show me breaking changes in Codeunit 80 from BC 24 to BC 25"
  • "What's new in the Sales Invoice page between version 26 and 27?"

Supported versions: BC 14 to 28 and later. Format:

  • Major version: "BC 26" (uses latest available minor version)
  • Full version: "BC 26.5" or "BC 26.5.0.0"

Updating the Proxy

If the MCP proxy has been updated (new features, bug fixes):

  1. Update the code:

    cd Alex-MCP-Proxy/mcp-server-proxy
    git pull origin main
    npm install
  2. Restart your assistant:

    • VS Code: Close and relaunch completely
    • Claude Desktop: Close all windows and relaunch
Major Changes

For major updates with configuration changes, run the installer again (./install-mcp.sh or .\install-mcp.ps1). Your existing settings (API key, etc.) will be preserved.

Troubleshooting

Alex doesn't appear in GitHub Copilot

Solutions:

  1. Check that the mcp.json file is in the correct location:
    • Windows: %APPDATA%\Code\User\mcp.json
    • Linux/macOS: ~/.config/Code/User/mcp.json
  2. Verify the path to mcp-proxy-client.js is absolute (not relative)
  3. Completely restart VS Code
  4. Check that your API key is correct in the file

Alex doesn't appear in Claude Desktop

Solutions:

  1. Check the configuration file:
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux/macOS: ~/.config/Claude/claude_desktop_config.json
  2. Close all windows of Claude Desktop and relaunch
  3. Check the connectors icon at the bottom right of Claude
  4. Consult the logs: %APPDATA%\Claude\logs\ (Windows)

Tools blocked in Claude Desktop

Alex tools appear but are marked "Blocked" (🚫):

Solution:

  1. Open Settings → All connectors
  2. Find "alex" in the list
  3. Click on the "Blocked" dropdown
  4. Select "Always allow"
  5. Tools should now display ✅

"401 Unauthorized" error

Your API key is invalid or expired.

Solution:

  1. Log in to the Alex web interface
  2. Go to Settings → API Keys
  3. Create a new API key
  4. Replace the key in your configuration file (ALEX_API_KEY variable)

Alex doesn't respond

Solutions:

  1. Check your internet connection
  2. Verify the backend URL is https://alex.app.pmats.ai/api
  3. Verify you have available credits on your Alex account
  4. Wait a few seconds (the first response may take a moment)

Security and Privacy

  • Your API key is personal and confidential - never share it
  • The connection to Alex backend uses HTTPS (encrypted)
  • Your questions and code are not stored permanently
  • Each user has an isolated account
API Key Sharing

NEVER share your API key. If you think it has been compromised, revoke it immediately in your settings and create a new one.

Support

If you encounter a problem not covered in this documentation:

  1. Verify Node.js is installed (node --version should display ≥18)
  2. Verify your configuration files are valid JSON
  3. Try the automatic installer if you configured manually
  4. Consult GitHub issues
  5. Contact support with a precise description of the error

Learn More