home / mcp / cairo coder mcp server

Cairo Coder MCP Server

Provides an MCP server to assist Cairo and Starknet development by connecting to the Cairo Coder API or a local endpoint.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kasarlabs-cairo-coder-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@kasarlabs/cairo-coder-mcp"
      ],
      "env": {
        "CAIRO_CODER_API_KEY": "your-api-key",
        "CAIRO_CODER_API_ENDPOINT": "http://localhost:8000"
      }
    }
  }
}

You can run the Cairo Coder MCP Server to access Cairo and Starknet development assistance via the Cairo Coder API. It supports both a public API mode using your API key and a local/custom endpoint mode, giving you flexible ways to connect and build.

How to use

Start by choosing your connection mode. In public API mode you provide your Cairo Coder API key and connect through the MCP framework. In local mode you point to a local Cairo Coder API endpoint and run without an API key. Use the MCP client to configure how you connect and what you run locally.

How to install

Prerequisites: ensure you have Node.js version 18 or newer and npm or yarn installed.

# Install the Cairo Coder MCP via the standard runtime
npx -y @kasarlabs/cairo-coder-mcp

Configuration and usage notes

You can run the server in two modes. The first uses the public Cairo Coder API with an API key. The second uses a local/custom Cairo Coder API endpoint. The following configuration examples show how to set up the MCP client for each mode.

{
  "mcpServers": {
    "cairo_coder": {
      "command": "npx",
      "args": ["-y", "@kasarlabs/cairo-coder-mcp"],
      "env": {
        "CAIRO_CODER_API_KEY": "your-api-key-here"
      }
    },
    "cairo_coder_local": {
      "command": "npx",
      "args": ["-y", "@kasarlabs/cairo-coder-mcp"],
      "env": {
        "CAIRO_CODER_API_ENDPOINT": "http://localhost:8000"
      }
    }
  }
}

Additional notes about modes

Mode 1: Public Cairo Coder API (default) requires CAIRO_CODER_API_KEY. Start this MCP client configuration to connect to the official API and begin receiving Cairo/Starknet development assistance.

Mode 2: Local/Custom Endpoint switches to local mode when CAIRO_CODER_API_ENDPOINT is set. No API key is used in this mode. The MCP client will automatically operate in local mode when the endpoint is provided.

Security and environment considerations

Treat your API key as a secret. Do not commit CAIRO_CODER_API_KEY into version control. Use environment-specific configuration and secure storage for credentials.

Troubleshooting and tips

If you encounter connectivity issues, verify that the chosen mode has the correct environment variable set (API key or endpoint) and that the local endpoint is reachable from your network. Ensure you are using Node.js 18+ and the latest MCP runtime to avoid compatibility problems.

What you can do with the server

The Cairo Coder MCP Server enables you to Write Cairo code, Refactor code, Implement features, Learn Starknet, and get Best practices guidance focused on Cairo and Starknet development.

Available tools

assist_with_cairo

Get help with Cairo and Starknet development tasks by asking questions and receiving code suggestions, explanations, and optimization tips.