Skip to main content
Glama
KasarLabs
by KasarLabs

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.

Related MCP server: ARBuilder

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.

Available Tools

1 tool
assist_with_cairoA

Provides assistance with Cairo and Starknet development tasks through AI-powered analysis.

Call this tool when the user's request involves writing, refactoring, implementing from scratch, or completing specific parts (like TODOs) of Cairo code or smart contracts.

The tool analyzes the query and context against Cairo/Starknet best practices and documentation, returning helpful information to generate accurate code or explanations.

This tool should also be called to get a better understanding of Starknet's ecosystem, features, and capacities.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe user's question regarding Cairo and Starknet development. Try to be as specific as possible for better results (e.g., 'Using OpenZeppelin to build an ERC20' rather than just 'ERC20').
codeSnippetsNoOptional: Code snippets for context. This will help the tool understand the user's intent and provide more accurate answers. Provide as much relevant code as possible to fit the user's request.
historyNoOptional: The preceding conversation history. This can help the tool understand the context of the discussion and provide more accurate answers.

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the tool's function ('AI-powered analysis') and output ('returning helpful information to generate accurate code or explanations'), which covers basic behavior. However, it lacks details on limitations, error handling, or performance characteristics (e.g., response time, accuracy constraints), which would be valuable for an AI agent to know when invoking this tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first. Each sentence adds value: the first defines the tool, the second provides usage guidelines, the third explains the analysis process, and the fourth adds an extra use case. While efficient, the final sentence could be integrated more seamlessly, and there's minor repetition (e.g., 'accurate' appears twice), preventing a perfect score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the tool (AI-powered analysis with 3 parameters) and the absence of both annotations and an output schema, the description is moderately complete. It covers purpose and usage well but lacks details on behavioral traits (e.g., how the AI analysis works, potential limitations) and output format. Without an output schema, the description should ideally hint at what the tool returns, but it only vaguely mentions 'helpful information,' leaving gaps for an AI agent to understand the full context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, meaning all parameters are well-documented in the input schema itself. The description does not add any additional meaning or context about the parameters beyond what the schema provides (e.g., it doesn't explain how 'query' interacts with 'codeSnippets' or 'history' in practice). According to the rules, when schema coverage is high (>80%), the baseline score is 3 even without parameter info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Provides assistance with Cairo and Starknet development tasks through AI-powered analysis.' It specifies the verb ('assists with') and resource ('Cairo and Starknet development tasks'), making it easy to understand what the tool does. However, since there are no sibling tools mentioned, it cannot differentiate from alternatives, preventing a perfect score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use the tool: 'Call this tool when the user's request involves **writing, refactoring, implementing from scratch, or completing specific parts (like TODOs)** of Cairo code or smart contracts.' It also includes additional use cases like understanding Starknet's ecosystem. This comprehensive guidance leaves no ambiguity about appropriate usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation5/5

With only one tool, there is no ambiguity or overlap between tools. The tool 'assist_with_cairo' has a clear and distinct purpose focused on Cairo and Starknet development assistance.

Naming Consistency5/5

Since there is only one tool, naming consistency is inherently perfect. The tool name 'assist_with_cairo' follows a clear verb_noun pattern and is descriptive of its function.

Tool Count2/5

A single tool is too few for a server named 'Cairo Coder' that aims to assist with development tasks. This suggests a thin surface that may not adequately cover the domain of Cairo/Starknet development, such as lacking separate tools for code analysis, debugging, or testing.

Completeness2/5

The tool set is severely incomplete for the apparent domain. While 'assist_with_cairo' covers general assistance, there are obvious gaps in CRUD/lifecycle coverage, such as no tools for compiling, deploying, testing, or managing contracts, which are essential for development workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • The OpenZeppelin Cairo Contracts MCP server generates secure smart contracts in the Cairo language for Starknet environments based on OpenZeppelin templates. It brings OpenZeppelin's proven security and style rules directly into AI-driven development workflows to create safe, production-ready contracts. Key capabilities include providing templates for ERC-20, ERC-721, ERC-1155, Multisig, Governor, and Vesting contracts.

  • Generate a typed SDK, CLI, and MCP server from any OpenAPI or GraphQL spec, and keep them current.

  • 7 agent tools (prune, convert, estimate, diff, patch, generate, validate). USDC on Base L2.

  • The OpenZeppelin Solidity Contracts MCP server integrates OpenZeppelin's security and style rules into AI-driven development workflows, enabling AI assistants to generate safe, correct, and production-ready smart contracts. It automatically validates generated code against OpenZeppelin standards (including imports, modifiers, naming conventions, and security checks) and supports various contract types including ERC-20, ERC-721, ERC-1155, Stablecoins, RWA, Governor, and Account contracts through prompt-driven workflows.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    AI-powered code generator for the Arbitrum ecosystem with 19 MCP tools. Generates Stylus smart contracts (Rust/WASM), SDK bridging code, full-stack dApps, and Orbit chain deployments using RAG-based retrieval over Arbitrum documentation.
    19
    24
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    AI-powered smart contract forge with an 8-agent adversarial security audit system. Generate, audit, fix, and compile Solidity and Anchor/Rust contracts across 8 chains.
    7
    69
    1
    MIT

Latest Blog Posts

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