Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables Claude to write, compile, and execute formal verification models in Alloy and read raw mathematical graph structures back into its context window.

README.md

Alloy MCP Server

A local Model Context Protocol (MCP) server that provides a headless bridge between Claude Desktop (or Roo Code) and the Alloy Analyzer (Kodkod SAT solver). This allows AI agents to write, compile, and execute formal verification models and read the raw mathematical graph structures directly back into their context window.

Features

  • Fast Syntax Checking: Validates Alloy grammar using file paths without booting the heavy SAT solver.
  • Asynchronous Execution & Timeouts: Handles highly complex models that take minutes or hours to solve. The server safely detaches background tasks to prevent LLM tool timeouts.
  • Context Window Protection: Automatically archives all discovered counterexamples locally to all_counterexamples.txt, but only returns the first 5 to the LLM to prevent token bloat.
  • Alloy 6 Temporal Support: Natively unpacks and formats behavioral traces (var signatures) step-by-step so the LLM can easily read state mutations over time.

Prerequisites

To run this server locally, you must have the following installed:

  • Node.js (v18 or higher)
  • Java Development Kit (JDK) (v11 or higher)
  • Claude Desktop App (or Roo Code inside VS Code)

Installation & Setup

  1. Clone the repository:
   git clone https://github.com/joel6603/alloy-mcp-server.git
   cd alloy-mcp-server
  1. Install Node dependencies:
   npm install
  1. Download the Alloy Engine:
  • Download the official Alloy 6 .jar file from AlloyTools.
  • Rename the file to org.alloytools.alloy.dist.jar.
  • Place it directly in the root folder of this project.
  1. Compile the Java Backend:
   # On Windows:
   javac -cp "org.alloytools.alloy.dist.jar;." RunAlloy.java

   # On Mac/Linux:
   javac -cp "org.alloytools.alloy.dist.jar:." RunAlloy.java

Connecting to Claude Desktop

Locate your Claude Desktop configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

Add the server to your configuration, ensuring the absolute path points to where you cloned this repository:

{
  "mcpServers": {
    "alloy": {
      "command": "node",
      "args": [
        "D:/path/to/your/repo/alloy-mcp-server/index.js"
      ]
    }
  }
}

Note: Restart Claude Desktop completely after saving this file.

Available MCP Tools

  • check_alloy_syntax
  • Input: filename (Absolute path to the .als file).
  • Description: Reads the file directly from the hard drive and instantly returns line/column syntax errors without triggering the Kodkod solver.
  • run_alloy_model
  • Input: filename (Absolute path) and an optional commandName (defaults to "all").
  • Description: Executes the SAT solver.
  • If execution is fast, it returns a maximum of 5 formatted counterexamples to the chat.
  • If execution exceeds 45 seconds, it returns a safe "Background Execution Started" message to the AI while continuing to run silently.
  • In all cases, every discovered solution (up to 200) is saved to all_counterexamples.txt in the server root for manual review.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use AI & ML servers.