Skip to content

Compiler access for agents

Tell your agent to read SKILL.md, then give it access to the installed compiler. The skill describes the language; compiler diagnostics decide whether a particular program checks.

Install Chelis through Get started. For a standalone program, save the first worked lesson as app.ch in an empty folder. Run:

Terminal window
chelis fmt --inplace app.ch
chelis check app.ch
chelis eval --file app.ch --json

check writes a JSON report to stdout. A successful check has an empty errors array and a score of 1. On failure, inspect each diagnostic's kind, message, and suggestions. Use source locations when present; some errors have none. Read the exit status as well as the report. Warnings and command failures can appear on stderr.

eval --json returns named values in roots. Tensor values carry a shape, element dtype, and hexadecimal element bits. A file containing only function definitions has no evaluated roots: supply inputs and call a function, as the worked lesson does.

Reformat after editing and check again. A clean type check establishes the language's typing rules; it does not establish that the numerical answer is the one you intended. Compare results with known cases, and use property checks for stated requirements.

Keep the compiler pin in reef.toml. From the project directory, run chelis reef setup, then chelis reef build. Setup installs dependencies recorded in the lockfile; build resolves declared dependencies and checks the package. You do not need a source checkout of each library. The Reef guide explains the manifest and installation commands.

The compiler release tested here, 0.19.1, accepts standard MCP stdio requests. A client that uses an mcpServers configuration can launch it with the following entry. Use the chelis shim installed by chelisup; it must be on the client's PATH.

{
  "mcpServers": {
    "chelis": {
      "command": "chelis",
      "args": [
        "+0.19.1",
        "tide",
        "mcp"
      ]
    }
  }
}

The explicit version selects this toolchain even if the client starts inside a project pinned to another compiler. Install it first with chelisup install 0.19.1. Check that this version supports the project before passing that project's source to it.

A working MCP connection completes initialization, discovers tools, and calls chelis_check with these arguments:

{
"source_kind": "surf",
"source": "value = 2.0f32 + 3.0f32\n"
}

Expect isError: false and structuredContent.ok: true. Read the tool's structured diagnostics when isError is true. An empty response or an initialization timeout is a connection failure, not a clean program.

MCP sends one UTF-8 JSON-RPC message per line. Keep server stdout reserved for protocol messages and send logs to stderr. See the MCP stdio transport specification for the client-side requirements.