Edict MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add edict-lang -- npx -y edict-lang
README.md

Agent-first programming language where agents produce JSON AST

Edict

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 systemInt, 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 enforcementRunLimits 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

Tools (2)

edict_schemaRetrieves the current AST schema format for program construction.
edict_checkSubmits a program AST for validation, type-checking, and contract verification.

Environment Variables

EDICT_TRANSPORTSets the transport protocol (e.g., http) for the MCP server.

Configuration

claude_desktop_config.json
{"mcpServers": {"edict": {"command": "npx", "args": ["-y", "edict-lang"]}}}

Try it

Use the edict_schema tool to show me the required JSON structure for a basic Edict program.
Write a program in Edict that performs a simple calculation and submit it using edict_check for verification.
Help me debug my Edict program by submitting it to the edict_check tool and explaining the structured error returned.

Frequently Asked Questions

What are the key features of Edict?

JSON AST-based programming with no text parsing required. Statically-typed system with refinement types and effect tracking. Contract verification using Z3/SMT solvers. WASM compilation for sandboxed, secure execution. Structured error reporting designed for agent self-repair.

What can I use Edict for?

Building self-correcting AI agents that write and verify their own code. Executing untrusted agent-generated code in a secure WASM sandbox. Automating complex logic pipelines with formal contract verification.

How do I install Edict?

Install Edict by running: npx edict-lang

What MCP clients work with Edict?

Edict works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Edict docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare