[ANN] Crystal MCP - An MCP Server for Crystal Tooling

Hi everyone,

I’d like to share a project I’ve been working on: Crystal MCP (v0.1.2).

It’s an implementation of the Model Context Protocol for Crystal. The goal is to let AI coding agents (like OpenCode or Claude) interact with Crystal’s existing tooling to better understand your code.

What it does

Instead of just reading text, this server uses the Crystal compiler and ecosystem tools to provide deeper context to the AI:

  • Macro Expansion: It can run crystal tool expand to show the AI exactly what code is being generated behind the scenes.
  • Implementations: It uses crystal tool implementations to find definitions.
  • Linting: It runs ameba to check for code issues.
  • Dependencies: It inspects shard.lock to see what libraries are installed.

Usage

It’s designed to work with any MCP-compliant client. For OpenCode:

  1. Install:

    git clone https://gitlab.com/renich/crystal-mcp.git
    cd crystal-mcp
    make install
    
  2. Configure:
    Add it to your ~/.config/opencode/opencode.json (or equivalent MCP settings):

    {
      "mcpServers": {
        "crystal": {
          "command": "/home/YOUR_USER/.local/bin/crystal-mcp",
          "args": []
        }
      }
    }
    

Repository

The code is available here:

It’s still early days (v0.1.2), so there are likely rough edges. If you find it useful or have suggestions for improvement, I’d appreciate the feedback.

Thanks!

Does crystal-mcp not support Windows? I checked the compilation and installation scripts, and they seem to only include Linux-related content. Do I need to compile it myself using crystal build on Windows?

I am sorry. It’s been years since I used it. I’d be the least prepared maintainer of that aspect of the MCP. If you figure it out, would you care to jump in as a maintainer?

I’m sorry, but I’ve just started learning Crystal and can’t be of much help.