chapel-support

chapel-support

Enables AI assistants to work with Chapel code, including compiling, linting, and accessing educational primers.

Category
Visit Server

README

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.

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured