Edict Lang
@Sowiedu
About Edict Lang
Agent-first programming language designed exclusively for AI agents. Programs are JSON ASTs — no text syntax, no parser. The compiler validates structure, resolves names, checks types and effects, verifies contracts via Z3/SMT, and compiles to WebAssembly. 19 MCP tools cover the
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"edict": {
"command": "npx",
"args": [
"-y",
"edict-lang"
]
}
}
}Tools
22Return the JSON Schema defining valid Edict AST programs. Use format 'agent' for one-call bootstrapping (minimal schema + compact maps + builtins + effects).
Validate an Edict AST against the compiler's JSON schema without typing or compiling. Use this as a first pass.
Run the full semantic checker (name resolution, type checking, effect checking, contract verification) on an AST. Supports single module (ast) or multi-module (modules array) input.
Compile a semantically valid Edict AST into a WebAssembly module. Returns the WASM binary encoded as a base64 string. Supports single module (ast) or multi-module (modules array) input.
Execute a compiled WebAssembly module (provided as base64) in a sandboxed runtime. The WASM VM has no ambient authority — filesystem, network, and crypto access are provided exclusively through host adapters. Returns standard output, exit code, and any sandbox limit errors. Supports optional execution limits (timeout, memory, sandbox directory) and external WASM modules for import interop. Set record: true to capture all non-deterministic host responses in a replay token for deterministic reproduction.
Apply surgical patches to an Edict AST by nodeId, then run the full check pipeline. Use this to fix errors without resubmitting the entire AST. Each patch specifies a nodeId, an operation (replace/delete/insert), and the relevant field/value.
Run non-blocking lint analysis on an Edict AST. Returns quality warnings (unused variables, missing contracts, oversized functions, redundant effects, etc.) without blocking compilation. Warnings use the same structured format as errors but with severity: 'warning'.
Compose multiple Edict program fragments into a single module. Fragments declare what they provide and require, enabling independent validation and incremental program generation.
Execute an Edict program with debug instrumentation. Compiles the AST with call-stack tracing, runs it, and returns structured crash diagnostics including call stack at crash time, crash location with nodeId, and step count. Use this instead of edict_compile + edict_run when debugging runtime failures — the crash location and call stack enable targeted fixes without guessing.
Export an Edict AST as a portable WASM skill package with validation and manifest generation.
Import and execute a compiled Edict WASM skill package, validating its checksum.
Package a compiled Edict module + WASM binary into a portable SkillPackage. Input: the module AST (same one sent to edict_compile) + the base64 WASM string returned by edict_compile. Output: a SkillPackage JSON with interface metadata, verification info, integrity checksum, and the embedded WASM.
Execute a packaged Edict skill — load WASM from a SkillPackage, verify integrity checksum, and run it. Returns structured output with exit code and return value.
Auto-generate structured test cases from Z3-verified contracts. For proven contracts, extracts boundary input values and expected outputs from Z3 models. For failing contracts, extracts counterexample inputs as regression tests. Returns an array of GeneratedTest objects — each with function name, input values, expected output, and source (boundary/counterexample). Use this to get free tests from formal specifications without writing them manually.
Given a structured error, returns enriched repair context: pipeline stage, field metadata, example ASTs, and repair strategy.
Re-execute a WASM module using a previously recorded replay token for deterministic reproduction of runtime behavior. All non-deterministic host responses (random values, timestamps, HTTP responses, file IO) are replayed from the token instead of calling real host functions. Use this to reproduce exact failures or verify fixes against known execution traces.
Returns structured sponsorship and support information for the Edict project
Deploy an Edict program to a target. Runs the full pipeline (validate → check → compile) then packages for the specified target. Targets: 'wasm_binary' (returns WASM + metadata), 'cloudflare' (generates Worker bundle).
Invoke a deployed Edict WASM service via HTTP. Sends a request to the given URL with optional input and returns the structured result. Completes the deploy → invoke round-trip.
Overview
What is Edict Lang?
Edict Lang is a statically-typed, effect-tracked programming language purpose-built for AI agents. Its canonical program format is a JSON AST—no text parsing, no human-readable syntax. The language integrates with the Model Context Protocol (MCP) to provide a structured compiler pipeline (validation, type checking, effect tracking, contract verification with Z3, and WebAssembly compilation) directly as tool calls for agents.
How to use Edict Lang?
The fastest way is to start the MCP server via npx edict-lang (no install needed) or install the package locally. Agents then interact through MCP tools such as edict_schema (to learn the AST format) and edict_check (to submit a program). The compiler can also be used in the browser or inside QuickJS for sandboxed environments.
Key features of Edict Lang
- Programs are JSON objects—no lexer or parser required.
- Structured errors returned as typed JSON with self-repair context.
- Rich type system including refinement types,
Option, andResult. - Effect tracking: functions declare
pure,reads,writes,io,fails. - Compile-time contract verification via Z3/SMT with concrete counterexamples.
- Verified programs compile to WebAssembly for sandboxed execution.
Use cases of Edict Lang
- AI agents that generate, verify, and execute code autonomously.
- Running untrusted code in a sandboxed WASM environment with no ambient authority.
- Building deterministic, replayable execution pipelines for testing or auditing.
- Deploying verified programs to edge runtimes (e.g., Cloudflare Workers).
FAQ from Edict Lang
What is the canonical program format?
Edict Lang programs are JSON ASTs. The compiler never parses text; agents produce the AST directly via MCP tool calls.
How does Edict Lang enforce safety?
The effect system (io, reads, writes, fails) lets the host inspect a program’s capabilities before execution. Compilation targets WebAssembly, which runs in a sandboxed VM with no ambient authority. Runtime limits (timeout, memory, filesystem) are enforced by the host adapter.
Can I run Edict Lang in the browser?
Yes. The compiler is available as an ESM bundle (edict-lang/browser for checking, edict-lang/browser-full for full compile-and-run). No server needed beyond a static HTTP server for ESM modules.
What transports does the MCP server support?
The MCP server supports stdio transport by default and HTTP transport when run with EDICT_TRANSPORT=http. Docker images are available for both modes.
Does Edict Lang support contract verification?
Yes. Pre‑ and post‑conditions are verified at compile time using Z3 via SMT. Failing contracts return structured errors with concrete counterexamples, enabling agents to self‑repair.
Frequently asked questions
What is the canonical program format?
Edict Lang programs are JSON ASTs. The compiler never parses text; agents produce the AST directly via MCP tool calls.
How does Edict Lang enforce safety?
The effect system (`io`, `reads`, `writes`, `fails`) lets the host inspect a program’s capabilities before execution. Compilation targets WebAssembly, which runs in a sandboxed VM with no ambient authority. Runtime limits (timeout, memory, filesystem) are enforced by the host adapter.
Can I run Edict Lang in the browser?
Yes. The compiler is available as an ESM bundle (`edict-lang/browser` for checking, `edict-lang/browser-full` for full compile-and-run). No server needed beyond a static HTTP server for ESM modules.
What transports does the MCP server support?
The MCP server supports stdio transport by default and HTTP transport when run with `EDICT_TRANSPORT=http`. Docker images are available for both modes.
Does Edict Lang support contract verification?
Yes. Pre‑ and post‑conditions are verified at compile time using Z3 via SMT. Failing contracts return structured errors with concrete counterexamples, enabling agents to self‑repair.
Basic information
More Other MCP servers
Nginx UI
0xJackyYet another WebUI for Nginx
Maestro
mobile-dev-incPainless E2E Automation for Mobile and Web
Awesome Mlops
visengerA curated list of references for MLOps
AutoBrowser MCP
autobrowser-aiBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
Comments