chapel-support

chapel-support

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

Category
访问服务器

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选