Skip to main content

AI Script Generator - MCP Server

MCP Server for AL Parser that finds pages and fields for Business Central scenarios. This tool helps analyze Business Central AL objects and generate YAML test scenarios.

Features

  • 🔍 Find AL Pages: Search for pages with fields, actions, and repeaters
  • 📊 Find AL Tables: Analyze table structures with fields and extensions
  • 🎯 Find AL Enums: Locate enums with values and extensions
  • ⚙️ Find AL Codeunits: Search codeunits with procedures and fields
  • 📋 Read YAML Templates: Load and parse YAML template files
  • 🎯 Smart Search: Fuzzy matching for AL object names

Installation

From PyPI (recommended)

pip install aiscriptgenerator

From Source

git clone <repository-url>
cd AIScriptGenerator
pip install -e .

Usage

As MCP Server

  1. Configure MCP Client: Add to your mcp.json configuration:
{
  "servers": {
    "aiscriptgenerator": {
      "type": "stdio",
      "command": "python",
      "args": ["-m", "aiscriptgenerator"]
    }
  }
}
  1. Run MCP Server:
python -m aiscriptgenerator

Available MCP Tools

find_page_info_with_fields

Find information about AL pages with fields, actions, and repeaters.

find_page_info_with_fields(page_name="Sales Order")

find_table_info_with_fields

Find information about AL tables with fields, including extensions.

find_table_info_with_fields(table_name="Customer")

find_enum_info

Find information about AL enums with values and extensions.

find_enum_info(enum_name="Sales Document Type")

find_codeunit_info

Find information about AL codeunits with procedures and fields.

find_codeunit_info(codeunit_name="Sales-Post")

read_yaml_template

Read and parse YAML template files.

read_yaml_template()

Configuration

The server looks for AL files in the FoodFresh directory and caches the parsed information in al_cache.json. The cache is automatically rebuilt when AL files are modified.

Directory Structure

project/
├── src/aiscriptgenerator/
│   ├── __init__.py
│   ├── server.py          # MCP server implementation
│   ├── alparser.py        # AL file parser
│   └── extract_al.py      # AL object extractor
├── FoodFresh/             # AL source files
├── al_cache.json          # Parsed AL objects cache
├── mcp.json              # MCP server configuration
└── README.md

Development

Setup Development Environment

# Clone repository
git clone <repository-url>
cd AIScriptGenerator

# Install in development mode with dev dependencies
pip install -e .[dev]

# Run tests
pytest

# Format code
black src/

# Type checking
mypy src/

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=aiscriptgenerator

# Run specific test
pytest tests/test_server.py

Requirements

  • Python 3.8+
  • FastMCP 2.11.3+
  • MCP CLI 1.13.0+
  • PyYAML 6.0+
  • RapidFuzz 3.13.0+

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run tests and ensure they pass
  6. Submit a pull request

Troubleshooting

Cache Issues

If you're getting stale results, delete the cache file:

rm al_cache.json

MCP Connection Issues

Verify your MCP configuration:

# Test server directly
python -m aiscriptgenerator

# Check MCP configuration
cat mcp.json

AL File Path Issues

Ensure the FoodFresh directory contains your AL files and is accessible to the server.

Support

For issues, questions, or contributions, please open an issue in the repository.

Metadata

Release files for aiscriptgenerator-mcp 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiscriptgenerator-mcp 0.3.4
File Size Uploaded
aiscriptgenerator_mcp-0.3.4.tar.gz 26.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiscriptgenerator-mcp 0.3.4
File Interpreter ABI Platform
aiscriptgenerator_mcp-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 55.0 kB

Release files / aiscriptgenerator_mcp-0.3.4.tar.gz

Download URL aiscriptgenerator_mcp-0.3.4.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ad110baaf2fbfcc4f14f68452e0cba955f23678200a7d9f6f0199d88ac1b1ee4
BLAKE2b-256 checksum
How to use checksums
f0fa545be4d8a470c1fcff20ad6038fe6183039b988b91519ffa2b68b950a7ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.8

Release files / aiscriptgenerator_mcp-0.3.4-py3-none-any.whl

Download URL aiscriptgenerator_mcp-0.3.4-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58cbb14d29204746e4bb026c93a4952534f252430602ea52414f044ecfc64b28
BLAKE2b-256 checksum
How to use checksums
dcf6805c00a3e0becb5c20e3210c89deda582067b695e080f19c23289aca8f67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.8

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page