npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

al-test-runner-mcp-server

v1.0.6

Published

MCP server for running AL tests in Business Central

Readme

AL Test Runner MCP Server

A Model Context Protocol (MCP) server that exposes AL test execution capabilities for Business Central development. This server allows AI agents and MCP clients to discover AL tests in source code and run them against Business Central environments.

Features

  • Test Discovery: Automatically scans AL workspace for test codeunits and methods
  • Test Execution: Runs AL tests via PowerShell and returns structured results
  • Configuration Management: Reads settings from .altestrunner/config.json and launch.json

Prerequisites

  • Node.js >= 18.0.0
  • PowerShell (Windows)
  • Business Central environment (local container or remote)
  • AL Test Runner VS Code extension PowerShell modules
  • Pre-configured .altestrunner.json with credentials

Installation

npm install al-test-runner-mcp-server

Configuration with MCP Clients

Add to your MCP client configuration (e.g., Claude Desktop):

{
  "mcpServers": {
    "al-test-runner": {
      "command": "npx",
      "args": ["[email protected]"]
    }
  }
}

Available Tools

1. discover_al_tests

Discovers all AL test codeunits and methods in a workspace.

Parameters:

  • workspacePath (string, required): Absolute path to the AL workspace directory

Example Request:

{
  "name": "discover_al_tests",
  "arguments": {
    "workspacePath": "C:\\Projects\\MyBCApp"
  }
}

Example Response:

{
  "success": true,
  "testCodeunitsFound": 5,
  "totalTestMethods": 42,
  "testCodeunits": [
    {
      "id": 50100,
      "name": "Sales Invoice Tests",
      "filePath": "C:\\Projects\\MyBCApp\\test\\SalesInvoiceTests.al",
      "methods": [
        {
          "name": "TestCreateSalesInvoice",
          "lineNumber": 15
        },
        {
          "name": "TestPostSalesInvoice",
          "lineNumber": 28
        }
      ]
    }
  ]
}

2. run_al_tests

Executes AL tests in Business Central and returns results.

Parameters:

  • workspacePath (string, required): Absolute path to the AL workspace directory
  • codeunitId (number, optional): ID of specific test codeunit to run
  • methodName (string, optional): Name of specific test method (requires codeunitId)
  • containerName (string, optional): Name of the Docker container to run tests against
  • userName (string, optional): Username for BC authentication
  • companyName (string, optional): Company name to run tests against

Example Request (Run All Tests):

{
  "name": "run_al_tests",
  "arguments": {
    "workspacePath": "C:\\Projects\\MyBCApp"
  }
}

Example Request (Run Specific Test):

{
  "name": "run_al_tests",
  "arguments": {
    "workspacePath": "C:\\Projects\\MyBCApp",
    "codeunitId": 50100,
    "methodName": "TestCreateSalesInvoice"
  }
}

Example Response:

{
  "success": true,
  "exitCode": 0,
  "stdout": "Running tests...\nTests completed.",
  "stderr": "",
  "results": {
    "total": 2,
    "passed": 2,
    "failed": 0,
    "skipped": 0,
    "duration": 1.234,
    "results": [
      {
        "codeunitId": 50100,
        "codeunitName": "Sales Invoice Tests",
        "methodName": "TestCreateSalesInvoice",
        "result": "Pass",
        "duration": 0.567
      },
      {
        "codeunitId": 50100,
        "codeunitName": "Sales Invoice Tests",
        "methodName": "TestPostSalesInvoice",
        "result": "Pass",
        "duration": 0.667
      }
    ]
  }
}

3. get_test_configuration

Retrieves the current test configuration from workspace files.

Parameters:

  • workspacePath (string, required): Absolute path to the AL workspace directory

Example Request:

{
  "name": "get_test_configuration",
  "arguments": {
    "workspacePath": "C:\\Projects\\MyBCApp"
  }
}

Example Response:

{
  "success": true,
  "alTestRunnerConfig": {
    "containerName": "bcserver",
    "userName": "admin",
    "password": "password"
    "companyName": "CRONUS International Ltd.",
  },
  "appJson": {
    "id": "12345678-1234-1234-1234-123456789012",
    "name": "My BC App",
    "version": "1.0.0.0"
  }
}

Configuration Files

.altestrunner.json

Required configuration file in your AL workspace:

{
  "containerName": "bcserver",
  "userName": "admin",
  "password": "password for NavUserPassword auth",
  "companyName": "Company Name to run tests in"
}

License

MIT

Author

James Pearson