Skip to main content
Glama

Chapel Support for MCP

A Model-Context-Protocol (MCP) server for the Chapel programming language, providing tools for working with Chapel code, accessing primers and examples, and integrating Chapel functionality with AI assistants and other tools.

What is Chapel?

Chapel is an open-source parallel programming language designed for productive parallel computing at scale. It aims to improve the programmability of parallel computers while matching or beating the performance and portability of current programming models like MPI, OpenMP, and CUDA.

Related MCP server: Fortran Companion MCP Server

Features

This MCP server provides the following Chapel support functionality:

  • Chapel Primer Access: Browse and access Chapel's educational primer examples

  • Code Compilation: Compile Chapel code directly through the API

  • Linting: Check Chapel code for style and best practices using chplcheck and apply automatic fixes

  • Smart CHPL_HOME Detection: Automatically locate Chapel's installation directory

Prerequisites

  • Python 3.13 or higher

  • Chapel programming language installed (see Chapel installation guide)

  • (Optional) chplcheck for linting functionality

Installation

  1. Clone this repository:

    git clone <repository-url>
    cd chapel-support
  2. Create and activate a virtual environment with UV:

    uv venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Synchronize the environment with project dependencies:

    uv sync

Configuration

The MCP server needs to know the location of your Chapel installation (CHPL_HOME). It will try to find it in this order:

  1. From the CHPL_HOME environment variable

  2. From a .env file in the project root

  3. By running chpl --print-chpl-home if the Chapel compiler is in your PATH

To use a .env file, create one in the project root with:

CHPL_HOME=/path/to/your/chapel/installation

See .env.example for a template.

Usage

Running the MCP Server

uv run chapel-support.py

This will start the MCP server in stdio transport mode using your virtual environment.

Integrating with AI Assistants or Tools

To use this MCP server with AI assistants or other tools, configure them to connect to this server. For example, in a client configuration file:

{
  "context_servers": {
    "chapel-support": {
      "command": {
        "path": "uv",
        "args": [
          "run",
          "--directory",
          "/path/to/chapel-support",
          "chapel-support.py"
        ],
        "env": {}
      },
      "settings": {}
    }
  }
}

Note: Adjust the directory path to the location of your chapel-support installation.

Available Tools

list_primers()

Gets the list of available Chapel primers.

Returns: A list of paths to primer files relative to CHPL_HOME.

get_primer(path: str)

Retrieves the content of a specific Chapel primer.

Parameters:

  • path: The path to the primer, as returned by list_primers()

Returns: The content of the primer as a string.

compile_program(program_text: str, program_name: str = "program.chpl")

Compiles a Chapel program.

Parameters:

  • program_text: The Chapel code to compile

  • program_name: Optional name for the program file (default: "program.chpl")

Returns: A tuple containing:

  • Success status (boolean)

  • Compiler output/errors (string)

list_chapel_lint_rules()

Lists all available Chapel linting rules from chplcheck.

Returns: A list of dictionaries with rule information:

  • name: Rule name

  • description: Rule description

  • is_default: Whether the rule is enabled by default

lint_chapel_code(program_text: str, program_name: str = "program.chpl", fix: bool = False, custom_rules: Optional[List[str]] = None)

Lints Chapel code and optionally applies fixes.

Parameters:

  • program_text: The Chapel code to lint

  • program_name: Optional name for the program file (default: "program.chpl")

  • fix: Whether to apply automatic fixes (default: False)

  • custom_rules: List of specific rules to enable (default: None, uses default rules)

Returns: A dictionary containing:

  • warnings: String containing linting warnings

  • fixed_code: The fixed code if fix=True

  • error: Error message if something went wrong

  • stats: Statistics about the linting process

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

Available Tools

5 tools
compile_programD

Inputs: program_text (required), program_name.

get_primerA

Gets a primer at the given path. The path must be an element of the list returned by list_primers.

Inputs: path (required).

lint_chapel_codeA

Lints Chapel code using chplcheck and returns warnings and fixed code.

Args: program_text: The Chapel code to lint program_name: The name of the program file fix: Whether to apply automatic fixes to the code custom_rules: List of specific rules to enable (if None, uses default rules)

Returns: A dictionary containing linting results, which may include: - 'warnings': String containing linting warnings - 'fixed_code': The fixed code if fix=True - 'error': Error message if something went wrong - 'stats': Statistics about the linting process

Inputs: program_text (required), program_name, fix, custom_rules.

list_chapel_lint_rulesA

Lists all available Chapel linting rules from chplcheck.

Returns: A list of dictionaries, each containing: - 'name': The rule name - 'description': The rule description - 'is_default': Whether the rule is enabled by default

Inputs: no named parameters.

list_primersB

Gets the list of available Chapel primers.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct operation: compilation, primer retrieval, linting, and listing rules or primers. Even though compile_program lacks a description, its name clearly distinguishes it from the others.

    Naming Consistency4/5

    Tool names follow a consistent verb_noun pattern with underscores (e.g., compile_program, get_primer, list_primers). Minor inconsistency: lint_chapel_code and list_chapel_lint_rules include 'chapel' while others omit it, but overall pattern is clear.

    Tool Count5/5

    With 5 tools, the server is well-scoped for a Chapel support utility. Each tool serves a clear purpose without redundancy or excess.

    Completeness4/5

    The tool set covers core Chapel operations: compilation, linting, and educational primers. A minor gap is the lack of a run or debug tool, but for a support-focused server the surface is adequate.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    • Overleaf MCP server for ChatGPT, Claude and any AI agent: list projects, read file, edit file, compile project, add comment, reply to comment, accept tracked change and invite collaborator in your own Overleaf account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Overleaf yourself; Cotlet does not store your password and you need no Overleaf API key. About the official Overleaf API: Overleaf has no public API to read or change existing projects (checked 5 Nov 2026). Its only API, Open in Overleaf, sends LaTeX in one direction to create a new project. Setup and FAQ: https://cotlet.dev/integrations/overleaf-api-mcp-server

    • Trainual MCP server for ChatGPT, Claude and any AI agent: list subjects, get subject, create subject, add step, update step, publish subject, assign subject and list assignments in your own Trainual account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Trainual yourself; Cotlet does not store your password and you need no Trainual API key. About the official Trainual API: Trainual has a REST API and a read-only MCP server, but neither creates or edits training content (checked 28 Oct 2026). The API covers users, groups, responsibilities, assignments, completions, activities and webhooks, and it only views and searches published content. Setup and FAQ: https://cotlet.dev/integrations/trainual-api-mcp-server

    • Anaplan MCP server for ChatGPT, Claude and any AI agent: list models, list actions, upload import file, run import, run process, run export, get model history and add user in your own Anaplan account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Anaplan yourself; Cotlet does not store your password and you need no Anaplan API key. About the official Anaplan API: Yes. Anaplan has an official REST API, the Integration API v2.0, and an official MCP server, the Anaplan AI Gateway, but Anaplan's help says the AI Gateway gives external AI systems read-only access (checked 5 Nov 2026). Setup and FAQ: https://cotlet.dev/integrations/anaplan-api-mcp-server

      https://cotlet.dev/mcp/v1/anaplan
    • Procore MCP server for ChatGPT, Claude and any AI agent: list RFIs, create RFI, list submittals, create punch list item, create observation and add manpower entry in your own Procore account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Procore yourself; Cotlet does not store your password and you need no Procore API key. About the official Procore API: Procore has a REST API with OAuth 2.0 and a sandbox, but publishes no MCP server for your own AI agent (checked 5 Nov 2026). The API runs through an app that you register in the Developer Portal and a company admin installs. Setup and FAQ: https://cotlet.dev/integrations/procore-api-mcp-server

      https://cotlet.dev/mcp/v1/procore

    Related MCP Servers