Cairo Coder

Cairo Coder

kasarlabs

Connects to the Cairo Coder API to provide expert assistance for Cairo and Starknet smart contract development. Helps generate contracts, refactor code, and provides contextual guidance based on Cairo/Starknet documentation.

Integrates with the Cairo Coder API to provide expert-level Cairo and Starknet development assistance, enabling smart contract generation, code refactoring, feature implementation, and contextual guidance based on Cairo/Starknet documentation and best practices.

14362 views6Local (stdio)

What it does

  • Generate Cairo smart contracts
  • Refactor existing Cairo code
  • Implement new features in Starknet projects
  • Provide Cairo/Starknet documentation guidance
  • Analyze Cairo code for best practices

Best for

Cairo smart contract developersStarknet blockchain projectsLearning Cairo programming languageCode reviews and optimization
Requires Cairo Coder API keyExpert-level Cairo assistanceBased on official documentation

About Cairo Coder

Cairo Coder is a community-built MCP server published by kasarlabs that provides AI assistants with tools and capabilities via the Model Context Protocol. Cairo Coder: Expert Cairo and Starknet development support, smart contract creation, and code refactoring via the Cairo It is categorized under developer tools.

How to install

You can install Cairo Coder in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Cairo Coder is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Cairo Coder MCP Logo

npm version npm downloads GitHub stars License: MIT

Cairo Coder MCP Server

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

⚠️ Repository Moved / Deprecated

This project now lives in the Ask Starknet monorepo

The npm package remains published here

This repo will not receive further updates.

Quick Start

Install via Claude Code

# Install Cairo Coder MCP
claude mcp add cairo-coder -e CAIRO_CODER_API_KEY=YOUR-API-KEY-HERE -- npx -y @kasarlabs/cairo-coder-mcp

Note: Replace YOUR-API-KEY-HERE with your actual API key from cairo-coder.com

Manual Usage

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.

Alternatives

Related Skills

Browse all skills
ui-design-system

UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.

18
scvi-tools

Deep learning for single-cell analysis using scvi-tools. This skill should be used when users need (1) data integration and batch correction with scVI/scANVI, (2) ATAC-seq analysis with PeakVI, (3) CITE-seq multi-modal analysis with totalVI, (4) multiome RNA+ATAC analysis with MultiVI, (5) spatial transcriptomics deconvolution with DestVI, (6) label transfer and reference mapping with scANVI/scArches, (7) RNA velocity with veloVI, or (8) any deep learning-based single-cell method. Triggers include mentions of scVI, scANVI, totalVI, PeakVI, MultiVI, DestVI, veloVI, sysVI, scArches, variational autoencoder, VAE, batch correction, data integration, multi-modal, CITE-seq, multiome, reference mapping, latent space.

6
ai-sdk

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

6
api-documenter

Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.

4
ruby-coder

This skill guides writing of new Ruby code following modern Ruby 3.x syntax, Sandi Metz's 4 Rules for Developers, and idiomatic Ruby best practices. Use when creating new Ruby files, writing Ruby methods, or refactoring Ruby code to ensure adherence to clarity, simplicity, and maintainability standards.

4
openai-knowledge

Use when working with the OpenAI API (Responses API) or OpenAI platform features (tools, streaming, Realtime API, auth, models, rate limits, MCP) and you need authoritative, up-to-date documentation (schemas, examples, limits, edge cases). Prefer the OpenAI Developer Documentation MCP server tools when available; otherwise guide the user to enable `openaiDeveloperDocs`.

4