Skip to main content
Glama

Cairo Coder

by KasarLabs

Cairo Coder MCP Server

A Model Context Protocol (MCP) server for Cairo and Starknet development assistance via the Cairo Coder API.

Quick Start

Use this MCP server directly with npx:

npx -y @kasarlabs/cairo-coder-mcp

Configuration

The server supports two modes of operation:

Mode 1: Public Cairo Coder API (Default)

Use the official Cairo Coder API with your API key.

Environment Variables:

  • CAIRO_CODER_API_KEY: Your Cairo Coder API key (required)

MCP Client Setup:

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

Mode 2: Local/Custom Endpoint

Use a local or custom Cairo Coder API endpoint (no API key required).

Environment Variables:

MCP Client Setup:

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

Note: When using CAIRO_CODER_API_ENDPOINT, the server automatically switches to local mode and no API key is required or used.

Available Tools

assist_with_cairo

Get help with Cairo and Starknet development tasks.

Parameters:

  • query (string, required): Your Cairo/Starknet development question
  • context (string, optional): Additional context or code snippets

Examples:

// Simple request { "query": "Write a simple Cairo contract that implements a counter" } // With context { "query": "How can I optimize this contract?", "context": "#[starknet::contract]\nmod Counter {\n // existing code here\n}" }

What You Can Do

  • Write Cairo code: Generate smart contracts and Cairo code
  • Refactor code: Improve and optimize existing code
  • Implement features: Complete TODOs and implement specific functionality
  • Learn Starknet: Get contextual information about the Starknet ecosystem
  • Best practices: Receive advice based on Cairo/Starknet documentation

Tips for Better Results

  • Use specific queries (e.g., "Using OpenZeppelin to build an ERC20" instead of just "ERC20")
  • Include relevant code snippets when working with existing code
  • Provide necessary context for more accurate responses

Development

Prerequisites

  • Node.js >= 18
  • npm or yarn

Local Installation

git clone <repository-url> cd cairo-coder-mcp npm install

Available Scripts

npm run build # Build the project npm run dev # Start in development mode npm start # Start in production mode

License

MIT

Support

For issues and questions:

Contributing

Contributions are welcome! Please check the contribution guidelines before submitting a PR.

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

The most powerful open-source Cairo code generator.

  1. Quick Start
    1. Configuration
      1. Mode 1: Public Cairo Coder API (Default)
      2. Mode 2: Local/Custom Endpoint
    2. Available Tools
      1. assist_with_cairo
    3. What You Can Do
      1. Tips for Better Results
        1. Development
          1. Prerequisites
          2. Local Installation
          3. Available Scripts
        2. License
          1. Support
            1. Contributing

              Related MCP Servers

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/KasarLabs/cairo-coder-mcp'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server