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 β†’
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now β†’
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 47,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

Sowiedu/Edict MCP server](https://glama.ai/mcp/servers/sowiedu/edict/badges/score.svg)](https://glama.ai/mcp/servers/sowiedu/edict) πŸ“‡ 🏠 – Agent-first programming language: agents produce JSON AST, the compiler validates, type-checks, effect-checks,...

README.md

Edict

![CI](https://github.com/Sowiedu/Edict/actions/workflows/ci.yml) ![License: MIT](LICENSE) ![Node.js](https://nodejs.org) ![MCP](https://modelcontextprotocol.io/)

<a href="https://glama.ai/mcp/servers/Sowiedu/Edict"><img width="380" height="200" src="https://glama.ai/mcp/servers/Sowiedu/Edict/badge" /></a>

A programming language designed for AI agents. No parser. No syntax. Agents produce AST directly as JSON.

Edict is a statically-typed, effect-tracked programming language where the canonical program format is a JSON AST. It's purpose-built so AI agents can write, verify, and execute programs through a structured pipeline β€” no text parsing, no human-readable syntax, no ambiguity.

Agent (LLM)
  β”‚  produces JSON AST via MCP tool call
  ↓
Schema Validator ─── invalid? β†’ StructuredError β†’ Agent retries
  ↓
Name Resolver ────── undefined? β†’ StructuredError + candidates β†’ Agent retries
  ↓
Type Checker ─────── mismatch? β†’ StructuredError + expected type β†’ Agent retries
  ↓
Effect Checker ───── violation? β†’ StructuredError + propagation chain β†’ Agent retries
  ↓
Contract Verifier ── unproven? β†’ StructuredError + counterexample β†’ Agent retries
  (Z3/SMT)            ↓
                  Code Generator (pure-JS WASM encoder) β†’ WASM β†’ Execute

Features

  • JSON AST β€” Programs are JSON objects, not text files. No lexer, no parser.
  • Structured errors β€” Every error is a typed JSON object with enough context for an agent to self-repair.
  • Type system β€” Int, Float, String, Bool, Array<T>, Option<T>, Result<T,E>, records, enums, refinement types.
  • Effect tracking β€” Functions declare pure, reads, writes, io, fails. The compiler verifies consistency.
  • Contract verification β€” Pre/post conditions verified at compile time by Z3 (via SMT). Failing contracts return concrete counterexamples.
  • WASM compilation β€” Verified programs compile to WebAssembly via a pure-JS encoder and run in Node.js.
  • MCP interface β€” All tools exposed via Model Context Protocol for direct agent integration.
  • Schema migration β€” ASTs from older schema versions are auto-migrated. No breakage when the language evolves.

Execution Model

Edict compiles to WebAssembly and runs in a sandboxed VM. This is a deliberate security decision β€” not a limitation:

  • No ambient authority β€” compiled WASM cannot access the filesystem, network, or OS unless the host explicitly provides those capabilities via the pluggable EdictHostAdapter interface
  • Compile-time capability declaration β€” the effect system (io, reads, writes, fails) lets the host inspect what a program requires _before_ running it
  • Runtime enforcement β€” RunLimits controls execution timeout, memory ceiling, and filesystem sandboxing
  • Defense-in-depth β€” agent-generated code that runs immediately needs stronger isolation than human-reviewed code. The effect system + WASM sandbox + host adapter pattern provides exactly that

Host capabilities available through adapters: filesystem (sandboxed), HTTP, crypto (SHA-256, MD5, HMAC), environment variables, CLI arguments. New capabilities are added by extending EdictHostAdapter.

Quick Start

For AI Agents (MCP)

The fastest way to use Edict is through the MCP server β€” it exposes the entire compiler pipeline as tool calls:

npx edict-lang          # start MCP server (stdio transport, no install needed)

Or install locally:

npm install edict-lang
npx edict-lang          # start MCP server

Two calls to get started: edict_schema (learn the AST format) β†’ edict_check (submit a program). See MCP Tools for the full tool list.

For Development

npm install
npm test          # 2675 tests across 136 files
npm run mcp       # start MCP server (stdio transport)

Docker

Run the Edict MCP server in a container β€” no local Node.js required:

# stdio transport (default β€” for local MCP clients)
docker run -i ghcr.io/sowiedu/edict

# HTTP transport (for remote/networked MCP clients)
docker run -p 3000:3000 -e EDICT_TRANSPORT=http ghcr.io/sowiedu/edict

Supported platforms: linux/amd64, linux/arm64.

Browser

Run the Edict compiler entirely in the browser β€” no server required:

| Bundle | Size | Phases | Use case | |---|---|---|---| | edict-lang/browser | 318 KB | 1–3 (validate, resolve, typecheck, effects, lint, patch) | Lightweight checking | | edict-lang/browser-full | ~14 MB | 1–5 (+ WASM codegen, Z3 contracts, WASM execution) | Full compile & run |

import { compileBrowser, runBrowserDirect } from 'edict-lang/browser-full';

const result = compileBrowser(astJson);
if (result.ok) {
    const run = await runBrowserDirect(result.wasm);
    console.log(run.output);  // "Hello, World!"
}

Note: ESM modules require HTTP serving. Use npx serve . or any static server β€” file:// won't work.

See examples/browser/index.html for a working example.

QuickJS (Sandboxed Environments)

The Edict compiler also runs inside QuickJS WASM β€” useful for sandboxed runtimes, edge workers, or embedding in other WASM applications:

| Bundle | Size | Phases | Slowdown vs Node.js | |---|---|---|---| | dist/edict-quickjs-check.js | 373 KB | 1–3 (validate, resolve, typecheck, effects) | ~3.7x | | dist/edict-quickjs-full.js | 932 KB | 1–5 (check + WASM compile) | ~3.7x |

import { EdictQuickJS } from "edict-lang/quickjs";

const edict = await EdictQuickJS.createFull();  // phases 1-5
const result = edict.compile(ast);
if (result.ok) {
    console.log(result.wasm);  // Uint8Array of valid WASM
}
edict.dispose();

Note: quickjs-emscripten is an optional peer dependency β€” install it alongside edict-lang to use EdictQuickJS. For fs-free environments, pass bundleSource directly instead of loading from disk.

See docs/quickjs-feasibility-report.md for full benchmarks and recommendations.

MCP Tools

| Tool | Description | |---|---| | edict_schema | Returns the full AST JSON Schema β€” the spec for how to write programs | | edict_version | Returns compiler version and capability info | | edict_examples | Returns 41 example programs as JSON ASTs (includes schema snippet) | | edict_validate | Validates AST structure (field names, types, node kinds) | | edict_check | Full pipeline: validate β†’ resolve names β†’ type check β†’ effect check β†’ verify contracts | | edict_compile | Compiles a checked AST to WASM (returns base64-encoded binary) | | edict_run | Executes a compiled WASM binary, returns output and exit code | | edict_patch | Applies targeted AST patches by nodeId and re-checks | | edict_errors | Returns machine-readable catalog of all error types | | edict_lint | Runs non-blocking quality analysis and returns warnings | | edict_debug | Execution tracing and crash diagnostics | | edict_compose | Combines composable program fragments into a module | | edict_explain | Explains AST nodes, errors, or compiler behavior | | edict_export | Packages a program as a UASF portable skill | | edict_import_skill | Imports and executes a UASF skill package | | edict_generate_tests | Generates tests from Z3-verified contracts | | edict_replay | Records and replays deterministic execution traces | | edict_deploy | Compiles and deploys an Edict program to edge runtimes (Cloudflare Workers) | | edict_invoke | Invokes a deployed Edict WASM service via HTTP | | edict_invoke_skill | Invokes a UASF skill package directly | | edict_package | Packages a compiled program as a deployable skill bundle | | edict_support | Returns diagnostics and environment info for troubleshooting |

MCP Resources

| URI | Description | |---|---| | edict://schema | The full AST JSON Schema | | edict://schema/minimal | Minimal schema variant for token-efficient bootstrap | | edict://examples | All example programs | | edict://errors | Machine-readable error catalog | | edict://schema/patch | JSON Schema for the AST patch protocol | | edict://guide | Agent bootstrap guide for MCP-first onboarding | | edict://support | Diagnostics and environment info |

Example Program

A "Hello, World!" in Edict's JSON AST:

{
  "kind": "module",
  "id": "mod-hello-001",
  "name": "hello",
  "imports": [],
  "definitions": [
    {
      "kind": "fn",
      "id": "fn-main-001",
      "name": "main",
      "params": [],
      "effects": ["io"],
      "returnType": { "kind": "basic", "name": "Int" },
      "contracts": [],
      "body": [
        {
          "kind": "call",
          "id": "call-print-001",
          "fn": { "kind": "ident", "id": "ident-print-001", "name": "print" },
          "args": [
            { "kind": "literal", "id": "lit-msg-001", "value": "Hello, World!" }
          ]
        },
        { "kind": "literal", "id": "lit-ret-001", "value": 0 }
      ]
    }
  ]
}

The Agent Loop

The core design: an agent submits an AST β†’ the compiler validates it β†’ if wrong, returns a StructuredError with enough context for the agent to self-repair β†’ the agent fixes it β†’ resubmits.

// 1. Agent reads the schema to learn the AST format
const schema = edict_schema();

// 2. Agent writes a program (may contain errors)
const program = agentWritesProgram(schema);

// 3. Compile β€” returns structured errors or WASM
const result = edict_compile(program);

if (!result.ok) {
  // 4. Agent reads errors and fixes the program
  //    Errors include: nodeId, expected type, candidates, counterexamples
  const fixed = agentFixesProgram(program, result.errors);
  // 5. Resubmit
  return edict_compile(fixed);
}

// 6. Run the WASM
const output = edict_run(result.wasm);

Architecture

src/
β”œβ”€β”€ ast/           # TypeScript interfaces for every AST node
β”œβ”€β”€ validator/     # Schema validation (structural correctness)
β”œβ”€β”€ resolver/      # Name resolution (scope-aware, with Levenshtein suggestions)
β”œβ”€β”€ checker/       # Type checking (bidirectional, with unit types)
β”œβ”€β”€ effects/       # Effect checking (call-graph propagation)
β”œβ”€β”€ contracts/     # Contract verification (Z3/SMT integration)
β”œβ”€β”€ codegen/       # WASM code generation (pure-JS encoder)
β”‚   β”œβ”€β”€ codegen.ts       # IR β†’ WASM module orchestration
β”‚   β”œβ”€β”€ compile-ir-expr.ts  # IR expression compilation
β”‚   β”œβ”€β”€ compile-ir-*.ts  # Specialized IR compilers (calls, data, match, scalars)
β”‚   β”œβ”€β”€ runner.ts        # WASM execution (Node.js WebAssembly API)
β”‚   β”œβ”€β”€ host-adapter.ts  # EdictHostAdapter interface + platform adapters
β”‚   β”œβ”€β”€ closures.ts      # Closure capture and compilation
β”‚   β”œβ”€β”€ hof-generators.ts # Higher-order function WASM generators
β”‚   β”œβ”€β”€ wasm-encoder.ts  # Pure-JS WASM binary encoder (replaced binaryen)
β”‚   β”œβ”€β”€ wasm-interpreter.ts # Pure-JS WASM interpreter (no WebAssembly API needed)
β”‚   β”œβ”€β”€ recording-adapter.ts # Execution recording for replay
β”‚   β”œβ”€β”€ replay-adapter.ts  # Deterministic replay from recorded traces
β”‚   └── string-table.ts  # String interning for WASM memory
β”œβ”€β”€ ir/            # Mid-level IR (lowering, optimization)
β”œβ”€β”€ builtins/      # Builtin registry and domain-specific builtins
β”œβ”€β”€ compact/       # Compact AST format (token-efficient for agents)
β”œβ”€β”€ compose/       # Composable program fragments
β”œβ”€β”€ deploy/        # Edge deployment scaffolding (Cloudflare Workers)
β”œβ”€β”€ incremental/   # Incremental checking (dependency graph + diff)
β”œβ”€β”€ lint/          # Non-blocking quality warnings
β”œβ”€β”€ patch/         # Surgical AST patching by nodeId
β”œβ”€β”€ migration/     # Schema version migration (auto-upgrade older ASTs)
β”œβ”€β”€ skills/        # Skill packaging and invocation
β”œβ”€β”€ mcp/           # MCP server (tools + resources + prompts)
└── errors/        # Structured error types

tests/             # 2675 tests across 136 files
examples/          # 41 example programs (⭐→⭐⭐⭐ difficulty in README)
schema/            # Auto-generated JSON Schema

Type System

| Type | Example | |---|---| | Basic | Int, Int64, Float, String, Bool | | Array | Array<Int> | | Option | Option<String> | | Result | Result<String, String> | | Record | Point { x: Float, y: Float } | | Enum | Shape = Circle { radius: Float } \| Rectangle { w: Float, h: Float } | | Refinement | { i: Int \| i > 0 } β€” predicates verified by Z3 | | Function | (Int, Int) -> Int |

Effect System

Functions declare their effects. The compiler enforces:

  • A pure function cannot call an io function
  • Effects propagate through the call graph
  • Missing effects are detected and reported

Effects: pure, reads, writes, io, fails

Contract Verification

Pre/post conditions are verified at compile time using Z3:

{
  "kind": "post",
  "id": "post-001",
  "condition": {
    "kind": "binop", "id": "binop-001", "op": ">",
    "left": { "kind": "ident", "id": "ident-result-001", "name": "result" },
    "right": { "kind": "ident", "id": "ident-x-001", "name": "x" }
  }
}

Z3 either proves unsat (contract holds βœ…) or returns sat with a concrete counterexample the agent can reason about.

Contributing

We welcome contributions from agents and humans alike. See CONTRIBUTING.md for setup instructions, coding standards, and the PR workflow.

Looking for a place to start? Check issues labeled good first issue.

Roadmap

See ROADMAP.md for the full development plan, FEATURE_SPEC.md for the language specification, and Crystallized Intelligence for how agents store and reuse verified WASM skills.

Support

Edict is free and open source under the MIT license. If your agents find it valuable, consider sponsoring its development.

License

MIT

See related servers & alternatives β†’

Related MCP servers

Browse all β†’

Related guides

Hand-picked reading to help you choose and use Other servers.